DIY

Plant watering robot

 Robot for watering plants In this article, together with a DIY master, we will consider making a robot for watering plants.
The brain of the robot is Arduino and it works as follows
Initially, it moves forward in a straight line. When it detects a flowerpot with the ultrasonic sensor, it stops.
After that, the robot arm will move downward until it hits the soil against the soil in the flowerpot.
At this point, the moisture sensor starts working and transmits soil moisture data on Arduino.
If there is not enough moisture in the soil, it starts to water the soil until the moisture level reaches the optimal level.
If there is enough moisture in the soil, the robot will ignore this flower pot and start checking another pot.
At the end of the article you will be able to watch a demo video with the operation of such a device.
Tools and materials:
-Arduino UNO;
-Motor-reducer 2-100 rpm;
-Wheels;
-Screws;
-Clips;
-A piece made of acrylic (long and narrow rectangle);
-Battery holder;
-Motor driver L293D; -SG90 servo motors; -Pump;
-Ultrasonic sensors;
-Charging module TP4056;
-Humidity sensor;
-Jumpers;
-Li-on battery;
-Wood box;
-Plastic container;
 Robot for watering plants  Robot for watering plants Robot for watering plants  Robot for watering plants Robot for watering plants Step one: installing wheels
The master screws four brackets to a small wooden box. He bolts gearmotors to the brackets and installs wheels on their axles.
Robot for watering plants Robot for watering plants  Robot for plant watering Robot for watering plants  Robot for watering plants Robot for watering plants Step two: ultrasonic sensors
Attaches the ultrasonic sensor to the housing.
Robot for watering plants Robot for watering plants Secures the battery compartment.
 Robot for watering plants Step Three: Lever
Now you need to make a lever or a hand. Its master made from a narrow acrylic plate. A moisture sensor and an ultrasonic sensor are attached to the end of the plate. The other end of the plate is attached to the ends of two servo motors.
 Robot for watering plants The servos are attached to the top of the case.
Robot for watering plants  Robot for watering plants Installs a tube at the pump outlet. The other end of the tube is attached to the end of the arm.
 Robot for watering plants Robot for watering plants Robot for watering plants Step four: electrical installation
Now you need to mount the electrical part. Connection diagram below.
Robot for watering plants Soldered to the contacts of gear motors wires.
Robot for watering plants Robot for plant watering battery compartments.
Robot for watering plants A hole is drilled in the upper part of the housing for the wires of the servo motor, humidity sensor and ultrasonic sensor. Connects wires to the board.
Robot for watering plants Installs the charging module and the switch.
Robot for watering plants Robot for watering plants  Robot for plant watering Robot for watering plants Step five: code
After assembling the device, you need to load the code. You need to download it below.

 //******** 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 () & # 123; 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 () & # 123; 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 & gt; = 15) & # 123; Forward (); delay (100); } else if (distance & lt; 15) & # 123; 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 & gt; = 6) & # 123; servoF (); delay (100); }} mout = analogRead (mpin); if (distance1 & lt; 6 & amp; & amp; mout & lt; = 500) & # 123; servoB (); delay (100); Forward (); delay (1000); } if (distance1 & lt; 6 & amp; & amp; mout & gt; 500) & # 123; while (mout & gt; 500) & # 123; motor4.run (FORWARD); mout = analogRead (mpin); if (mout & lt; = 500) & # 123; motor4.run (RELEASE); delay (100); break; }}}} void Stop () & # 123; motor1.run (RELEASE); motor2.run (RELEASE); } void Forward () & # 123; motor1.run (FORWARD); motor2.run (FORWARD); } void servoF () & # 123; Serial.println (& # 34; servo forward is fine & # 34;); delay (100); for (pos = 0; pos & lt; = 120; pos + = 1) & # 123; digitalWrite (trigPin1, LOW); delayMicroseconds (2); digitalWrite (trigPin1, HIGH); delayMicroseconds (10); digitalWrite (trigPin1, LOW); duration1 = pulseIn (echoPin1, HIGH); distance1 = duration1 * 0.034/2; if (distance1 & gt; 6) & # 123; m1.write (pos); m2.write (120-pos); }}} void servoB () & # 123; Serial.println (& # 34; Servo back is fine & # 34;); delay (100); for (pos = 120; pos & gt; = 0; pos- = 1) & # 123; & # 123; m1.write (pos); m2.write (120-pos); } delay (30); }}  

The body of the waterer robot can be painted in any color. And of course, you need to install a container with water and place a pump there.
Robot for watering plants Robot for watering plants  Robot for plant watering Robot for watering plants Everything is ready, and on the video you can watch the assembly process and a demonstration of its work.

Source:

usamodelkina.ru

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button