IoT System To Monitor Soil Moisture With Arduino
This IoT system monitors the soil moisture using Arduino and sensors. Data are sent to an IoT cloud platform to access it anywhere.
This IoT system monitors the soil moisture using Arduino and sensors. Data coming from sensors is sent to a cloud platform. Moreover, this Arduino IoT system implements a notification system so that when the soil gets too dry it sends a notification.
As you know already, Internet of things is one of the most important topics nowadays, that promises to shape our future and the way we live. One interesting aspect about IoT is the fact we can experiment an IoT system building it by ourselves. There are several prototyping boards available in the market and we can build amazing IoT projects without spending too much.
IoT system project overview
To build this project we need:
- Arduino MKR1000 (or a compatible board)
- Moisture sensor
- Carriots free account (use this link to create a free account)
- IFFT account (to know more click here)
The idea that stands behind this project is building an IoT system that monitors the soil moisture detecting when it gets too dry. The Arduino MKR1000 controls the sensor sending the data to the Carriots IoT platform. This platform, in turn, stores the data coming from the sensor and detects when the values stored are under a threshold level. We will see later how to analyze the data. By now, we can assume that the Carriots IoT platform is able somehow to invoke an IFFT service that will send a short message to the user alerting him. Building this IoT system we can explore how to use several components of the IoT ecosystem. Moreover, this project displays the humidity soil status using a LEDs matrix. Let us see how to build it.
IoT system sensors: Retrieving data
In this first step, we have to read the sensor data. This IoT project uses YL-38 + YL-69 sensor. This is an analog sensor that can be inserted into the soil we want to check. The picture below shows how to connect the sensor to Arduino:
The code is very simple, we read data from the A1 pin and then we calculate the humidity:
float moistureHum = analogRead(A1); moistureHum = (1023 - moistureHum) * 100 /1023;
This is very simple, not much to explain about it. The value stored in
moistureHum is the one we will send to IoT cloud platform. Moreover, to do it, Arduino MKR1000 has to connect to internet so that it can sends data. The code below describes how to connect Arduino to the WiFi:
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw