Arduino Plant Watering Project
Arduino Plant Watering Project
1. Components Needed
- Arduino Uno
- Soil moisture sensor
- Small water pump (5V) or servo to open valve
- Relay module (if using a pump)
- Jumper wires
- Breadboard
- Power supply (battery or USB)
- Small tubing (if needed)
- Container for water
2. How It Works
The soil moisture sensor detects how dry the soil is. When the soil is dry (below a certain value), the
Arduino turns on the water pump through the relay module. The pump waters the plant until the soil
is moist again.
3. Arduino Code
void setup() {
pinMode(pumpPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
moistureLevel = analogRead(moisturePin);
Serial.println(moistureLevel);
if (moistureLevel < threshold) {
digitalWrite(pumpPin, HIGH);
} else {
digitalWrite(pumpPin, LOW);
}
delay(1000);
}
4. Steps to Build
1. Connect the soil moisture sensor to A0, VCC, and GND.
2. Connect the relay to digital pin 7, and link it to the pump.
3. Place the pump tube in water and the outlet near the plant.
4. Upload the code to the Arduino using Arduino IDE.
5. Power the Arduino and test the system.