Skip to content

Thirsty Pot Plant Waterer

Checks the soil, waters your plant when it's dry, and shows the moisture level on a little screen.

Try it

Simulated time

Behavior simulation: shows what it should do. It does not run the code.

Try this: Drag soil moisture below 35% and watch the pump water in bursts until 60%. Then switch the tank to empty and see the safety warning appear.

Controls

  • Soil moisture (drying / wet)50 %
  • Manual water / clear warning
  • Dry threshold (start watering)35 %
  • Wet threshold (stop watering)60 %

What it does

OLED screen
Soil moisture reading
Relay clicked on
Pump motor speed
Water flowing to the pot
Water left in the tank
Tank / sensor warning
Screen mood

What it does

A small box sits next to your plant with a moisture probe pushed into the soil and a thin tube running from a water tank. An ESP32 reads the soil moisture every few seconds and shows it as a percentage on a small OLED screen. When the soil gets too dry, a relay switches on a small 5 V pump that waters in short bursts, pausing so the water can soak in, and stops once the soil is moist again. A safety time limit stops the pump if the tank is empty or the probe has slipped out of the soil.

Try it above: Drag soil moisture below 35% and watch the pump water in bursts until 60%. Then switch the tank to empty and see the safety warning appear.

Safety

  • Water and electronics: the box must sit above and away from the tank and pot so spills or drips can't reach the circuit
  • If the tube slips out of the pot, the pump could flood the floor; the pump time limit keeps any spill small
  • Use only the supplied 5 V USB power adapter; the relay only ever switches the 5 V pump
  • Small parts and tubing are a choking risk for young children and pets

What’s inside

25 parts. We buy, make and put these together for you.

Brain

Runs the program and makes the decisions.

$23.94
  • ESP32 DevKitC (ESP32-WROOM-32, 38-pin)1×

    $16.99

    The small computer that reads the soil, runs the screen and decides when to water.

    • 28 × 54 × 10 mm
    • Firmware: arduino-cpp, pre-loaded
    • Runs on: 4.75 to 5.25 V
    • Draws: about 80 mA

    Pack of 2, you use 1, the spare is yours.

    list price, checked Oct 5, 2026 at AmazonView
  • STEMMA mini relay, 1 channel, 3-5 V (Adafruit 4409)1×

    $6.95

    Switches the 5 V pump on and off when the ESP32 tells it to.

    • 34 × 22 × 11 mm
    • Flyback: diode on the relay board
    • Contacts: 2 A at 30 V DC; the pump draws up to 0.22 A
    • Switched load: 5 V pump only, never mains
    • Runs on: 3 to 5 V
    list price, checked Oct 6, 2026 at AdafruitView

Senses

Measures the world around it.

$12.99
  • Capacitive soil moisture sensor v1.21×

    $12.99

    Pushed into the soil, it tells the board how wet or dry the soil is.

    • 23 × 98 × 10 mm
    • Supply: 3.3 V from board
    • Cable length: 1000 mm
    • Runs on: 3.3 to 5.5 V
    • Draws: about 5 mA

    Pack of 5, you use 1, the 4 spares are yours.

    list price, checked Oct 5, 2026 at AmazonView

Controls

What you press, turn or flip.

$0.95
  • Panel-mount push button, 16 mm1×

    $0.95

    Press for a quick manual top-up or to clear the tank/sensor warning.

    • 18 × 18 × 29 mm
    • Pullup: 10k to 3.3 V
    • Runs on: 0 to 12 V
    • Weight: 4.6 g
    list price, checked Oct 5, 2026 at AdafruitView

Lights, sound and screen

How it tells you what it is doing.

$6.99
  • SSD1306 0.96" OLED, 128x64, I2C1×

    $6.99

    Shows the moisture %, whether the pump is running, the targets and any warning.

    • 28 × 27 × 11 mm
    • I2c address: 0x3C
    • Runs on: 3.3 to 5 V
    • Draws: about 20 mA
    list price, checked Oct 5, 2026 at AmazonView

Motion

Everything that moves.

$10.49
  • Mini submersible water pump, 3-5 V1×

    $9.99

    Sits in the water tank and pushes water up the tube to the plant.

    • 41 × 25 × 25 mm
    • Supply: 5 V
    • Max current: 220 mA
    • Runs on: 3 to 5 V
    • Draws: about 150 mA

    Pack of 4, you use 1, the 3 spares are yours.

    list price, checked Oct 5, 2026 at AmazonView
  • Watering stake for the pot1×

    $0.50

    Clips the tube end into the soil so it can't slip out and spill water.

    • 1.8 × 1 × 11 cm
    • Material: PETG print
    • Length: 120 mm
    Made by usestimate

