Build an Auto-Watering System for a 4×4 Tent
A closed-loop watering build that reads real substrate moisture and waters only when the plant actually needs it — wiring, code outline, and the exact parts list.
Hand-watering is the first thing growers want to automate, and for good reason: it's the daily chore that punishes you for traveling and the easiest place to over- or under-water. The goal of this build is a system that measures the substrate, decides, and acts — not a dumb timer that waters on a schedule whether the pot is wet or not.
The loop is simple: a capacitive soil moisture sensor reads the root zone, an ESP32 compares it to a threshold you calibrate per substrate, and when the soil is too dry the ESP32 closes a relay that opens a 12V solenoid valve fed from a small pump or gravity reservoir. When moisture climbs back above target, the valve closes. Because the valve is normally-closed, a power loss fails safe — it shuts off rather than flooding your tent.
Wiring is where most first builds go wrong, so keep the low-voltage and mains/12V sides clearly separated. Power the ESP32 from USB, drive the relay board from its 3.3V logic, and run the solenoid off a dedicated rail — never try to power the valve from the controller. A DIN-rail PSU keeps this tidy and protected inside an enclosure.
On the firmware side, ESPHome gets you there in an afternoon: define the analog sensor, a calibration map from raw reading to percent moisture, and an automation that toggles the relay on a threshold with a minimum-interval guard so it can't rapid-cycle. Log the moisture curve to Home Assistant and you'll quickly see how your medium dries between waterings.
Once this loop is running, everything else — nutrient dosing, multiple zones, a float switch on the reservoir — is an increment on the same pattern: sense, decide, actuate. Start here, get one plant watering itself reliably for a week, then scale.




