Plants Watering Robot
by sarthakm1221 in Workshop > Home Improvement
1019 Views, 1 Favorites, 0 Comments
Plants Watering Robot
Hi there, I am sarthak mishra.
I have made a project named plants watering robot, it is quiet autonomous as all you need to turn on the switch and after that leave the remaining work on it.
You also can subscribe my youtube channel from here-Khurafati BABA
Now let's talk about the working of this robot-
Initially it will be moving forward in a straight line, it'll stop whenenver detects the flowerpot from the ultrasonic sensor which is placed on the sideways of the wooden block.
After that the arm will start moving downward untill it finds the soil in the flower pot.
whenever the ultrasonic sensor reached the soil then the moisture sensor will start working and give the moisture value to the arduino, according to that value it will give water to the plant.
If the soil is not having the enough moisture- It'll give water to the soil untill the moisture level reached the optimum level. when the moisture is good enough then the robot will leave the flower pot and will start checking the another one.
If the soil is having the enough moisture- Then the robot will ignore that flowerpot and start checking the another flower pot.
Components Needed-
1- Arduino UNO
2- 100RPM geared motor
4- Wheels
5- Screws
6- Clamps
7- Plastic rod
8- Battery holder
9- L293D sheild
10- SG90 servo motors
11- Dc pump
12- Ultrasonic sensors
13- TP4056 charging module
14- Moisture sensor
15- Jumper wires
16- Li-on batteries
17- Wooden box
18- Plastic container
Make Holes in the Box to Fix the Clamps
Tightens the screws, makes the clamps fixed
Fix the Motors in the Clamps
Place the motors in between the clamp and then tight the motor's screws
Fix the Wheels in the Motor
Tightens the wheels' screws to fix the wheels on motor
Fixing the Ultrasonic Sensor
With the help of gluegun. Stick the ultrasonic sensor on the wooden block
Fix the Battery Holder
In the corner of wooden block, fix the bateery holders with the help of gluegun
Making the Arm
On the tip of plastic rod, fix the ultrasonic sensor and moisture sensor with the help of gluegun.
At the end of this plastic rod, fix the shaft of both the servo motor with the help of fevi quick or gluegun
Placing the Servos
stick the servos on the top of wooden block with the help of gluegun
DC Pump
Join the pipe with the motor by heating the pipe a little bit.
Fixing the Watering Pipe on Arm
Fix the pipe on the arm with the help of gluegun
Wiring of Motors
solder the wires on moters and pass all the wirs through the hole.
Place the L293D Sheild and Arduino
Place the L293D shield nearby the battery holders.
Make a Hole on the Top
Make a hole on the top of wooden block to paas the wires of servo motor, moisture sensor and ultrasonic sensor. To the L293D sheild.
Placing the Charging Module
Stick the TP4056 module and a switch on the sideway of the wooden block.
After Some Paint Job
You can give any colour to this robot according to your mood.
Ready to Rock
Now, you are ready to rock with this exciting robot.
Circuit Diagram
Here Is the Whole Video of This Robot
click here to watch the whole video
Code
// ********CODE BY KHURAFATI BABA (SARTHAK MISHRA)**********
// ********CODE BY KHURAFATI BABA (SARTHAK MISHRA)**********
#include //For adding the library of shield #include //For adding the library of servo motor Servo m1; //Variable of servo motor 1 Servo m2; //variable of servo motor 2 int pos; //Variable that will define the postion of servos const int trigPin = A0; //Defines the trig pin of ultrasonic sensor 1st const int echoPin = A1; //Defines the echo pin of ultrasonic sensor 1st const int trigPin1=A2; //Defines the trig pin of ultrasonic sensor 2nd const int echoPin1=A3; //Defines the echo pin of ultrasonic sensor 2nd int mpin = A4; //Defines the pin of moisture sensor pin int mout; //Variable to store the value given by moisture sensor long duration, duration1; //Variable that stores the duration value given by ultrasonic sensor int distance, distance1; //Variable that stores the distance value calculated by the formaula
AF_DCMotor motor1(1, MOTOR12_1KHZ); //Defines the frequency which will be given to motor 1 AF_DCMotor motor2(2, MOTOR12_1KHZ); //Defines the frequency which will be given to motor 2 AF_DCMotor motor4(4, MOTOR12_1KHZ);
void setup() { Serial.begin(9600); //starts serial communication with the arduino and PC pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(trigPin1, OUTPUT); pinMode(echoPin1, INPUT); m1.attach(10); //Define the attached pin for servo motor 1 m2.attach(9); //Define the attached pin for servo motor 1
m1.write(0); m2.write(120); motor1.setSpeed(255); //To set the particular speed of motor 1 motor2.setSpeed(255); //To set the particular speed of motor 2 }
void loop() { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2; digitalWrite(trigPin1, LOW); delayMicroseconds(2); digitalWrite(trigPin1, HIGH); delayMicroseconds(10); digitalWrite(trigPin1, LOW); duration1 = pulseIn(echoPin1, HIGH); distance1= duration1*0.034/2;
if (distance>=15) { Forward(); delay(100); }
else if(distance<15)
{ Stop(); delay(70); digitalWrite(trigPin1, LOW); delayMicroseconds(2); digitalWrite(trigPin1, HIGH); delayMicroseconds(10); digitalWrite(trigPin1, LOW); duration1 = pulseIn(echoPin1, HIGH); distance1= duration1*0.034/2;
if(distance1>=6) { servoF(); delay(100); } } mout=analogRead(mpin); if(distance1<6 && mout<=500) { servoB(); delay(100);
Forward(); delay(1000); }
if(distance1<6 && mout>500) { while(mout>500) { motor4.run(FORWARD);
mout=analogRead(mpin);
if(mout<=500) { motor4.run(RELEASE); delay(100); break; } } } } void Stop()
{
motor1.run(RELEASE); motor2.run(RELEASE); }
void Forward()
{
motor1.run(FORWARD); motor2.run(FORWARD); } void servoF() { Serial.println("servo forward is fine"); delay(100); for (pos=0;pos<=120;pos+=1)
{ digitalWrite(trigPin1, LOW); delayMicroseconds(2); digitalWrite(trigPin1, HIGH); delayMicroseconds(10); digitalWrite(trigPin1, LOW); duration1 = pulseIn(echoPin1, HIGH); distance1= duration1*0.034/2;
if(distance1>6) { m1.write(pos); m2.write(120-pos); }
}
}
void servoB() { Serial.println("Servo back is fine"); delay(100); for(pos=120;pos>=0;pos-=1) { { m1.write(pos); m2.write(120-pos); } delay(30); } }