Automatic Plant Watering System: ESP32 Build Guide
Share
Automatic Plant Watering System: ESP32 Build Guide
An automatic plant watering system reads soil moisture and turns a pump on when the soil is dry. We asked Soldr for exactly that — one sentence, no parts named — and it specced a 6-part ESP32 tray, wired it, and flagged its own design trade-offs before we asked.
Quick answer: Soldr specs a 6-part ESP32 watering system for Rs.1,405: an ESP32-WROOM-32, a soil moisture sensor, an L298N driver, a peristaltic pump, a 5V supply, and jumper wire. It flags two real electrical mismatches itself before you ask. Parts and wiring are free as a guest — the firmware is a wiring-check stub until you sign in.
Proof of work: we built this exact project through Soldr on 15 August 2026 — every screenshot below is from that session. Published 15 August 2026 · Last updated 15 August 2026.
What parts do you need for an automatic plant watering system?
You need six parts: an ESP32 controller, a capacitive soil moisture sensor, a motor driver to run the pump, a small peristaltic pump, a 5V power supply, and jumper wire. Soldr's session priced the whole tray at Rs.1,405, all six parts in stock, matched 6/6 against the live catalogue on the first pass.
| Part | Role | Price (Rs.) | Where to buy |
|---|---|---|---|
| ESP32-WROOM-32 WiFi BLE Bluetooth MCU Module | Controller — reads the sensor, decides when to water | 280 | ESP32-WROOM-32 |
| Capacitive Soil Moisture Sensor V2.0 | Tells the ESP32 whether the soil is dry | 55 | Capacitive Soil Moisture Sensor V2.0 |
| L298N Motor Driver Module | Pump driver — carries the pump's current so the ESP32 pin doesn't have to | 180 | L298N Motor Driver Module |
| Mini Peristaltic Pump 5V DC | Moves the water, ~100ml/min | 120 | Mini Peristaltic Pump |
| 5V 5A DC Power Supply | Powers the pump and the driver's logic rail | 710 | 5V 5A DC Power Supply |
| Jumper Wire Combo (M-M, M-F, F-F) | Signal and power connections between modules | 60 | Jumper Wire Combo |
| Total (as carded by Soldr) | 1,405 | Cash on delivery available across India |
Two things Soldr flagged about its own tray, unprompted. First: "the L298N Motor Driver Module... its 5V logic requirement is an electrical constraint because the ESP32 uses 3.3V logic." The two talk fine in practice — the L298N's inputs read a 3.3V HIGH correctly — but Soldr named the mismatch rather than gloss over it. Second: "the ESP32 requires 3.3V DC, so its [5V power supply's] stated power input does not directly match this supply." This is expected — every ESP32 dev board carries its own onboard 5V→3.3V regulator — but again, Soldr stated the constraint instead of assuming you'd know why a "5V supply" and a "3.3V board" coexist safely.
Step 1: describe the goal to Soldr, not the parts
Our exact prompt was: "Build an automatic plant watering system that turns on a water pump when the soil is dry, using an ESP32." We named the controller family and the trigger condition — nothing else. Soldr chose the sensor, the driver, the pump, and the power supply on its own.
Soldr's reasoning was concrete rather than generic: it picked the ESP32-WROOM-32 because it "is the lowest-cost controller option shown that meets the ESP32 requirement," and it separated steady draw from peak draw for every active part — the pump alone can spike to 1200mA on startup even though it only draws ~300mA running, which matters if you're sizing a supply later.
Checkpoint: your parts tray shows 6 parts, all in stock, total Rs.1,405, "6/6 matched" in the build log.
Step 2: ask for the firmware — and read what tier you're on
Our second prompt was: "Write the firmware code for this build." As a signed-out guest, Soldr said so directly: "You're on the free preview. Sign in (free) to get 25 build credits — the complete project code... unlocks with them." What it hands over instead is a labeled wiring-check stub, not the finished watering logic.
Read literally, the stub does three honest things: it prints which parts it found, it reads the moisture sensor's analog pin once a second so you can confirm the wiring works, and it explicitly does not switch the pump — Soldr's own inline comment says so, rather than shipping a fake "it works" sketch that quietly does nothing. That is a deliberate, disclosed limit of the guest tier, not a bug.
Checkpoint: your Firmware tab shows a short sketch with [SOLDR]/[INIT] serial log lines and a comment naming it a free-preview hardware test.
Wiring the sensor and driver
Soldr's Wiring tab was viewable in the same session, before the firmware request — the table below is transcribed directly from it. (One session note: after asking for firmware, returning to the Wiring tab showed a "Wiring guide unlocks with build credits" paywall — on content the same guest session had already viewed for free minutes earlier. We're flagging that as a real inconsistency in how the two tabs are gated, not editing around it.)
| From | To | Signal |
|---|---|---|
| ESP32 3V3 | Soil Moisture Sensor VCC | Sensor power |
| ESP32 GND | Soil Moisture Sensor GND | Sensor ground |
| ESP32 GPIO32 | Soil Moisture Sensor AOUT | Analog moisture reading |
| ESP32 3V3 | L298N VCC | Driver logic power |
| ESP32 GND | L298N GND | Driver logic ground (shared with ESP32) |
| ESP32 GPIO4 | L298N SIG | Pump on/off control |
| 5V 5A Power Supply + | ESP32 VIN | Board power |
| 5V 5A Power Supply − | ESP32 GND | Shared ground |
Notice what is not in that table: the pump itself. The L298N's motor output (OUT1/OUT2, screw terminals) and the pump's own supply lead aren't GPIO-style pins, so Soldr's pin-to-pin wiring table doesn't enumerate them — connect the pump's two leads to the L298N's motor-output screw terminals, and feed the L298N's motor-supply terminals from the same 5V rail.
Checkpoint: sensor wired to 3V3/GND/GPIO32, driver logic wired to 3V3/GND/GPIO4, power supply feeding ESP32 VIN — nothing powered on yet.
What does the finished watering logic look like?
The free-preview stub deliberately doesn't drive the pump, so this is a reference sketch built from Soldr's own stated design (moisture sensor on GPIO32, driver signal on GPIO4, calibration required before the reading means anything) — not a transcript of Soldr's own generated file, which requires signing in. Library needed: none, built-in ESP32 Arduino core only.
// Automatic plant watering: capacitive soil sensor + L298N + peristaltic pump, ESP32.
// Reference logic built from Soldr's stated design - calibrate DRY_VALUE/WET_VALUE
// against your own sensor in air vs. in wet soil before trusting the threshold.
const int SENSOR_PIN = 32; // Capacitive Soil Moisture Sensor V2.0, AOUT
const int PUMP_PIN = 4; // L298N SIG
const int DRY_VALUE = 2800; // raw ADC reading in dry air - CALIBRATE THIS
const int WET_VALUE = 1200; // raw ADC reading in water - CALIBRATE THIS
const int WATER_SECONDS = 3; // how long the pump runs per watering cycle
void setup() {
pinMode(PUMP_PIN, OUTPUT);
digitalWrite(PUMP_PIN, LOW); // pump off at boot
Serial.begin(115200);
Serial.println("[SOLDR] plant watering ready");
}
void loop() {
int raw = analogRead(SENSOR_PIN);
bool isDry = raw > ((DRY_VALUE + WET_VALUE) / 2);
Serial.print("[DATA] raw="); Serial.print(raw);
Serial.println(isDry ? " soil: DRY" : " soil: OK");
if (isDry) {
Serial.println("[SOLDR] watering...");
digitalWrite(PUMP_PIN, HIGH);
delay(WATER_SECONDS * 1000UL);
digitalWrite(PUMP_PIN, LOW);
delay(60UL * 60UL * 1000UL); // wait an hour before checking again
} else {
delay(10UL * 60UL * 1000UL); // check every 10 minutes when soil is OK
}
}
Frequently asked questions
Automatic plant watering system banane ke liye kaunse parts chahiye?
Chhe parts: ek ESP32-WROOM-32 module (Rs.280), ek capacitive soil moisture sensor (Rs.55), ek L298N motor driver (Rs.180), ek mini peristaltic pump (Rs.120), ek 5V 5A power supply (Rs.710), aur jumper wires (Rs.60). Total Rs.1,405, Compoden se cash on delivery ke saath available.
Why does Soldr's free preview firmware not actually run the pump?
Because the free-tier code turn ships a wiring-check stub, not the finished project logic - its own comment says the actuators are "named but NOT driven here." It reads the moisture sensor so you can confirm your wiring works, then stops there; the complete watering logic unlocks with a free sign-in and build credits.
What is the price of the parts for this build in India?
Rs.1,405 total for all six parts as Soldr specced them, checked against live Compoden prices in August 2026: ESP32-WROOM-32 Rs.280, soil moisture sensor Rs.55, L298N driver Rs.180, peristaltic pump Rs.120, 5V 5A power supply Rs.710, jumper wire combo Rs.60. Cash on delivery is available across India.
Do I need to calibrate the soil moisture sensor before using it?
Yes - a capacitive soil moisture sensor's raw reading depends on the specific sensor, the soil type, and even cable length, so a fixed threshold from someone else's build will not be accurate on yours. Dip the sensor in water and note the raw value, then let it dry in air and note that value, and set your dry/wet threshold roughly halfway between the two.