Step 1: Firstly, connect the GPIO pin to the bread board as shown in the figure.
Figure 2: Connect the GPIO pin to the bread board
Step 2: Here we use the PIN Number: “
4 “ (As per number 4(pin rank 7), third from the top – left ). For getting the output from the raspberry pi connect eh jumper wire from Raspberry PI GPIO pin “
4” to bread board as shown in image,
Figure 3: Connect eh jumper wire from Raspberry PI GPIO pin
Step 3: Now take LED and put it on the bread board as shown in the image.
Connect the Plus terminal of LED to the Jumper cable (green cable in image) coming from the GPIO Pin “
4” as shown in image,
Figure 4: Connect the Plus terminal of LED to the Jumper cable
Step 4: Now take another jumper cable (black cable in image) connect it the GPIO pin “
Ground” as per number 3(Pin rank 6), third from the top right. And add another terminal of this wire to the minus terminal of the LED as shown in the figure.
Figure 5: Black cable in image
Step 5: Here for detecting the plus/minus terminal of LED, bigger (toll) terminal of LED is Plus and small (short) terminal of LED is minus. Or you can define it by cutting the side part of the LED that is Minus terminal.
Figure 6: Detecting the plus-minus terminal of the LED
Step 6: Now write the Node.js program for blink LED every 1 second for 1 minute.
Here we use the “
Onoff ” module for accessing the GPIO Pin of raspberry pi device.
Now enjoy with your Raspberry Pi. If you liked my tutorial, then please comment on this.