Smart Plant Watering System with ESP32
Automated plant watering system using soil moisture sensors, water pump, and ESP32 with cloud dashboard.
Parts List
- ESP32 DevKit
- Soil Moisture Sensor
- Mini Water Pump
- Relay Module
- Tubing
- Breadboard
- Jumper Wires
Step-by-Step Instructions
Wire Soil Moisture Sensor
Connect the soil moisture sensor's VCC pin to the ESP32 3.3V pin and GND to ground. Wire the analog output (AOUT) to GPIO pin 34, which supports analog input on the ESP32. Insert the sensor probes into the soil near your plant's root zone, ensuring good contact with the soil for accurate readings.
Connect Water Pump
Wire the mini water pump through a single-channel relay module to safely switch its power on and off. Connect the relay's IN pin to GPIO pin 26 on the ESP32, and wire the pump's power supply through the relay's COM and NO terminals. Attach tubing from the pump to the plant pot and secure it so water flows directly to the root area.
Write Sensor Code
Write an Arduino sketch that reads the analog moisture value from the sensor and maps it to a 0-100 percentage scale. Define a threshold value (typically around 30-40%) below which the pump should activate. When the moisture reading drops below the threshold, turn on the relay for a timed watering cycle of 2-3 seconds, then re-check the moisture level.
Add Cloud Dashboard
Create a free ThingSpeak or Blynk account and obtain your API key. Modify the sketch to send moisture readings to the cloud platform at regular intervals using WiFi. Set up alerts on the dashboard so you receive a notification whenever your plant needs attention, and view historical moisture data to optimize your watering schedule.