DIY Smart gardening

My (hardware) setup

Hardware Setup
The box containing the water
Inside of the box

Measuring the water level

As you can see on the first photo, there’s a tiny box on the top of the box containing the water. This contains an ESP8266 connected to a battery as well as a HC-SR04 distance transducer. This measures the distance between the top of the box and the water level. If it reaches a max distance, I know the water level is too low, thus stop the automation.

HC-SR04 distance transducer
HC-SR04 distance transducer to check the water level
HC-SR04 distance transducer
Holes in the top of the box to check water level

My (software) setup

To run all of this, I’m using Homekit. The pump is connected to a Homekit power outlet. This enables me to create automations.

Screenshot of sensors
The percentage is showing how much water is left in the box

Automations

Regular watering

WHEN (Time => 8am or Time => 7pm)
AND (enough water in the box left)
AND (no rain)
THEN (turn on power outlet) (therefor start watering)
AND (turn off after 2 minutes)

Watering if it was a hot day

WHEN (Time => 7.05pm)
AND (enough water in the box left)
AND (no rain)
AND (temperature is still > 25c)
THEN (turn on power outlet) (therefor start watering)
AND (turn off after 2 minutes)

Alarms

If the water in the box falls below a certain threshold, I’m getting an alarm on my mobile, so that I know it’s time to refill. This check is important so that the pump is not running dry.

Some impressions

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store