Smart Plant Watering System
Inventor Β· Ages 13β16
- 1Read the conceptLearn the big idea behind this project.
- 2Check the partsSee which parts the robot needs.
- 3Follow the build stepsBuild it step by step, then test it.
- 4Answer the quizTap one answer for each of the 10 questions to earn XP.
π‘ The concept
A soil moisture sensor gives a number showing how wet the soil is. The controller compares it with a threshold: below the threshold the pump runs for a few seconds, then waits and measures again. This measure-compare-adjust cycle is closed-loop feedback control, the same idea used in thermostats.
Parts you need
- Soil moisture sensor
- Small water pump
- Relay or transistor
- Microcontroller
- Tubing + water tank
π Parts specification
Exactly what each part is, which models to buy, and what it does.
MicrocontrollerβΈ
Suggested models: Arduino Uno R3, Raspberry Pi Pico, or ESP32
Features: Reads the moisture sensor on an analog pin and switches the pump through a relay. ESP32 adds Wi-Fi if you later want phone alerts. Needs 1 analog input + 1 digital output.
Soil moisture sensorβΈ
Suggested models: Capacitive sensor v1.2 (best) or resistive two-prong sensor
Features: Gives an analog number for soil wetness. Capacitive sensors last much longer because they don't corrode in wet soil. Output is roughly 0β3.3V: lower voltage = wetter soil.
Water pumpβΈ
Suggested models: Mini submersible pump 3β6V (the white 'amphibious' type)
Features: Sits inside the water tank and pushes water through the tubing. Runs on 3β6V DC β never connect a pump to mains electricity.
Relay or transistorβΈ
Suggested models: 1-channel 5V relay module, or TIP120 / MOSFET module
Features: The pump needs more current than a pin can give. The relay is an electric switch: a small signal from the board clicks it on, and battery power flows to the pump.
Tubing + tankβΈ
Suggested models: Silicone tube (6mm) + any clean plastic bottle or box
Features: Carries water from the pump to the plant. Keep the tank below the electronics and the tube end dripping onto soil, never near the board.
π» Program the microcontroller
π² App to use: Arduino IDE, or MicroPython with Thonny (thonny.org) for the Raspberry Pi Pico
Thonny is a free, beginner-friendly Python editor that talks directly to the Pico. Arduino IDE uses C++.
// Arduino IDE (C++) β Smart Plant Watering
const int sensorPin = A0;
const int pumpPin = 8; // relay module
const int DRY = 500; // tune for your soil!
void setup() {
pinMode(pumpPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int moisture = analogRead(sensorPin);
Serial.println(moisture); // watch values
if (moisture > DRY) { // soil too dry
digitalWrite(pumpPin, HIGH);
delay(3000); // water 3 seconds
digitalWrite(pumpPin, LOW);
delay(60000); // let it soak in
}
delay(1000);
}π§ How it works: Open the Serial Monitor to see the moisture numbers live: note the value in dry soil and in watered soil, then set DRY between them. The long wait after watering is the feedback part β it stops the pump from overwatering while the water soaks down to the sensor.
π οΈ Build it step by step
Press Play to watch every part go into place and every wire connect. Ask a grown-up to help with real wiring!
Step 1 of 6
π± Place the sensor
Push the soil moisture sensor into the plant pot so the metal prongs are buried near the roots. Keep its electronic top dry and above the soil.