Arduino Automatic Plant Watering System with Relay and Pump
Level 38 · Water It · 40 minutes
An automatic plant waterer: a relay switches a pump on its own battery, and a minimum run time stops it chattering.

Preview the project free; a course seat is required to run and submit. No hardware kit needed.
Your project challenge
Water the plant without chattering. Wire it up: - Soil: VCC 5V, GND GND, AO A0 - Relay: VCC 5V, GND GND, IN D7 - Pump: battery + to COM, NO to pump +, both − to GND - LCD: Level 17's wiring Above 700 is dry: pump. Run at least 3 seconds, then stop when wet. Show PUMP ON or PUMP OFF.
Components you’ll use
- Arduino Uno
- Soil Moisture Sensor (YL-69 probe + LM393 board)
- Relay Module
- Mini Water Pump (3-6V submersible)
- Battery
- LCD 16x2 Display
What you’ll build
An automatic plant waterer. The soil sensor decides, a relay switches the pump, and the screen says what it is doing.
How it works
- The pump never touches the Arduino. The relay is a switch in the pump’s own battery line.
- The relay is active low, as in Level 24.
LOWruns the pump. - The soil reads backwards, as in Wet or Dry. Above
700is dry. - The screen’s bottom line shows
PUMP ONorPUMP OFF, never both.
The key idea
The first splash hits the probe before it reaches the roots. The reading jumps wet, then dry, then wet again.
Stop on every wet reading and the relay chatters: on, off, on.
Once the pump starts, run it for at least 3 seconds. Remember when it started with millis(), in a variable outside loop().
⚠ Watch out
Skip the 3 seconds and the relay clicks 9 times where 5 will do. The pump also stops while the plant is still being watered.
The interactive editor includes the wiring guide, code editor and simulation controls.