Power

Where its energy comes from.

$7.95
  • 5 V 2 A wall power supply (UL listed, 2.1 mm plug)1×

    $7.95

    Powers the board, screen, relay and pump safely from a household power outlet.

    • 45 × 65 × 30 mm
    • Output: 5 V 2 A, 2.1 mm plug
    • Runs on: 5 to 5.25 V
    • Draws: about 1000 mA
    • Weight: 76 g
    list price, checked Oct 5, 2026 at AdafruitView

Small electronics and wiring

Resistors, connectors and cables that join it all up.

$53.93
  • STEMMA JST-PH 3-pin to female socket cable, 200 mm1×

    $1.25

    Plugs into the relay and onto three header pins on the circuit board: 5 V, ground and the switch signal.

    • 20 × 0.8 × 0.5 cm
    • Weight: 3.1 g
    list price, checked Oct 6, 2026 at AdafruitView
  • Break-away male header, 36-pin 0.1 in (10 pack)1 packs

    $4.95

    Three pins on the circuit board for the relay cable to plug onto.

    • 91 × 3 × 12 mm
    • Weight: 2 g
    list price, checked Oct 6, 2026 at AdafruitView
  • 1N4007 rectifier diode1×

    $6.99

    Soaks up the electrical kick from the pump motor when it switches off, protecting the relay.

    • 5 × 3 × 3 mm
    • Placement: across pump, stripe to +
    • Runs on: 0 to 1000 V
    • Weight: 0.33 g

    Pack of 100, you use 1, the 99 spares are yours.

    list price, checked Oct 5, 2026 at AmazonView
  • Electrolytic capacitor 100 µF 25 V1×

    $7.99

    Smooths the power so the board doesn't reset when the pump starts.

    • 6 × 6 × 11 mm
    • Value: 100 uF 25 V
    • Runs on: 0 to 25 V

    Pack of 50, you use 1, the 49 spares are yours.

    list price, checked Oct 6, 2026 at AmazonView
  • Resistor 10 kΩ, 1/4 W, 5 %1×

    $0.75

    Keeps the button signal steady when it is not pressed.

    • 6 × 3 × 3 mm
    • Value: 10 kohm
    • Runs on: 0 to 300 V

    Pack of 25, you use 1, the 24 spares are yours.

    list price, checked Oct 5, 2026 at AdafruitView
  • DC barrel jack to screw terminal adapter (female)1×

    $3.75

    The socket on the box where the power adapter plugs in.

    • 14 × 30 × 13 mm
    • Runs on: 0 to 24 V
    • Draws: about 0 mA
    list price, checked Oct 5, 2026 at SparkFunView
  • Perma-Proto half-size solderable breadboard PCB1×

    $4.50

    Holds the board and small parts with permanent connections.

    • 81 × 51 × 2 mm
    • Weight: 12 g
    list price, checked Oct 5, 2026 at AdafruitView
  • Screw terminal block, 2-pin, 2.54 mm3×

    $2.85

    Firm connection points for the pump cable, sensor cable and power.

    • 5 × 6 × 9 mm
    • Runs on: 0 to 150 V
    • Draws: about 0 mA
    • Weight: 0.5 g
    list price, checked Oct 5, 2026 at AdafruitView
  • Hook-up wire 22 AWG solid core, 6 x 25 ft1 sets

    $15.95

    Wires inside the box and the extension leads to the pump and probe.

    • 25 × 5.1 × 5.1 cm
    • Weight: 340.7 g
    list price, checked Oct 5, 2026 at AdafruitView
  • Heat-shrink tubing assortment1 packs

    $4.95

    Seals and insulates wire joints, especially at the wet pump end.

    • 15 × 0.5 × 0.5 cm
    list price, checked Oct 5, 2026 at AdafruitView

Body and structure

The case, frame and panels.

