Automatic Plant Watering System Using Ar PDF
Automatic Plant Watering System Using Ar PDF
• Step 5: Rotate the servo motor Plantpos1 at 30° • Plug the square end of the USB cable into the
for plant 1. Arduino and the flat end into an available port
• Step 6: After rotate the servo motor for plant 1, on PC to connect the Arduino to computer.
the pump is on. • Open the Start Menu and type devmgmt.msc in
• Step 7: Defining watering time (4s) for plant 1 is the Search Programs and Files box; then press
working. Enter.
• Step 8: End. • Right click Arduino UNO and select Update
• Step 9: Check the sensor’s value in the soil. If Driver Software in the list that appears; then
value2 is greater than the threshold value, it click the Browse Computer for Driver Software
means go to 10, 11 and step 12. If value2 is not option.
greater than the threshold value, it goes to step • Click Browse to find Arduino folder.
14. • Within Arduino folder, click the Drivers folder
• Step 10: Rotate the servo motor Plantpos2 at and then click the Arduino UNO file.
90° for plant 2. • Click Next, and Windows completes the
• Step 11: After rotate the servo motor for plant installation.
2, the pump is on.
• Step 12: Defining watering time (5s) for plant 2 The Arduino IDE supports the languages C and C++
is working. using special rules of code structuring. The Arduino IDE
• Step 13: End. supplies a software library from the Wiring project,
• Step 14: Check the sensor’s value in the soil. If which provides many common input and output
value3 is greater than the threshold value, it procedures. User written code only requires two basic
means go to 15, 16 and step 17. If value3 is not functions, for starting the sketch and the main program
greater than the threshold value, it goes to loop, that are compiled and linked with a program stub
step3. main () into and executable cyclic executive program
• Step 15: Rotate the servo motor Plantpos3 at with the GNU toolchain, also included with the IDE
150° for plant 3. distribution.
• Step 16: After rotate the servo motor for plant • setup () : This function is called once when a
3, the pump is on. sketch starts after power up or reset. It is used
• Step 17: Defining watering time (6s) for plant 3 to initialize variables, input and output pin
is working. modes and other libraries needed in the sketch.
• Step 18: End. • loop() : After setup () function exits (ends), the
• Step 19: If the process wants to begin again, go loop () function is executed repeatedly in the
to step 2. main program. It controls the board until the
• Step 20: If the process wants to finish, go to End. board is powered OFF or is reset.
3.IMPLEMENTATION
Fig 3: Architecture of Arduino UNO’s IDE Fig 4: Program for Servo Motor
The code for this paper, the schematics is fairly easy. It Since in some code, the libraries needed are not
is heavily reliant on the servo.h library which comes pre- included in Arduino, so to add them before compiling.
installed with the Arduino IDE. The goal implemented by Unzip the downloaded file. Copy the folders under the
the code is simple, turn to the servo motors in a different Library folder to the libraries folder in Arduino, if the
direction using different angles to demonstrate its path in Arduino is not finded, open Arduino IDE, click
capabilities. File > Preference, and the path in the Browse box is seen,
To do an explanation of the code, as usual, the first thing as shown in the following diagram. Compile the
do is included the libraries the servo.h library. program.
#include<Servo.h>
Next, an object of the servo library is created.
Servo plantServo;
Next, proceed to the void setup function is moved where
the servo object is attached to a digital pin and set the
servo angle to 10. Digital pin 9 to the servo object is
attached. The servo object is now fully initialized and
ready to control the servo.
void setup ()
{
plantservo.attach(9);
plantservo.write(10); Fig 5: Arduino IDE
}
Next is the loop function. To turn make the servo rotate The default I2C bus address is 0x27 and the first
to a particular degree, the plantservo.write () function is parameter in the LiquidCrystal I2C function. This
used to write the degree of rotation to the servo is function sets the dimensions of the LCD. It needs to be
desired. The function to turn the servo is used from one placed before any other LiquidCrystal function in the
to the other and back. To demonstrate this, the “for” void setup () section of the program. The number of
loop is used to turn the servo at several angles in one rows and columns are specified as lcd.begin (columns,
direction, and the another loop is used to turn the servo rows). For 16x2 LCD, lcd.begin (16, 2) is seen, and for a
back to where it started. 20x4 LCD, lcd.begin (20, 4) is used. The backlight is also
void loop () be turned on and off with lcd.setBacklight(HIGH) or
{ lcd.setBacklight (LOW).
for (int ppos=10; ppos<=plantpos1; ppos++) Similar, but more useful than lcd.home () is
plantServo.write(ppos); lcd.setCursor(). This function places the cursor and any
delay(3000); printed text at any position on the screen. It is used in
} the void setup () or void loop () section of program. The
cursor position is defined with lcd.setCursor (column,
row). The column and row coordinates start from zero (0
to 15 and 0 to 1 respectively). For example, using
lcd.setCursor(0,1) in the void setup () section of the
“Moisture1=” program above prints “Moisture1=” to
the lower line and shifts it to the right two spaces.
#include<LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(I2C_ADDR, BACKLIGHT_PIN,
En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);
void setup ()
int value1=0; in the soil and sends that information to the LCD and
int value2=0; Arduino with values lying in the range 0 to 1023. And
int value3=0; display on LCD “ Moisture1 = ” and “Watering
The setup function is declared servo position at 10°. Plant1”.This data compared with the threshold value
plantServo.write (10); that means minimum soil moisture value from where soil
And pump situation is LOW that means at initial state completely dry and to need watering the soil. This value
for pump is off. digitalWrite () programming language is is already referred in the program and when the value
used. reaches to the threshold value it sent the signal to motor
Outputs either logic level HIGH or LOW (turns ON or driver IC.
OFF) at a specified digital pin. The pin is specified as The enable signal, pin 1 of L293D driver chip is
either a variable or constant (0 to13). connected to 5V. This driver chip main voltage means
digitalWrite (pump, LOW); that pin 8 of the chip is connected to the positive
terminal of the power supply. Pin 2 is connected to the
3.2. Implementation by Hardware negative terminal of the power supply. Pin 4, 5, 12, 13
are connected with ground and short to the GND pin of
Working process of automatic plant watering system is the Arduino UNO board. Pin 16 is connected to 5V. Pin
very simple. It is fully automated process. In this paper, 7 is connected to Arduino’s digital pin 3. Then it rotates
it is working the five sections. The first section is power the servo motor and turns the water pump on
supply which is used 12V module. The second sections simultaneously. It first moves the horn of the servo
are sensors which is used soil moisture sensor. The third motor along with the pipe which is attached to it
section is Arduino UNO. The four sections are LCD to towards the plant whose moisture level decreased. The
display the sensor’s value which is used together with servo motor is connected to the 9th number output pin
LCD I2C module. The final sections are motor driver of Arduino board through which the microcontroller is
which is used IC L293D. It controls the servo motor giving instruction to the motor. Servo motor for plant 1
which rotates and the water pump which is pumping rotates the 30° position.
unit. Arduino UNO and motor driver are supplied 12V The positive terminal of the water pump is connected to
power supply. Others soil moisture sensor, LCD, servo pin 6 of the IC motor driver and the negative terminal is
motor and water pump are supplied 5V from Arduino connected to pin 3 of the chip. The pump turn on about
UNO. Initial position for servo motor horn is watering time which is also mentioned in the program
10° position. and the process accordingly in the program for plant 1,
Soil moisture sensor has 3 connection points where V CC plant 2, and then plant 3 step by step. It starts the water
is connected with the 5V of Arduino board, the GND pin pump to supply water to the plant for 4s and then stops
is connected to the GND of Arduino and the output pins the water pump. It brings back the servo motor horn to
are connected to A0, A1 and A2 of Arduino. The first the its initial position. Sensor 2 and sensor 3 are also above
moisture sensor senses the amount of moisture principle. For sensor 2, display on LCD “Moisture2 = ”
presence in the soil and accordingly it sends its output and “Watering Plant 2”, watering time is 5s and servo
to the microcontroller through the input and output motor horn rotates 90° position. Then servo motor
pins provided in the Arduino board. Then the sensor brings back to its initial position. For sensor 3, display on
obtains the data from the soil and display on the LCD LCD “ Moisture3 = ” and “Watering Plant3”, watering
screen. The four bit mode LCD module is used. It has time is 6s and servo motor horn rotates 150° position.
four connections namely VCC, GND, SDA, SCL. VCC pin Then servo motor brings back to its initial position.
of the LCD is connected to the 5V pin of the Arduino.
GND pin is connected to the GND pin of the Arduino.
SDA pin is connected to pin of Arduino which is the
analog input pin (A4), and finally the SCL terminal is
connected to the Arduino UNO board which is another
analog input terminal (A5). The soil moisture sensor
continuously monitors the volumetric moisture content
RW
D0
D1
D2
D3
D4
D5
D6
D7
+
A
K
E
7
5V
SCL
IN1
IN2
GND D9 water pump.
GND • It brings back the servo motor horn to its initial
VCC1 VCC2
Vin position.
8
6
OUT2
A1 M2 Pump
EN1
D3
1
A5 LCD screen. Place the flower pots where the pipe from
the servo motor horn is easily reach them. When the
5
4
13
12
4.RESULTS
the soil and display on the LCD screen. The servo motor
Fig 11: Result for Servo Motor of Plant 1 Rotates 30° horn rotates to 150° to the third pot, water pump is ON
Position six seconds and then stop automatically. The servo
motor returns to its original position.
Similarly, if a second sensor is used, the moisture sensor
senses the amounts of moisture presented in the soil
and accordingly it sends its output to the
microcontroller through the input and output pins
provided in the Arduino board. Then the sensor obtains
the data from the soil and display on the LCD screen.
The servo motor horn rotates to 90° to the second pot,
water pump is ON for five seconds and then stop
automatically. The servo motor returns to its original
position.
REFERENCES
Fig 16: Result for Normal Situation
[1] Anonymous: “Arduino UNO tutorial begineers”.
5.DISCUSSION https://www.makerspaces.com/
[2] Anonymous: “Water Level Sensor”, (2018).
In this paper, the rotation of the servo motor is difficult http://osoyoo.com/2017/09/27/arduino-
to arrival the certain plant. Function of each module has lesson-water-sensor/#2.2
been reasoned out, so the modules are placed carefully [3] Jakob, M.: “lcd display 1602 i2c module”,
to the best working of the unit. The system has been January, (2017).
tested to function automatically. The moisture sensor https://wackydeveloper.wordpress.com/
measures the moisture level of the different plant. Do [4] Saran A.: “Automatic Plant Watering and Soil
not immerse the sensors fully inside the soil. If the Moisture Sensing”, (2017).
moisture level is found to be above the desired level, the [5] Venkata, N. et.al.: “Developed automatic
moisture sensor sends the signal to the Arduino board irrigation system used for plants”, (2017).
and LCD screen which triggers to rotate the servo motor [6] Arelona, P. and Riya, R.: “Design and
and water pump to turn on and supply the water to the Implementation of automated plant watering
plants. When the desired moisture level is reached, the system” Vol 4, issue 1, January, (2016).
servo motor and water pump stop automatically. Thus, [7] Ayan P.: “Automatic Plant Watering System”,
the functionality of the entire system is complete. In the October, (2016).
present day, on conservation of water is of high https://electronicsforu.com/electronics-
importance. Present work is attempts to save the natural projects/hardware-diy/
resources available which are used in very easily by [8] Rakesh R.: “L293D Motor Driver”, (2013).
human effort. By continuously monitoring the status of https://www.rakeshmondal.info/
the soil, the flow of water is controlled and reduced the [9] [9] Vellidis, Tucker, Kvien, Perry and Bednarz: “A
wastage. By controlling the pump in automatic plant Real Time Wireless Smart Sensor Array for
watering system, the land is irrigated in all climatic Scheduling Irrigation”, National
conditions. Environmentally Sound Production Agriculture
Laboratory (NESPAL), (2007).
6.CONCLUSION [10] [10] Castellano and Joseph, A.: Liquid Gold: “The
Story of Liquid Crystal Displays and the Creation
In this paper, automatic plant watering system by using of an Industry World Scientific Publishing”,
Arduino was successfully established and tested. As the (2005).
automatic plant watering system has a user friendly
design so it is used by the household users as well as the
commercial user. The best benefit is that it reduces the
wastage of water during irrigation and helps in saving
the precious water resource. Another are saving time,