A WiFi based wireless soil moisture monitoring system for gardens and farms.
The ESP WiFi version of the monitor requires a host computer to be connected to the same network running the MQTT broker. The MQTT broker allows devices to communicate.
The host computer can be used to upload sketches then the USB cable can be removed and the device deployed.
Once completed you should have a terminal window open that looks like this:
Use this terminal in the GreenSense/Index directory for commands provided throughout this guide.
Connect the device to the garden computer via the USB cable.
Choose between creating a device (including network functionality) or simply uploading the sketch on its own. You don't need to run both because the "create" script takes care of uploading.
The script does the following:
Note: If you only want to upload the sketch then use the upload script below.
Syntax:
sh create-garden-monitor-esp.sh [DeviceLabel] [DeviceName] [Port]
Note: Don't include the /dev/ in the [Port] argument. Use ttyUSB0 instead of /dev/ttyUSB0.
Example:
sh create-garden-monitor-esp.sh "WiFiMonitor1" wifiMonitor1 ttyUSB0
The output should look something like this:
Notes:
Syntax:
sh upload-monitor-esp-sketch.sh [DeviceName] [Port]
Example:
sh upload-monitor-esp-sketch.sh wifiMonitor1 ttyUSB0
Note: The port needs to match the serial port the monitor is connected to.
The output should look similar to this:
Once you see data being written to the screen the device is running, and should now respond to commands.
Note: Press CTRL+C to exit back to the terminal.
The D; prefix indicates the line contains data.
The following keys and values are displayed:
Disconnect the USB cable so the power is off before continuing with assembly.
Connect two wires to the soil moisture sensor:
Connect the same two wires to the soil moisture sensor adapter:
They should now be connected like this:
Connect 3 wires to the soil moisture sensor adapter:
Connect the 3 wires to the arduino development board:
ESP12E Development Board
Wemos D1 with Sensor Shield
Connect the device to the host computer using a USB cable.
View the device output:
pio device monitor --baud 115200
The output looks similar to this:
Submerge the soil moisture sensor in water (or similar):
The values should change to something like this:
The calibrated (C) value doesn't go all the way to 100 because the system hasn't yet been calibrated. It is currently operating with the default calibration values.
The soil moisture sensor readings can be tested to ensure that it's working correctly.
The soil moisture sensor power can be tested to ensure that it's working correctly.
The simplest way to calibrate the monitor is to set up networking and then use a mobile device.
The monitor system can be upgraded to the irrigator system by adding a pump: