
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:
- ESP32 microcontroller
- Capacitive soil moisture sensor v2.0
- 5V relay-controlled pump
- 16x2 I2C LCD display
- Status LED
- Custom enclosure
- Basic watering threshold logic
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:
- Calibrate sensors before trusting their readings.
- Test each component separately before combining everything.
- Keep watering logic local so the plant does not depend on Wi-Fi.
- Add safety limits before controlling real hardware.
- Physical packaging matters as much as the code.
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:
- Room temperature
- Humidity
- Light level
- Air quality
- Database logging
- Historical charts
- Plant-specific watering profiles
- Remote monitoring dashboard
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.