Skip to content
BeginnerESP32esp32plant-wateringsoil-moisture

ESP32 Plant Watering System with Soil Moisture Sensor & MQTT

Build an ESP32 automatic plant watering system that monitors soil moisture, triggers a pump, and reports data to Home Assistant via MQTT.

SolderHub10/17/2026 9 min read 0 views

Background

I killed three plants in one month. All three died the same way — I either forgot to water them or watered too much.

This project solved that. It's been running for four months without a single plant death. The ESP32 monitors soil moisture every 5 minutes, triggers the pump when the soil gets too dry, and sends data to Home Assistant so I can check soil levels from my phone.

Components

6 items
NameQtyLink
ESP32 DevKit v1×1—
Capacitive soil moisture sensor v2.0 (not resistive — those rust)×1—
5V mini submersible pump×1—
1-channel 5V relay module×1—
Small silicone tubing (5mm diameter)×1—
5V power supply (2A minimum)×1—

Need these parts? Get this build sheet by email

Parts list with buy links, plus new builds as they're published. By subscribing you agree to our Privacy Policy. Unsubscribe anytime.

Why Capacitive Over Resistive?

Resistive moisture sensors corrode within weeks due to electrolysis. Capacitive sensors measure the dielectric constant of soil — no metal contacts in the soil, no corrosion. They last years.


Wiring

Sensor PinESP32
VCC3.3V
GNDGND
AOUTGPIO34 (ADC)
Relay PinESP32
INGPIO26
VCC5V (VIN)
GNDGND
C++

Home Assistant Configuration

Add to your configuration.yaml:

mqtt:
  sensor:
    - name: "Plant Moisture"
      state_topic: "solderhub/plant/moisture"
      unit_of_measurement: "%"
      icon: mdi:water-percent

  switch:
    - name: "Plant Pump"
      state_topic: "solderhub/plant/pump"
      payload_on: "ON"
      payload_off: "OFF"

Q&A is currently disabled site-wide.

Related projects