Automated Plant Watering System - Sensors, by Rosa Slack and Leila Watson
by PHS_Engineering in Circuits > Arduino
54 Views, 1 Favorites, 0 Comments
Automated Plant Watering System - Sensors, by Rosa Slack and Leila Watson
We made an automated plant watering system, inspired by a "cloud watering can" (shown above). In short, our project has a metal ball, attached by string to a servo motor, which will spin according to the water sensor which tells the Arduino when the sensor is dry (which means the soil is dry). The sensor and the servo motor pulls the string which lifts the ball and lets water out of the hole in the bottom of the plastic bottle we used to hold the water. When the sensor is wet (soil is wet) the servo motor will stop spinning and plug the hole, with the metal ball, as to not allow any more water out. We also attached an LED to allow any viewers to visually tell if the water was coming out or not.
Supplies
- Arduino UNO board
- breadboard
- LED
- wires - round tips
- wires - F-M
- servo motor
- 220ohm resistor
- water level detection sensor
- bolts
- nuts
- metal base plate
- metal 3 sided pole
- O ring
- Plant
- USB cable
- Angle gusset
- vitamin water bottle
- hot glue gun
- string
- soil
Write Code
int blue = 11;
int baud = 9600;
int waterLevel = A0; // variables for code
int sensor;
int pos = 0;
int wait = 500;
#include <Servo.h> //importing Servo information
Servo myservo;
void setup() {
// put your setup code here, to run once:
Serial.begin(baud);
pinMode(blue, OUTPUT); // LED to show when plant it wet or not
pinMode(waterLevel, INPUT); // water sensor
myservo.attach(9);
}
void loop() {
// put your main code here, to run repeatedly:
sensor = analogRead(waterLevel);
Serial.println(sensor); / / This prints the water levels coming from the sensor
if(sensor>130){
digitalWrite(blue, LOW); // if the waterLevel is high, the light will be off and the marble will stay down
}
else {
digitalWrite(blue, HIGH); // if the waterLevel is low, the light will turn on and the motor will lift the marble up from the cup(watering the plant)
for (pos = 0; pos <= 179; pos += 1) {
myservo.write(pos);
}
delay(wait);
for (pos = 179; pos >= 0; pos -= 1) {
myservo.write(pos);
}
delay(wait);
}
}
Gather Materials
took some time to gather materials we might need that weren't available in the classroom. such as, plants, pots, bottles.
Build Circuit
Put wires, LED and resistors in the right spots.
Build Bottle Frame
build a frame to hold the bottle over the plant for easy watering. we built the frame out of metal plates and poles with an adjustable section to easily get the bottle in and out.
Ball Seal
We used an O ring and some hot glue to put a hole in the cap of our bottle that perfectly fit the ball and didn't allow any water out while it was down.
Attach String
we securely attached the string to the ball and fit it through a hole in the top of the bottle and tied it to the servo motor.
Attach Servo Motor
We added a platform to put the servo motor on and tied/taped it down.
Set Up
we finished our project by setting it up for success! we put the sensor in the soil. we tightened all the nuts and bolts. we taped our wires and secured anything that might be loose. we added water to the bottle and tested it out.