Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 8 ■ IOT PATTERNS: WEB APPS

Circuit


In this section, you are going to build the circuit required for the temperature monitoring
system. This circuit uses a low-cost and easy-to-use TMP36 temperature sensor. The
sensor returns its values in voltage, which is converted into Celsius and Fahrenheit.




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




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




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




  4. 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 temperature
    sensor. The left pin of the sensor is the power (+) and the right
    pin is the ground (-).




  5. To read values from the temperature sensor, you will need to
    connect a jumper cable from the analog voltage port (middle pin)
    of the temperature sensor to the A0 (Analog) port of Arduino.
    Your code will read the voltage from this port to calculate the
    temperature in Celsius and Fahrenheit.




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