Water the plant automatically
A relay and a small pump, driven by a flow when the soil gets too dry — and an alert when it does
Wire the relay and the pump
The relay input goes to a free digital pin (D5 on NodeMCU, GPIO26 on ESP32), the pump to the relay's NO contact and to the 5 V supply. Never power the pump from a board pin.
Make the relay pin an output

Set the relay pin mode to digital_out. Only one place drives a pin: here it will be the flow.
Build the flow

Read the moisture pin, compare it with your "dry" threshold, write the relay pin for a few seconds, and send a notification on the channel from the alerts tutorial.
Before you start
Prerequisites
Finish these tutorials first.
- and
Parts & services
What this tutorial needs.
Actuators
- 1×1-channel relay module, 5 V, opto-isolated
- 1×Submersible water pump, 5 V
Wiring
- 1×Silicone tube, 8 mm
- 3×Dupont jumper wires (F-F, M-F)
Tools
- 1×Soldering ironoptionalOnly if the pump has bare wires
Already covered by the prerequisites
- Monitor a plant's soil moisture
Capacitive soil moisture sensor v1.2 · Dupont jumper wires (F-F, M-F) · USB charger, 5 V 2 A · DHT22 temperature & humidity sensor
- Register and flash your first board
ESP32 DevKit (WROOM-32) / NodeMCU v3 (ESP8266) / ESP32-C3 SuperMini · USB data cable (not charge-only) · 2.4 GHz Wi-Fi network · Chrome or Edge (Web Serial)
- Set up PNeX on a Raspberry Pi · depending on your choice
Raspberry Pi 5 (8 GB) / Raspberry Pi 4 (4 GB+) · Official Raspberry Pi USB-C power supply · microSD card, 32 GB, high endurance · USB 3 SSD · Raspberry Pi Imager
- Set up PNeX on a Linux VM · depending on your choice
Linux VM or server (Debian/Ubuntu)
- Get alerts by email or on your phone
SMTP account (host, port, login) / ntfy app on your phone / Telegram bot token