$13.00
  • Silicone water tube, 4 mm inner / 6 mm outer2 m

    $3.00

    Carries water from the pump in the tank to the plant pot.

    • 33 × 0.6 × 16 cm
    • Material: food-safe silicone
    • Inner diameter: 4 mm
    estimate
  • Water tank with lid, 2 litre1×

    $6.00

    Holds the water the pump draws from; lid has holes for the tube and cable.

    • 13 × 11 × 18 cm
    • Material: food-safe plastic
    • Volume l: 2
    estimate
  • Printed controller box with lid1×

    $4.00

    Protects the electronics, with a window for the screen and a hole for the button.

    • 13 × 5.1 × 8 cm
    • Feature: drip lip, raised feet, cable glands, four screw bosses on the floor for the relay
    • Size: 120 x 80 x 45
    • Material: PETG
    Made by usestimate

Fixings

Screws, bolts and ties that hold it together.

$32.32
  • Brass heat-set insert, M3 x 4 mm8×

    $5.95

    Strong threads in the box so the lid and circuit board screw in firmly.

    • 4 × 4 × 4 mm

    Pack of 50, you use 8, the 42 spares are yours.

    list price, checked Oct 5, 2026 at AdafruitView
  • M3 socket head screw (6-30 mm)8×

    $9.99

    Hold the lid and circuit board in the box.

    • 6 × 6 × 13 mm
    • Length: 8 mm

    Pack of 1120, you use 8, the 1112 spares are yours.

    list price, checked Oct 5, 2026 at AmazonView
  • M2.5 x 8 mm pan head self-tapping screw, stainless4×

    $8.49

    Hold the relay board to its four printed bosses through its 2.5 mm holes.

    • 4 × 4 × 10 mm
    • Weight: 0.26 g

    Pack of 50, you use 4, the 46 spares are yours.

    list price, checked Oct 6, 2026 at AmazonView
  • Cable ties, 8" UV-resistant black4×

    $7.89

    Keep cables and tube tidy and strain-relieved at the box.

    • 0.5 × 0.1 × 20 cm
    • Weight: 1.13 g

    Pack of 100, you use 4, the 96 spares are yours.

    list price, checked Oct 5, 2026 at AmazonView

Parts total (25 lines)

$162.56

$149.06 from supplier list prices, $13.50 estimated. Preparation and shipping are added when you order.

How it goes together

The step-by-step instructions that come with your order, 3 steps. Try them here first.

Before you start

Thirsty Pot Plant Waterer goes together in 3 steps, about 13 min in all. No soldering and no coding.

Already done in our workshop

  • Print the box, lid and tube stake
  • Build the main circuit board
  • Wire the screen, relay, button and power
  • Mount everything in the box
  • Load the program and calibrate the probe
  • Water test on the bench
  • Pack the box

3 steps

Code

The code it runs1 file, 300 lines. We load it onto the board for you.

Uses: Adafruit SSD1306, Adafruit GFX Library

