Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 12 ■ IOT PLATFORMS

Circuit


In this section, you are going to build the circuit required for the soil moisture control
system. This circuit uses a soil moisture sensor to detect the amount of moisture in the soil.

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

2. Attach a WiFi shield to the top of the Arduino.

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 moisture
sensor.

5. To read the moisture sensor values, you need to connect a
jumper cable from the analog port of the moisture sensor
to the A0 (Analog) port of your Arduino. Your code will read
the moisture level from this port. The sensor returns a value
between 0 and 1023. Higher values correspond to lower soil
moisture levels.

Your circuit is now complete and should look similar to Figures  12-3 and 12-4.

Figure 12-3. Circuit diagram of the soil moisture control system
Free download pdf