Building Arduino Projects for the Internet of Things

(Steven Felgate) #1

CHAPTER 4 ■ COMPLEX FLOWS: NODE-RED


Software Required


In order to develop the light sensor tweet system, you need following software :



  • Arduino IDE 1.6.4 or later version

  • Node-RED 0.13.2 or later version


Circuit


In this section you are going to build the circuit required for the light sensor tweet system.
This circuit uses an analog light intensity sensor, which returns values between 0 and




  1. Higher values mean higher intensity of light.




  2. Make sure your Arduino is not connected to a power source,
    such as a computer via a USB or a battery.




  3. Attach a WiFi shield to the top of Arduino. All the pins should
    align.




  4. Using jumper cables, connect the power (5V) and ground
    (GND) ports on Arduino to the power (+) and ground (-) ports
    on the breadboard.




■ Tip It is a good practice to use red jumper cables for power (+/VNC/5V/3.3V) and black


jumper cables for ground (-/GND).




  1. Now that your breadboard has a power source, use jumper
    cables to connect the power (+) and ground (-) ports of your
    breadboard to the power and ground ports of the light sensor.




  2. To read the light sensor values, you need to connect a jumper
    cable from the analog read port of light sensor to the A0
    (analog) port of your Arduino. Your code will use this port to
    read the light’s intensity value.




Your circuit is now complete and it should look similar to Figures  4-4 and 4-5.
Free download pdf