author Andrei Simion
ACES 2022
source code : Soil Moisture Monitoring System Gitlab
youtube demo : YT DEMO
The idea from which I started this project would be that we always forget to water the flowers, and in agriculture or even in the flower garden (or even the few flower pots in everyone's apartment) monitoring the soil moisture is imperative. If we want to have good crops or flowers that are healthy and grow beautifully.
Due to the fact that IoT is becoming more and more present in our lives, in order to simplify this routine, of regular watering / irrigation, I decided to create a system for monitoring and tracking soil moisture.
The system picks up soil moisture with a sensor and will publish the data to the feed in my dashboard on io.adafruit.com where a real-time graph is drawn. At the same time, the current soil value will be displayed locally on an LCD screen.
All the time, different events that are fulfilled in the operation of the system will be displayed on the serial.
In addition, the system will send a daily warning email at a certain time with the current value of soil moisture.
The purpose of this project is to have good irrigation management that will provide better crops or healthier plants.
As hardware components for the realization of this project I used:
1. Development board ESP-WROOM-32
The core of this module is the ESP32-D0WDQ6 chip. The built-in chip is designed to be adaptable and scalable. It has a processor with 2 cores that can be controlled individually and the clock frequency can be adjusted from 80MHz to 240MHz.
Specifications:
2. Display LCD I2C
This LCD 1602 screen has IIC / I2C mode which needs only two connections, SDA / SCL data, Vcc and ground connection. This display is perfect for projects where we do not have many pins available from the microcontroller.
3. Resistive Soil Moisture Sensor
A soil moisture sensor can read the amount of moisture present in the soil surrounding it. It's an ideal for monitoring an urban garden, or your pet plant's water level. This is a must have component for a IOT garden / Agriculture!
The new soil moisture sensor uses Immersion Gold which protects the nickel from oxidation. Electroless nickel immersion gold (ENIG) has several advantages over more conventional (and cheaper) surface platings such as HASL (solder), including excellent surface planarity (particularly helpful for PCB's with large BGA packages), good oxidation resistance, and usability for untreated contact surfaces such as membrane switches and contact points.
Specification:
4. Router WiFi
Access point to WAN. We need to be able to make different requests to various servers (MAIL (SMTP), NTP, MQTT etc).
CONFIG PHASE
In this part of the code I have defined macros and declared global configuration variables specific to the operation of peripherals, connections to servers and APIs that will allow us to make various setup function calls in the next step.
setup()
At this step all the initializations of peripherals, services, etc. that we need are done:
loop()
This is the main loop. Once you reach this stage, the code described in the loop() function will run indefinitely(endless). Basically here is a description of the functionality of the entire system. The following main operations are performed here: