HydroGuardian is a mositure sensor designed for soil monitoring applications. Its deisgned to be part of the HomeAsstant ecosystem and is built with ESPHome. The device provides reasonable accuracy for home plant and garden enthusiests. The solution was developed to help monitor the moisture state of plants and alert when they need to be watered. Each plant has its own requirements for hydration so “water once a week” doesnt work for all plants. You can customize each plant with its own rules in HomeAssistant, enabling you to address the needs of each plant in your home/garden. HydroGuardian uses a capacitince sensor to determine the amount of hydration.
The video covers setup and installation of the sensor:
Wemos D1 - https://amzn.to/41WHOL1
Capacitance Soil Sensor - https://amzn.to/41PWMmg
Be sure to get one with good reviews as these sensors are produced very cheaply.
M3x25mm Screws (x2) - https://amzn.to/3oGmOKc
Stainless will perform better given the damp plant environments.
3D Printed Parts -
USB Cable & 5V Power Supply - https://amzn.to/3AyrRik
Alternatively you can use a microUSB and charging block of your choice. You only need 500ma of power to run the sensor as described here.
Optionally if your sensor is being used outdoors you may want to purchase clear silicone, or clear enamel to seal your sensor body. Light incidental contact with water should pose no problem, but if it will be exposed directly to rain you may want to seal the enclosure better since 3D Prints are generally not watertight. The simplest solution would be to completely cover the inside of the enclosure with clear silicone. Once built the device is updated OTA (over the air) with Home Assistant so you shouldnt require to open it again. If you do you can easily peel off the silicone. Just fill the body with Silicone and close the enclosure.
Assembly is fairly straightforward. 3 Points need to be soldered. The 5V and GND go to the Vin and GND on the Wemos D1. The signal pin from the sensor goes to A0. Thats its for assembly. See the above video for detailed steps.
There are a number of ways to get your device programmed. The easiest method is to use the web provisioning tool and then adopt the device or to plug the device into your Home Assistant machine and program it from there.
Once you have the device provisioned. Modify the code in ESP Home, add the following lines at the top under the esphome:
at the the top. This will assure the CPU on the board is running at full speed:
platformio_options:
board_build.f_cpu: 160000000L
Then, at the end of the same file. Use the following ESP Home code which will add a sensor and LED light. The LED Light can be used to indicate a plant that needs watering without checking home assistant.
– Updated 1/15/25 for EPSHOME YAML Updates. –
web_server:
port: 80
light:
- platform: binary
name: "Blue Light"
output: light_output
id: led_light
restore_mode: ALWAYS_OFF
output:
- platform: gpio
pin: GPIO2
id: light_output
inverted: true
sensor:
- platform: adc
pin:
number: A0
allow_other_uses: true
id: "adcMoisture"
accuracy_decimals: 5
unit_of_measurement: '%'
filters:
- calibrate_linear:
- 0.32324 -> 100.0
- 0.69336 -> 0
name: "Plant - Moisture Level"
update_interval: 30s
- platform: adc
pin:
number: A0
allow_other_uses: true
id: "adcRaw_Sensor_Data"
accuracy_decimals: 5
name: "Plant - Sensor Voltage"
update_interval: 30s
- platform: wifi_signal
name: "Plant - WiFi Signal Sensor"
update_interval: 30s