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.
Make sure Arduino is not connected to a power source, such
as to a computer via USB or a battery.
Attach a WiFi shield to the top of the Arduino. All the pins
should align.
Use jumper cables to connect the power (5V) and ground
(GND) ports on Arduino to the power (+) and ground (-) ports
on the breadboard.
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 (-).
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.