IoT Smart Plant Monitoring System Using ESP32: Soil, Temperature and Auto-Watering
One of the most-built DIY IoT projects of 2026 is also one of the most useful: a plant monitor that tells your phone when the soil is dry, and waters the plant itself if you let it. Using an ESP32, a capacitive soil moisture sensor and a temperature-humidity sensor, you can build the whole system in an afternoon.
How It Works
The capacitive soil sensor measures how wet the soil is without corroding the way old resistive sensors did. The ESP32 reads the sensor plus air temperature and humidity, shows the values on a small OLED display, and sends them to the Blynk app on your phone. If the soil gets too dry, the ESP32 switches a relay that runs a small water pump for a few seconds.
Components Required
- ESP32 DevKit board
- Capacitive soil moisture sensor (v1.2 or similar)
- DHT22 temperature and humidity sensor
- 0.96 inch OLED display (I2C)
- 1-channel 5V relay module
- Small 5V DC water pump and water container
- 5V power supply, jumper wires, breadboard
Circuit Connections
- Soil sensor AO to GPIO34 (analog input), VCC to 3.3V, GND to GND
- DHT22 data pin to GPIO4, VCC to 3.3V, GND to GND
- Relay IN to GPIO5, VCC to 5V, GND to GND
- OLED SDA to GPIO21, SCL to GPIO22
- Water pump through the relay COM and NO terminals, powered separately
Calibration Is Important
Soil readings vary with the sensor and the soil. As a starting example, a dry pot may read near the top of the ESP32 12-bit ADC range and a fully wet pot much lower, but do not copy anyone's numbers blindly. Note your own readings in dry soil and in freshly watered soil, then set your watering threshold between the two. Recheck after a week, because readings drift as roots grow.
Build Steps
- Wire the circuit as listed and mount the sensor in the plant pot.
- Create a Blynk template with datastreams for moisture, temperature and humidity, and add a manual pump button.
- Program the ESP32 to read the sensors every few seconds, update the OLED and Blynk, and switch the pump on only when the soil is below your threshold.
- Test with a dry pot first, then a wet pot, and confirm the pump stops on its own.
Troubleshooting
- Moisture stuck at one value: check the sensor wiring and that it is powered from 3.3V.
- Pump never starts: check the relay module power and that the pump has its own supply.
- Blynk shows offline: re-check the Wi-Fi name, password and Blynk auth token.
Power Saving Tip
For a battery version, put the ESP32 into deep sleep between readings and wake it every 15 minutes. The sensor only needs power while measuring, so switch it from a GPIO pin instead of leaving it powered all the time.
Which plant will you automate first? Share your build in the comments.
