Skip to main content
← Writing
2026-06-09Engineering4 min read

Building an ESP32 Smart Plant Watering System

How I built the first phase of an ESP32-powered plant watering system with soil moisture sensing, pump control, and a local display.

ESP32 smart plant watering system with LCD display showing soil moisture

Phase 1: From Idea to Working System

I recently built the first working phase of my ESP32-based smart plant watering system. The goal was simple: monitor soil moisture, display the current status, and automatically water the plant when the soil gets too dry.

This phase focused on building a reliable local system before adding cloud features, environmental sensors, or analytics. I wanted the core hardware and logic to work first.

What the System Does

The system currently reads soil moisture using a capacitive soil moisture sensor, converts the raw analog reading into a moisture percentage, and shows the result on a 16x2 I2C LCD display.

When the moisture drops below the configured threshold, the ESP32 activates a relay-controlled 5V pump. An LED also turns on while the pump is running, making the watering state visible at a glance.

Current features include:

Sensor Calibration

The most important part of the project was calibrating the soil moisture sensor. Raw sensor values are not useful on their own, so I measured the sensor in two known conditions.

Dry/Air reading: 2791
Wet/Water reading: 988

Those two values are used to map the sensor reading into a moisture percentage.

const int CAL_DRY = 2791;
const int CAL_WET = 988;

Now the system can show a simple percentage instead of raw ADC values.

Local Display

The LCD gives immediate feedback without needing a computer or web dashboard.

Moisture: 94%
Status: OK

This small addition made the project feel much more complete. It also makes debugging easier because I can check the system state directly from the device.

Building the Enclosure

After testing the sensor, relay, pump, and display separately, I combined everything into a clean enclosure.

The enclosure is a cheap box i bought and modified. It helps protect the electronics, reduces wiring clutter, and makes the system easier to place near the plants. Moving from loose wiring to a contained box was a big milestone because it turned the project from a prototype into something that feels like a real device.

Lessons Learned

This phase reinforced a few important engineering lessons:

Next Phase

The next phase will expand the system beyond soil moisture. I want to add environmental monitoring and data logging so the system can better understand the plant’s growing conditions.

Planned additions include:

Eventually, the goal is to build a complete plant monitoring platform that records environmental data, tracks soil moisture over time, and waters based on each plant’s needs.

Final Thoughts

Phase 1 is complete. The ESP32 reads soil moisture, displays the status, and controls a pump through a relay.

This started as a simple watering idea, but it is quickly becoming a full IoT plant health system.

Phase 2 begins soon.