We have a small garden on our balcony with tomatoes, strawberries, cucumbers, and a few other plants. This summer, we were away for three weeks, and instead of asking someone to water the plants daily, I decided to build an automated watering system.
Requirements
The system needed to meet a few basic requirements:
-
Use water from buckets, as there's no water tap on the balcony
-
Allow remote monitoring and control
-
Run automatically, with the option for manual fallback
Planning and Components
The system uses a microcontroller to read moisture values from sensors. Based on those readings, it activates relays that control small water pumps. A simple HTTP server provides access to sensor data and basic graphs.
I used an ESP32 due to its built-in Wi-Fi and low cost. Specifically, I chose an ESP WROOM 32 with an expansion board that accepts 12V input and outputs both 3.3V and 5V.
Sensors and Relays
I used capacitive soil moisture sensors that run on 5V. These sensors return lower voltage when the soil is wet. While the ESP32 doesn’t support 5V analog input, the sensor readings stayed below 3V even in dry air, which seemed acceptable for direct connection.
Because the ESP32 can’t drive pumps directly, I used optocoupler relays, which require less current than mechanical ones. Each pump had its own relay, allowing individual control.
Watering Setup
The water pumps were small 12V models (4.8W–5.8W, 240 L/h), placed inside 40-liter buckets. Tubing and nozzles distributed water to the plants. I bought a kit for this, but it didn’t include enough connectors or nozzles, so in some cases I drilled small holes into the tubing to complete the setup. It is also important to ensure there is no unwanted siphoning happening in case the water level in the bucket higher than a nozzle. I used an air gap canister.
Power and Wiring
Power came from an old 12V laptop adapter. I split the voltage between the microcontroller and relays using Wago connectors. For wiring the sensors, I used Ethernet cable: each cable handled two sensors, with three wires per sensor (5V, GND, Signal).
Software
I used the Arduino IDE to write the control software. On startup, the ESP32 connects to a dedicated Wi-Fi network. The main loop reads sensors at intervals and serves HTTP requests. I accessed the web interface and a balcony webcam remotely via WireGuard.
System Performance
The system functioned reasonably well during the holiday. Some plants received more water than others, which was expected due to the uneven nozzle layout.
The biggest issue came from a neighbour who had agreed to refill the water buckets. Wanting to help, she also watered the plants manually. This overwatering soaked the moisture sensors, some of which weren’t waterproofed. As a result, several sensors shorted and produced incorrect voltage levels. In the logic of the program, this appeared as extremely dry soil. Fortunately, the code had input boundaries and fallback conditions in place, so the system switched to manual mode as designed. After some time, the sensors dried out and resumed normal operation.
Key Takeaways
-
Testing the sensors and monitoring setup early was useful for understanding baseline conditions
-
Exposed electronics should be physically protected—assume not everyone will handle them cautiously
-
Always validate sensor inputs and define acceptable ranges
-
Redundant sensors improve reliability in case of failure
-
Using several pumps simplifies the plumbing compared to more complex branching systems
-
Allow enough testing time before relying on automation for extended absences
-
Consider a hardware watchdog or timed reset to improve long-term reliability
Testing the sensors and monitoring setup early was useful for understanding baseline conditions
Exposed electronics should be physically protected—assume not everyone will handle them cautiously
Always validate sensor inputs and define acceptable ranges
Redundant sensors improve reliability in case of failure
Using several pumps simplifies the plumbing compared to more complex branching systems
Allow enough testing time before relying on automation for extended absences
Consider a hardware watchdog or timed reset to improve long-term reliability
The project met its basic goals and helped keep the plants alive during the holiday. There’s still room for improvement, especially in making the system more robust and easier to maintain.
Comments
Post a Comment