Redson Dev · Idea
Arduino soil-moisture plant alert
Published May 2, 2026
A $3 sensor and an Arduino tell you when your plant is thirsty — with an LED that goes red, or a buzzer if you're really forgetful. Classic first electronics project that teaches analog input.
What you'll need
- Arduino Uno or Nano
- Capacitive soil moisture sensor (don't buy the cheap resistive one — it corrodes)
- LED + 220Ω resistor (or a small piezo buzzer)
- Breadboard and jumper wires
- USB cable for power
Step-by-step
- 01
Wire the sensor
VCC → 5V, GND → GND, AOUT → A0. The capacitive sensor outputs an analog value: ~300 = wet, ~700 = bone dry.
- 02
Wire the LED
Long leg of the LED → digital pin 8 through a 220Ω resistor. Short leg → GND.
- 03
Calibrate
Upload a sketch that just prints analogRead(A0) to Serial. Dunk the sensor in water — note the value. Hold it in air — note the value. Pick a threshold roughly halfway.
- 04
Write the alert sketch
Read A0 every 5 seconds. If value > threshold, digitalWrite(LED, HIGH). Else LOW. That's it — 15 lines of code.
- 05
Plant it
Push the sensor 2/3 into the soil, away from the pot wall. Run a USB cable to a phone charger. Done.
Tips
- Capacitive sensors don't corrode like resistive ones — they last years.
- Add deepSleep() if you swap the Arduino for an ESP32 and want it battery-powered.