plant_waterer/plant_waterer.ino
/*  ================================================================  TINKERLY AUTOMATIC PLANT WATERER - firmware for ESP32 DevKitC  ================================================================  What this program does, in plain words:   - Every 2 seconds it reads the soil moisture probe and turns the     reading into a 0-100 % moisture value.   - The small OLED screen shows the moisture, what the pump is doing     and the start / stop targets.   - When the soil drops below the DRY target (35 %), it waters in     short bursts: pump ON for 3 s, then pause 20 s so the water can     soak in, then check again.   - It stops as soon as the soil reaches the WET target (60 %).     The gap between 35 % and 60 % stops the pump flicking on and off.   - SAFETY: if the pump has run for 30 s in total and the moisture has     not gone up by at least 5 %, something is wrong (tank empty, tube     loose or probe out of the soil). The pump is stopped and the screen     shows 'CHECK WATER TANK / SENSOR'.   - The button: a short press gives a 3 s manual top-up. If the     warning is showing, a press clears it instead.   Wiring used (must match the box):   GPIO34 <- soil probe AOUT (analog)   GPIO21 <-> OLED SDA,  GPIO22 -> OLED SCL  (I2C, address 0x3C)   GPIO4  -> relay Sig (STEMMA cable; switches the 5 V pump)   GPIO13 <- button to GND, 10k pull-up to 3V3 (pressed = LOW)   Libraries: Adafruit GFX Library, Adafruit SSD1306  ================================================================*/ #include <Wire.h>#include <Adafruit_GFX.h>#include <Adafruit_SSD1306.h> // ---------------- Pins ----------------const int PIN_SOIL   = 34;   // analog input from soil probeconst int PIN_SDA    = 21;   // OLED dataconst int PIN_SCL    = 22;   // OLED clockconst int PIN_RELAY  = 4;    // relay control (pump)const int PIN_BUTTON = 13;   // manual / clear button // The STEMMA relay (Adafruit 4409) connects COM to NO when Sig is HIGH.// If a module is the 'low-trigger' type, change this to LOW.const int RELAY_ON_LEVEL  = HIGH;const int RELAY_OFF_LEVEL = (RELAY_ON_LEVEL == HIGH) ? LOW : HIGH; // ---------------- Settings ----------------const int DRY_THRESHOLD = 35;          // start watering below this %const int WET_THRESHOLD = 60;          // stop watering at this % const unsigned long READ_INTERVAL_MS   = 2000;   // how often to read the soilconst unsigned long PUMP_BURST_MS      = 3000;   // pump on time per burstconst unsigned long SOAK_MS            = 20000;  // pause between burstsconst unsigned long MANUAL_MS          = 3000;   // manual top-up lengthconst unsigned long SAFETY_PUMP_MS     = 30000;  // total pump time allowed without progressconst int           PROGRESS_PERCENT   = 5;      // moisture must rise this much to count as progressconst unsigned long SCREEN_INTERVAL_MS = 250;    // screen refreshconst unsigned long DEBOUNCE_MS        = 40; // Probe calibration (raw ADC 0-4095). Checked in the workshop:// probe in dry air ~ RAW_DRY, probe in a glass of water ~ RAW_WET.const int RAW_DRY = 2900;const int RAW_WET = 1300; // ---------------- Screen ----------------Adafruit_SSD1306 display(128, 64, &Wire, -1);bool displayOk = false; // ---------------- State ----------------enum Mode { MODE_IDLE, MODE_PUMP, MODE_SOAK, MODE_MANUAL, MODE_FAULT };Mode mode = MODE_IDLE; unsigned long phaseStart   = 0;  // when the current mode startedunsigned long pumpTotalMs  = 0;  // pump time since the last moisture progressint  startMoist            = 0;  // moisture when we started counting pump timeint  reading               = 0;  // current moisture % (0-100)unsigned long lastRead     = 0;unsigned long lastScreen   = 0; // Button debounceint  lastBtnRaw     = HIGH;int  btnStable      = HIGH;unsigned long btnChangedAt = 0; // The level at which watering stops (always at least 5 % above the start level)int stopLevel() {  return max(WET_THRESHOLD, DRY_THRESHOLD + 5);} // ---------------- Pump control ----------------void setPump(bool on) {  digitalWrite(PIN_RELAY, on ? RELAY_ON_LEVEL : RELAY_OFF_LEVEL);} void enterMode(Mode m) {  mode = m;  phaseStart = millis();  // Pump runs only in PUMP and MANUAL modes  setPump(m == MODE_PUMP || m == MODE_MANUAL);} // ---------------- Soil reading ----------------// Takes 16 quick samples and averages them to remove noise,// then maps dry..wet onto 0..100 %.int readMoisturePercent() {  long sum = 0;  for (int i = 0; i < 16; i++) {    sum += analogRead(PIN_SOIL);  }  int raw = sum / 16;  long pct = (long)(RAW_DRY - raw) * 100L / (RAW_DRY - RAW_WET);  if (pct < 0) pct = 0;  if (pct > 100) pct = 100;  return (int)pct;} // ---------------- Button ----------------// Returns true once for each new press.bool buttonPressed() {  int raw = digitalRead(PIN_BUTTON);  unsigned long now = millis();  if (raw != lastBtnRaw) {    lastBtnRaw = raw;    btnChangedAt = now;  }  if ((now - btnChangedAt) > DEBOUNCE_MS && raw != btnStable) {    btnStable = raw;    if (btnStable == LOW) return true;   // pressed (pulls to GND)  }  return false;} // ---------------- Screen drawing ----------------void drawScreen() {  if (!displayOk) return;  unsigned long now = millis();  display.clearDisplay();  display.setTextColor(SSD1306_WHITE);   if (mode == MODE_FAULT) {    // Big, clear warning    display.fillRect(0, 0, 128, 20, SSD1306_WHITE);    display.setTextColor(SSD1306_BLACK);    display.setTextSize(1);    display.setCursor(4, 2);    display.print("!! CHECK WATER TANK");    display.setCursor(28, 11);    display.print("!! / SENSOR !!");    display.setTextColor(SSD1306_WHITE);    display.setCursor(0, 30);    display.print("Pump stopped for");    display.setCursor(0, 40);    display.print("safety.");    display.setCursor(0, 54);    display.print("Press button to clear");    display.display();    return;  }   // Line 1: moisture in big text  display.setTextSize(2);  display.setCursor(0, 0);  display.print("Soil:");  display.print(reading);  display.print("%");   // Line 2: pump status  display.setTextSize(1);  display.setCursor(0, 24);  display.print("Pump: ");  if (mode == MODE_PUMP) {    display.print("WATERING");  } else if (mode == MODE_SOAK) {    unsigned long elapsed = now - phaseStart;    long left = (elapsed >= SOAK_MS) ? 0 : (long)((SOAK_MS - elapsed + 999) / 1000);    display.print("SOAKING ");    display.print(left);    display.print("s");  } else if (mode == MODE_MANUAL) {    display.print("MANUAL TOP-UP");  } else {    display.print("OFF");  }   // Lines 3-4: targets  display.setCursor(0, 40);  display.print("Start below: ");  display.print(DRY_THRESHOLD);  display.print("%");  display.setCursor(0, 52);  display.print("Stop at: ");  display.print(stopLevel());  display.print("%");   display.display();} // ---------------- Setup ----------------void setup() {  // Make sure the pump is OFF before anything else  pinMode(PIN_RELAY, OUTPUT);  setPump(false);   pinMode(PIN_BUTTON, INPUT_PULLUP);  // external 10k pull-up is also fitted  pinMode(PIN_SOIL, INPUT);  analogReadResolution(12);  analogSetPinAttenuation(PIN_SOIL, ADC_11db); // full 0-3.3 V range   Serial.begin(115200);   Wire.begin(PIN_SDA, PIN_SCL);  displayOk = display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  if (!displayOk) {    Serial.println("OLED not found - watering still works.");  } else {    display.clearDisplay();    display.setTextSize(1);    display.setTextColor(SSD1306_WHITE);    display.setCursor(10, 28);    display.print("Plant waterer ready");    display.display();  }   reading = readMoisturePercent();  lastRead = millis();  enterMode(MODE_IDLE);} // ---------------- Main loop ----------------void loop() {  unsigned long now = millis();   // 1) Read the soil every few seconds  if (now - lastRead >= READ_INTERVAL_MS) {    lastRead = now;    reading = readMoisturePercent();    Serial.printf("Moisture %d%%  mode %d  pumpTotal %lu ms\n", reading, (int)mode, pumpTotalMs);  }   // 2) Button: clear warning, or start a manual top-up  if (buttonPressed()) {    if (mode == MODE_FAULT) {      pumpTotalMs = 0;      enterMode(MODE_IDLE);    } else {      enterMode(MODE_MANUAL);    }  }   // 3) The watering logic  switch (mode) {    case MODE_MANUAL:      if (now - phaseStart >= MANUAL_MS) enterMode(MODE_IDLE);      break;     case MODE_IDLE:      if (reading < DRY_THRESHOLD) {        pumpTotalMs = 0;        startMoist = reading;        enterMode(MODE_PUMP);      }      break;     case MODE_PUMP:      if (reading >= stopLevel()) {          // moist enough - done        enterMode(MODE_IDLE);      } else if (now - phaseStart >= PUMP_BURST_MS) {        pumpTotalMs += PUMP_BURST_MS;         // burst finished, let it soak        enterMode(MODE_SOAK);      }      break;     case MODE_SOAK:      if (reading >= stopLevel()) {        enterMode(MODE_IDLE);      } else if (pumpTotalMs >= SAFETY_PUMP_MS && reading < startMoist + PROGRESS_PERCENT) {        enterMode(MODE_FAULT);                // no progress: tank empty or probe out      } else if (now - phaseStart >= SOAK_MS) {        if (reading >= startMoist + PROGRESS_PERCENT) {          // Moisture went up - water is arriving, restart the safety count          pumpTotalMs = 0;          startMoist = reading;        }        enterMode(MODE_PUMP);      }      break;     case MODE_FAULT:      setPump(false);                         // stay safe until the button is pressed      break;  }   // 4) Refresh the screen a few times per second  if (now - lastScreen >= SCREEN_INTERVAL_MS) {    lastScreen = now;    drawScreen();  }} 

Comments

No comments yet

Ask the maker a question, or say what you would change. Comments are public.

Sign in to comment. It is free.

More in around the house

See all in Around the house

Priced by a person

Ask for a price