Tuesday, July 10, 2018

Blinking Laser light using KY-008 laser sensor module, Raspberry Pi , Node Red


Hi,

 I like to share my second experience connecting Raspberry Pi , KY008 (Laser  transmitter sensor module ) and Node Red.


I.Things Needed :

 1. Raspberry Pi 3 Model B+


 2. KY008 Laser Transmitter Sensor Module 
         
           


 3. Solderless board

 4. 3 Male to Female Jumper wires.



II.  Circuit Completion

Complete  the circuit has shown below 










III.  Install necessary packages :

a) Download package : http://www.airspayce.com/mikem/bcm2835/bcm2835-1.48.tar.gz
b) tar zxvf bcm2835-1.48.tar.gz
c) Compile process :
         cd bcm2835-1.48
        ./configure
                           
         make

   sudo make check
   sudo make install

d) After completing the installation of the BCM2835 library, we can install the Node-DHT-Sensor library:
                     
 sudo npm install node-dht-sensor
   
IV. Node Red Flow 

a) Start Node Red : sudo node-red-start
b) Drag and drop the nodes as shown below and wire them



c) Configure the nodes as shown below : 

 Inject node :

 Select "String" for  Payload and configure the repeat as "interval" as shown below :


 rpi-dht22  node :




Node Red Flow :

[{"id":"a25a1f7e.a4e56","type":"inject","z":"99f49bf6.8ceb48","name":"On","topic":"","payload":"1","payloadType":"str","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":115,"y":135,"wires":[["1794f512.51b6fb"]]},{"id":"1794f512.51b6fb","type":"rpi-dht22","z":"99f49bf6.8ceb48","name":"","topic":"rpi-dht22","dht":"11","pintype":"0","pin":4,"x":513,"y":138,"wires":[[]]}]


IV. Executing the Node Red Flow 

 Click Deploy. You can see the laser sensor blinking.







Now , you have successfully got the blinking light using KY008 Sensor.


Kindly share your comments to improve my posting.







No comments:

Post a Comment

Mastering IoT Development

Hi, Before reading this post, I would recommend to read the post : https://johnsylvester-johnsylvester.blogspot.com/2018/09/iot-key-co...