Automatic Solar Irrigation System
Automatic Solar Irrigation System
Irrigation system
Submitted By
Name
ID:
Name
ID:
Supervise To
Name
Lecturer
Department of EEE
i
Certification
This certify that this project entitled “Solar and Wind Power bases Automatic Irrigation
system” is done by the following student under my direction supervision and this work has been
carried by the laboratories of the Department of Electrical and Electronic Engineering under the
Faculty of Engineering of Daffodil International University in partial fulfillment of the
requirements for the degree of Bachelor of Science in Electrical and Electronic Engineering .The
presentation of the work was held on September 2021.
------------------------------
Name
Lecturer
Department of Electrical and Electronic Engineering
Daffodil International University.
…………………………
Name
ID:
…………………………
Name
ID:
ii
Dedicated to
Our Parents
iii
ACKNOWLEDGEMENT
First we express our heartiest thanks and gratefulness to almighty Allah for His divine blessing
makes us possible to complete this project successfully. We are grateful and wish our profound
our indebtedness to Ms.Kanij Ahmad, Lecturer ,Department of Electrical and Electrical
Engineering, Daffodil International University, Dhaka. Deep theoretical and hardware
knowledge & keen interest of our supervisor in this field influenced us to carry out this
project.His endless patience,scholarly guidance ,continual encouragement, constant and energetic
supervision, constructive criticism, valuable advice, reading many inferior draft and correcting
them at all stage have made it possible to complete this project.
We would like to express our heartiest gratitude to honorable Head, Department of EEE, for his
kind help to finish our project and also to other faculty members of the Department of Electrical
and Electronic Engineering, Daffodil International University
iv
List of Content
CHAPTER 1....................................................................................................................................1
INTRODUCTION.......................................................................................................................1
1.1 Introduction........................................................................................................................1
1.3 Objective............................................................................................................................2
1.4 scopes.................................................................................................................................3
1.5 Methodology......................................................................................................................3
1.7 Summary:...........................................................................................................................4
CHAPTER 2....................................................................................................................................5
LITERATURE REVIEWS..........................................................................................................5
2.1 Introduction........................................................................................................................5
2.6 Summary..........................................................................................................................10
Chapter 3........................................................................................................................................11
3.1 Introduction......................................................................................................................11
v
3.2 Flow chart........................................................................................................................11
3.6 Summary..........................................................................................................................14
Chapter 4........................................................................................................................................14
Hardware Development.............................................................................................................14
4.1 Introduction......................................................................................................................15
4.4.2 Technology...................................................................................................................19
4.4.3 Applications..............................................................................................................20
Agriculture.............................................................................................................................20
Landscape irrigation..............................................................................................................20
Research.................................................................................................................................20
vi
4.10 WATER PUMP.............................................................................................................26
Specifications.........................................................................................................................26
4.13 Summary........................................................................................................................28
CHAPTER 5..................................................................................................................................28
5.1 Introduction......................................................................................................................28
5.7 Discussion........................................................................................................................32
CHAPTER 6..................................................................................................................................33
CONCLUSINS..........................................................................................................................33
6.1 Conclusions......................................................................................................................33
Reference Link...........................................................................................................................34
Appendix....................................................................................................................................35
vii
CHAPTER 1
INTRODUCTION
1.1 Introduction
By using the concept of Arduino based automatic irrigation system a gardener or farmer can
save water up to 50% and power. This concept depends on two irrigation methods those are:
conventional irrigation methods like overhead sprinklers, flood type feeding systems i.e. wet
the lower leaves and stem of the plants. The area between the crop rows become dry as the
large amount of water is consumed by the flood type methods, in which case the farmer
depends only on the incidental rainfalls. The crops are been infected by the leaf mold fungi as
the soil surface often stays wet and is saturated after irrigation is completed. Overcoming
these drawbacks new techniques are been adopted in the irrigation techniques, through which
small amounts of water applies to the parts of root zone of a plant. The plant soil moisture
stress is prevented by providing required amount of water resources frequently or often daily
by which the moisture condition of the soil will retain well. The diagram below shows the
entire concept of the modern irrigation system. The traditional techniques like sprinkler or
surface irrigation requires / uses nearly half of water sources. Even more precise amounts of
water can be supplied for plants. As far as the foliage is dry the plant damage due to disease
and insects will be reduced, which further reduces the operating cost. The dry rows between
plants will leads to continuous federations during the irrigation process. Fertilizers can be
applied through this type of system, and the cost required for will also reduces. The erosion of
soil and wind is much reduced by the recent techniques when compared with overhead
sprinkler systems. The soil characteristics will define the form of the dripping nature in the
root zone of a plant which receives moisture. As the method of dripping will reduce huge
water losses it became a popular method by reducing the labor cost and increasing the yields.
1
When the components are activated, all the components will read and gives the output signal
to the controller, and the information will be displayed to the user (farmer). The sensor
readings are analog in nature so the ADC pin in the controller will convert the analog signals
into digital format. Then the controller will access information and when the motors are
turned On/Off it will be displayed on the LCD Panel.
1.3 Objective
The main objective of this project is to design a low cost device in order to control the
water pump automatically. .
To save farmers effort, water and time. Irrigation management is a complex decision
The ability to conserve the natural resources as well as giving a splendid boost to the
production of the crops is one of the main aims of incorporating such technology into the
agricultural domain of the country
2
1.4 scopes
A critical consideration is the installation costs, since costs generally determine the feasibility
and viability of a project. The installation must be simple enough for a domestic user. The water
saving was also an important aspect, since there is a demand to minimize water loss and to
minimize the efficiency of water used. Finally, the possibility for implementing the system at a
larger scale should be investigated.
1.5 Methodology
Collection of information's from books and internet.
Required components have been purchased from market.
The required information was found from a variety of sources. Information about the various
principles and types of soil moisture probes was acquired from the Ontario Ministry of
Agriculture, Food and Rural Affair website [9] and several probe manufacturers and vendors.
Different types electric valves were researched on the Internet and a solenoid and solenoid valve
was offered by the Mechanical Engineering Department at McGill University. The datasheets of
the electronic parts were obtained directly from the manufacturer or from intermediate suppliers.
Depending on the types of plants to be irrigated, the required soil moisture for growth and
maintenance varies. It is also useful to determine the amount of water that the plants absorb
during a certain period to choose the size of the reservoir and the refilling frequency. Plants were
purchased and placed in a typical environment. The feedback will control levels for most
common plant species may be attached to the retail package for convenience.
3
1.6 Project Outline
This project organized as follows
Chapter-6 Conclusion
1.7 Summary:
In this chapter, we discussed about our project Automatic irrigation System, where we briefly
discuss about project. At the last part of this chapter we discuss about our object, Future scope of
the work, methodology and project outline.
4
CHAPTER 2
LITERATURE REVIEWS
2.1 Introduction
This chapter will contain information about automatic irrigation. Here we will also discuss
Arduino and choosing reason. Also, contains moister sensor and its history.
5
Conventional irrigation methods like overhead sprinklers, flood type feeding systems usually
wet the lower leaves and stem of the plants. The entire soil surface is saturated and often stays
wet long after irrigation is completed. Such condition promotes infections by leaf mold fungi. On
the contrary the drip or trickle irrigation is a type of modern irrigation technique that slowly
applies small amounts of water to part of plant root zone. Water is supplied frequently, often
daily to maintain favorable soil moisture condition and prevent moisture stress in the plant with
proper use of water resources. Drip irrigation saves water because only the plant’s root zone
receives moisture. Little water is lost to deep percolation if the proper amount is applied. Drip
irrigation is popular because it can increase yields and decrease both water requirements and
labor. Drip irrigation requires about half of the water needed by sprinkler or surface irrigation.
Lower operating pressures and flow rates result in reduced energy costs. A higher degree of
water control is attainable. Plants can be supplied with more precise amounts of water. Disease
and insect damage is reduced because plant foliage stays dry. Operating cost is usually reduced.
Federations may continue during the irrigation process because rows between plants remain dry
6
programming environment, the Arduino programming language is an execution of Wiring, a
comparative physical computing platform.
Arduino has been used in thousands of different projects and applications. It runs on Mac,
Windows, and Linux. Teachers and students use it to build low cost scientific instruments, to
prove chemistry and physics principles, or to get started with programming and robotics.
Designers and architects build interactive prototypes, musicians and artists use it for installations
and to experiment with new musical instruments. Arduino is a key tool to learn new things.
There are many other microcontrollers and microcontroller platforms available for physical
computing. All of these tools take the messy details of microcontroller programming and wrap it
up in an easy-to-use package. Arduino also simplifies the process of working with
microcontrollers, but it offers some advantage for teachers, students, and interested amateurs
over other systems.
7
Open source and extensible hardware - The plans of the Arduino boards are published under
a Creative Commons license, so experienced circuit designers can make their own version of
the module, extending it and improving it. Even relatively inexperienced users can build
the breadboard version of the module in order to understand how it works and save money.
Two types of soil moisture sensors are available in the market—contact and non-contact sensors.
A contact soil sensor is used in this project because it has to check soil moisture to measure the
electrical conductivity. The moisture sensor provides an analogue output, which can easily be
interfaced with Arduino. In this project, two sensors can be connected to analogue pins A0, of
8
the Arduino board. Each sensor has two pin available for interfacing with the Arduino board.
Here, digital output pin (Do) is not used. The water pump and servo motor are controlled by
Arduino connected to digital pins 3 and 9, respectively. That is, the servo motor signal
control pin is connected to pin 9 of the Arduino board.
Technologies commonly used to indirectly measure volumetric water content (soil moisture)
include)
Frequency Domain Reflectometry (FDR): The dielectric constant of a certain volume
element around the sensor is obtained by measuring the operating frequency of an oscillating
circuit.
Time Domain Transmission (TDT) and Time Domain Reflectometry (TDR):
The dielectric constant of a certain volume element around the sensor is obtained by
measuring the speed of propagation along a buried transmission line.
Neutron moisture gauges: The moderator properties of water for neutrons are utilized to
estimate soil moisture content between a source and detector probe.
Soil resistivity: Measuring how strongly the soil resists the flow of electricity between
two electrodes can be used to determine the soil moisture content.
Galvanic cell: The amount of water present can be determined based on the voltage the
soil produces because water acts as an electrolyte and produces electricity. The technology
behind this concept is the galvanic cell.
9
Fig 2.3: Relay pin configuration
A simple device, which is now called a relay, was included in the original
1840 telegraph patent of Samuel Morse. The mechanism described acted as a digital amplifier,
repeating the telegraph signal, and thus allowing signals to be propagated as far as desired. This
overcame the problem of limited range of earlier telegraphy schemes.
2.6 Summary
Background history of anything is impressed us to work with more attentively and help us to
know the dedication of a person to invent anything. Thus, in this chapter, we discuss about the
background history of soil moister sensor, Arduino Nano, relay.
10
Chapter 3
THEPRETICAL MODEL
3.1 Introduction
In this project, Atmega328 microcontroller will be used to program an application
The Moister sensor will detect the moister level send analog data signal to microcontroller. The
microcontroller will use the data to process, analyze and calculate the specific information about
the moister, and then it will be display on a 16x2 screen (LCD – 16x2).
Collecting the
nessary parts for
the project
Drawing the
circuit diagram
Connect all
parts with Arduino
Install Ardiuno
codeing
software on Pc
Write the
program of our
project
Burn the
program in
Ardiuno
Output the
display in lcd
11
3.3 Block Diagram OF AUTOMATIC IRRIGATION SYSTEM
Moisture sensor detects the moister from the plant soil. It sends analog signal to Arduino.
Arduino detect the signal, process and calculate the data. Arduino send data on LCD. It shows us
the data and we can also able to see the data. Every unit is connected to power supply which is a
prerequisite for operation.
12
3.4 Circuit Diagram of AUTOMATIC IRRIGATION SYSTEM
Connection of moister monitor using moister sensor, Arduino and Bluetooth module is very
simple. Here a liquid crystal display (LCD) is used for display the moister which is sent though
the moisture sensor. Data pins of LCD namely RS, E, D4, D5, D6, D7 are connected to Arduino
digital pin number 7, 6, 5, 4, 3, and 2.0ne buzzer is connected in digital pin 10 and GND.
Moister sensor data is connected to analog A0 and A1 pin Arduino respectively. That entire
component is powered by dc 5volt.
13
3.6 Summary
First, we showed our flow chart which contains steps of our Project. Then we showed our block
diagram and circuit diagram with some explanation. At lastly, we briefly discussed about
working procedure of our project
Chapter 4
Hardware Development
14
4.1 Introduction
In this chapter, we will discuss about the hardware component that have used in our project. This
part will explain the path needed to undertake in order to achieve the goal of the project
15
Handy board, and many others offer similar functionality. All of these tools take the messy
details of microcontroller programming and wrap it up in an easy-to-use package.
16
4.3.2 Pin Description of Arduino Nano
Each of the 14 digital pins on the Nano can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 kOhms. In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
These pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication,
which, although provided by the underlying hardware, is not currently included in the Arduino
language.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH
value, the LED is on, when the pin is LOW, it's off.
The Nano has 8 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different
values). By default they measure from ground to 5 volts, though is it possible to change the
upper end of their range using the analogReference() function. Analog pins 6 and 7 cannot be
used as digital pins. Additionally, some pins have specialized functionality:
I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website).
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
17
4.4 Soil Moisturizer sensor
Soil moisture sensors measure the volumetric water content in soil.Since the direct gravimetric
measurement of free soil moisture requires removing, drying, and weighting of a sample, soil
moisture sensors measure the volumetric water content indirectly by using some other property
of the soil, such as electrical resistance, dielectric constant, or interaction with neutrons, as a
proxy for the moisture content. The relation between the measured property and soil moisture
must be calibrated and may vary depending on environmental factors such as soil type,
temperature, or electric conductivity.
Reflected microwave radiation is affected by the soil moisture and is used for remote sensing in
hydrology and agriculture. Portable probe instruments can be used by farmers or gardeners.
18
4.4.2 Technology
Technologies commonly used to indirectly measure volumetric water content (soil moisture)
include)
Frequency Domain Reflectometry (FDR): The dielectric constant of a certain volume
element around the sensor is obtained by measuring the operating frequency of an oscillating
circuit.
Time Domain Transmission (TDT) and Time Domain Reflectometry (TDR):
The dielectric constant of a certain volume element around the sensor is obtained by
measuring the speed of propagation along a buried transmission line.
Neutron moisture gauges: The moderator properties of water for neutrons are utilized to
estimate soil moisture content between a source and detector probe.
Soil resistivity: Measuring how strongly the soil resists the flow of electricity between
two electrodes can be used to determine the soil moisture content.
Galvanic cell: The amount of water present can be determined based on the voltage the
soil produces because water acts as an electrolyte and produces electricity. The technology
behind this concept is the galvanic cell.
4.4.3 Applications
Agriculture
Measuring soil moisture is important for agricultural applications to help farmers manage their
irrigation systems more efficiently. Knowing the exact soil moisture conditions on their fields,
not only are farmers able to generally use less water to grow a crop, they are also able to increase
yields and the quality of the crop by improved management of soil moisture during critical plant
growth stages.
Landscape irrigation
In urban and suburban areas, landscapes and residential lawns are using soil moisture sensors to
interface with an irrigation controller. Connecting a soil moisture sensor to a simple irrigation
clock will convert it into a "smart" irrigation controller that prevents irrigation cycles when the
soil is already wet, e.g. following a recent rainfall event. Golf courses are using soil moisture
sensors to increase the efficiency of their irrigation systems to prevent over-watering and
leaching of fertilizers and other chemicals into the ground.
19
Research
Soil moisture sensors are used in numerous research applications, e.g. in agricultural science and
horticulture including irrigation planning, climate research, or environmental science including
solute transport studies and as auxiliary sensors for soil respiration measurements.
Relatively cheap and simple devices that do not require a power source are available for
checking whether plants have sufficient moisture to thrive. After inserting a probe into the soil
for approximately 60 seconds, a meter indicates if the soil is too dry, moist or wet for plants.
20
Fig 4.3: Relay Module Top View
21
4.6 LCD Display
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of
applications. A 16x2 LCD display is very basic module and is very commonly used in various
devices and circuits. These modules are preferred over seven segment and other multi
segment LCDs. The reasons being: LCDs are economical; easily programmable; have no
limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on, A 16x2 LCD means it can display 16 characters per line and
there are 2 such lines. In this LCD, each character is displayed in 5x7 pixel matrix. This LCD has
two registers, namely, Command and Data. The command register stores the command
instructions given to the LCD. A command is an instruction given to LCD to do a predefined
task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The
data register stores the data to be displayed on the LCD. The data is the ASCII value of the
character to be displayed on the LCD. Click to learn more about internal structure of a LCD.
22
Pin 5-This is R/W i.e., Read/Write pin.
Pin 6-This is E i.e., enable pin.
Pin 2-This is VDD i.e., power supply pin
Pin1-This is VSS i.e., ground pin.
Pin3-This is short pin.
This type of wiring board may be utilized for initial electronic circuit development, to
construct prototypes for bench testing or in the production of complete electronic units in small
quantity.
Figure 4.7: 9V, 2A DC power adapter Figure 4.8: 5V,1A DC power adapter
The water pump is used to artificially supply water for a particular task. It can be electronically
controlled by interfacing it to a microcontroller. It can be triggered ON/OFF by sending signals
as required. The process of artificially supplying water is known as pumping. There are many
varieties of water pumps used. This project employs the use of a small DC 6v water pump which
is connected to a relay module.
25
Figure 4.10: water pump
Voltage: 12V
Switch Color: Red
Switch Type: Rocker
26
4.12 DC power Socket
This DC power connector has a 1.4mm centre pin. The cable mount DC connector is easy to wire
and is suitable for a wide range of 2A 18 V dc power applications.
A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you
easily insert electronic components to prototype (meaning to build and test an early version of)
an electronic circuit, like this one with a battery, switch, resistor, and an LED (light-emitting
diode). To learn more about individual electronic components, see our Electronics Primer. The
connections are not permanent, so it is easy to remove a component if you make a mistake, or
just start over and do a new project. This makes breadboards great for beginners who are new to
electronics. You can use breadboards to make all sorts of fun electronics projects, from different
types of robots or an electronic drum set, to an electronic rain detector to help conserve water in
a garden, just to name a few.
4.13 Summary
In this chapter, we have discussed Arduino Nano and its pin description, moister sensor and
Technology, application of moister sensor, Relay module, its hardware feature, LCD display its
pin description, Varo board, Dc Power supply and Piezo buzzer, water pump, Breadboard.
27
CHAPTER 5
28
Figure 5.1: project physical view
Figure 5.2: Showing the moisture level and pump status on LCD
29
5.5 Total Project Cost, Quantity and Price
Table 5.1: Equipment Cost
SL Equipment Name Quantity Price(TK)
1 Arduino Nano 1 417
2 1 channel Relay module 1 190
3 LCD 16*2 1 150
4 Transformer 220/09 1 150
6 PVC White Board As necessity 50
7 Plastic Meter Board 2 280
8 Varo Board 1 30
9 Glue 7 110
10 Pump 2 480
11 Connecting Wire As necessity 210
12 DC socket 2 25
13 Piezo buzzer 2 60
14 TIP 122 1 65
15 NO/OFF switch 2 10
16 Soil Moisture sensor 2 270
17 Mini breadboard 1 60
Total Project Cost = 2657Tk
But Now we create this project more than three thousand Taka only.
3. Cost efficient.
6. Easy to Setup
5.7 Discussion
The main objective of this project is to design a low cost device in order to control the water
pump automatically. This automatic irrigation system senses the moisture content of the soil and
automatically switches the pump when the power is on. A proper usage of irrigation system is
very important because the main reason is the shortage of land reserved water due to lack of rain,
unplanned use of water as a result large amounts of water goes waste. For this reason, we use this
automatic plant watering system, and this system is very useful in all climatic conditions. The
project is designed to develop an automatic irrigation system which switches the pump motor
ON/OFF on sensing the moisture content of the soil. In the field of agriculture, use of proper
31
method of irrigation is important. The project uses an ARDUINO NANO open source
microcontroller which is programmed to receive the input signal of varying moisture condition
of the soil through the sensing arrangement. Once the controller receives this signal, it generates
an output that drives a relay for operating the water pump. An automation of irrigation systems
has several positive effects. Once installed, the water distribution on fields or small-scale gardens
is easier and does not have to be permanently controlled by an operator. There are several
solutions to design automated irrigation systems.
CHAPTER 6
CONCLUSINS
6.1 Conclusions
The primary applications for this project are for gardeners and farmers who do not have enough
time to water their crops/plants. It also covers those farmers who are wasteful of water during
32
irrigation. The project can be extended to greenhouses where manual supervision is far and few
in between. The principle can be extended to create fully automated gardens and farmlands.
Combined with the principle of rain water harvesting, it could lead to huge water savings if
applied in the right manner. In agricultural lands with severe shortage of rainfall, this model can
be successfully applied to achieve great results with most types of soil.
Reference Link
Website:
[1] https://www.arduino.cc/en/Main/ArduinoBoardUnoretrieved
[2] https://www.arduino.cc/en/Guide/Introductionretrieved
[3] https://en.wikipedia.org/wiki/Relay#History
[4] http://electronicsforu.com/electronics-projects/automated-plants-watering-system
[5] https://en.wikipedia.org/wiki/Soil_moisture_sensor
[6]chttps://www.sunfounder.com/wiki/index.php?title=2_Channel_5V_Relay_Module
33
[7] http://www.geeetech.com/wiki/index.php/2-Channel_Relay_module
YouTube:
[8] https://www.youtube.com/watch?v=pCxeZkLhqSE
[9] https://www.youtube.com/watch?v=BKp4ib1UQj8
Journal Papers and others:
[1] S. V. Devika, Sk. Khamuruddeen, Sk. Khamurunnisa, Jayanth Thota, Khalesha Shaik
Volume_4/10_October2014
[2] Nagarajapandian, Ram Prasanth, Selva Kumar, Tamil Selvan
Assistant professor,
Dept. of EIE, Sri Ramakrishna Engineering College,
Coimbatore, Tamilnadu, India 1 UG Student,
Dept. of EIE, Sri Ramakrishna Engineering College, Coimbatore,
Tamilnadu, India2, 3,
[3]SHAIKH SHEROZ MOHD HASAN
Department of Electronics and Telecommunication Engineering Anjuman-I-Islam Kalsekar
Technical Campus, New Panvel
MUMBAI UNIVERSITY
http://www.aiktcdspace.org:8080/jspui/bitstream/123456789/1572/1/PE0127.pdf
http://gardenbot.org/howTo/soilMoisture
[4] Knight, J.H., 1992: Sensitivity of time domain reflectometry measurements to lateral
variations in soil water content. Water Resources Research, 28, pp. 2345–2352.
[5] Prathyusha.K1, G. Sowmya Bala2, Dr. K. Sreenivasa Ravi, “A real time irrigation control
system for precision agriculture using WSN in Indian agricultural sectors” International Journal
of Computer Science, Engineering and Applications (IJCSEA) Vol.3, No.4, August 20.
34
Appendix
Program Description:
#include <LiquidCrystal.h>
int relay1=8;
int relay2=9;
int buz=11;
void setup() {
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0,0);
lcd.print(" Automatic");
lcd.setCursor(0,1);
lcd.print("irrigation Systm");
delay(2000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Khalilur Rahman");
lcd.setCursor(0,1);
lcd.print("Saima Sultana");
delay(2000);
lcd.setCursor(0,0);
lcd.print("ID: 133-33-1637");
35
lcd.setCursor(0,1);
lcd.print("ID: 133-33-1577");
delay(2000);
lcd.clear();
pinMode(relay1,OUTPUT);
pinMode(buz,OUTPUT);
digitalWrite(buz,HIGH);
delay(1000);
digitalWrite(buz,LOW);
}
void loop()
{
int sensorValue = analogRead(A0);
int sensorValue2 = analogRead(A1);
delay(100);
36
lcd.setCursor(5,1);
lcd.print(sensorValue2);
lcd.setCursor(8,1);
lcd.print("%");
digitalWrite(relay1,HIGH);
digitalWrite(relay2,HIGH);
lcd.setCursor(10,0);
lcd.print("M1=ON ");
lcd.setCursor(10,1);
lcd.print("M2=ON ");
digitalWrite(relay1,HIGH);
digitalWrite(relay2,LOW);
lcd.setCursor(10,0);
lcd.print("M1=ON ");
lcd.setCursor(10,1);
lcd.print("M2=OFF");
}
37
digitalWrite(relay1,LOW);
digitalWrite(relay2,HIGH);
lcd.setCursor(10,0);
lcd.print("M1=OFF");
lcd.setCursor(10,1);
lcd.print("M2=ON ");
}
digitalWrite(relay1,LOW);
digitalWrite(relay2,LOW);
lcd.setCursor(10,0);
lcd.print("M1=OFF");
lcd.setCursor(10,1);
lcd.print("M2=OFF");
}
else
{
//Serial.print("no match found");
38