A soil moisture monitoring system for gardens and farms.
The arduino version of the monitor requires a host computer to be connected via USB to network enabled.
The host computer can be used to communicate with the device, upload sketches, and automatically update the device when a new version of the sketch is available.
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.
Use this script when you want to upload the sketch and also create all related services.
The script does the following:
Note: If you only want to upload the sketch then use the upload script below.
Arduino Nano
Use the following commands for an arduino nano compatible microcontroller.
Syntax:
sh create-garden-monitor-nano.sh [DeviceLabel] [DeviceName] [Port]
Notes:
Example:
sh create-garden-monitor-nano.sh "Monitor1" monitor1 ttyUSB0
Arduino Uno
Use the following command for an arduino uno compatible microcontroller.
Syntax:
sh create-garden-monitor-uno.sh [DeviceLabel] [DeviceName] [Port]
Notes:
Example:
sh create-garden-monitor-uno.sh "Monitor1" monitor1 ttyUSB0
The output should look something like this:
The device has now been created and the code has been uploaded to the microcontroller.
Note: Press CTRL+C to exit the serial monitor back to the terminal.
Use this script if you want to upload the sketch to the microcontroller without creating the related services on the host computer.
Notes:
Arduino Nano
Use the following command for an arduino nano compatible microcontroller.
Syntax:
sh upload-monitor-nano-sketch.sh [Port]
Notes:
Example:
sh upload-monitor-nano-sketch.sh ttyUSB0
Arduino Uno
Use the following command for an arduino uno compatible microcontroller.
Syntax:
sh upload-monitor-uno-sketch.sh [Port]
Notes:
Example:
sh upload-monitor-uno-sketch.sh ttyUSB0
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 from the device before continuing on 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 soil moisture sensor adapter to the arduino expansion board:
Connect the USB cable to the device and the garden computer.
The soil moisture sensor adapter LED should be flashing on and off every few seconds, as it takes a reading.
pio device monitor
The output should look 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.
Testing the soil moisture sensor power is an optional step but is useful for troubleshooting and to avoid wiring problems. You can choose to skip this step and come back to it later if there is an issue.
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: