The Implementation of A Control Circuit For A Microcontroller Based Automated Irrigation System
The Implementation of A Control Circuit For A Microcontroller Based Automated Irrigation System
net/publication/274890884
CITATION READS
1 1,837
3 authors, including:
Jonathan Enokela
Federal University of Agriculture
20 PUBLICATIONS 51 CITATIONS
SEE PROFILE
All content following this page was uploaded by Jonathan Enokela on 13 April 2015.
652
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
When the system is first switched on, and on sensing that The number of sensors employed depends on the size of
the aerial tank is empty, it turns on the pump, through the farm to be irrigated. The logical OR operation of the
ac motor, for the aerial tank to be filled. When this has been sensors ensure that all parts of the farm receive adequate
done the system checks if the soil is dry upon the moisture. When the soil is dry the gypsum block has a high
affirmation of which the control tap is opened for water to resistance thus turning off transistor Q1. This transistor is
flow to the soil through the sprinkler system. The control turned on only when the soil has received the desired
tap is closed when the moisture content of the soil reaches a amount of moisture. If we assume that the resistance of the
predetermined level that has been fixed by the soil moisture gypsum block under wet condition is Rg, then the
sensors. The aerial tank is then refilled to complete the requirement for the saturation of the BJT is expressed as
process. The microcontroller keeps monitoring the state of inequality (1).
the sensors to determine what action it will take next.
F I B IC ..............(1)
A. Sensors
Both the water level and the soil moisture sensors are The transistor Q1 will turn on when
discrete sensing type. The water level sensors are required
to indicate the presence or absence of water to an exact F R1 VCC VBEsat
height only. We are not interested in the rising or falling of ( Rg Rb ) .............(2)
water level outside the stipulated levels. In the same
VCC VCEsat
manner the soil moisture sensors are required to indicate The resistance of the gypsum block, Rg, is determined
only the presence or absence of soil wetness to a by the depth at which it is buried, amongst other factors,
predetermined level. and the sensitivity of the sensor should be set on site.
The soil moisture sensors consist of gypsum blocks
buried in the soil [12]. Transistors switches are attached to
the blocks. The arrangement is shown in figure 2 in which
one sensor has been depicted.
653
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
Soil Moisture
Sensors
Water Water
Soil Level
Sensor Level
Logic sensors
Logic
Control Aerial
Tap Tank
Microcontroller
Sole-
noid Water
Status
Drive Outlet to
Indicator Sole- Field
noid
Relay
Drive AC
Motor Pump
AC Power Water
Input Reservoir
654
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
Vcc The control of water level in the aerial tank makes use of
the same basic transistor switching method applied in the
soil sensors. One transistor is used to determine maximum
water level while the other is used for minimum water
level. The probe for water level detection consists of a
hollow conductor of cross sectional area a, and length l, to
R1
offer a quantifiable electrical resistance when immersed in
water. The connection of the probes to the transistor
switches and the 555 timer used as logic control is shown
in figure 3. The output (Q) of the 555 timer is connected to
Rg Rb a microcontroller input port pin. The arrangement depicted
in figure 3 ensures that the microcontroller turns on the
Q1 pump to fill the aerial tank only when both water probes are
above water i.e. tank is empty. It also ensures that the
microcontroller turns off the pump only when both water
probes are below the water i.e. tank is full. This
arrangement eliminates the unnecessary frequent switching
on and off of the pump motor.
655
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
VCC
VCC
R1
8 U1
VCC
3 4
VCC
Q R
7
DC VCC
5
R5
CV Q1
2
1
GND
VCC
6 2
TH TR
R2
1
555 TF
R3
VCC
R4
Q2
R6
Q3
2
1
TL
The schematic diagram of the complete automated III. RESULTS AND D ISCUSSION
irrigation system is given in figure 4. The microcontroller The program for the microcontroller was written in
used for the project is the PIC16F84A [13]. The Assembly Language [14] and was then built into an
microcontroller takes inputs from the soil sensor S1 and the executable hex file using the MPLAB IDE Version 8.20
water level sensors (TF, TL) continuously. Under the control [15] and the embedded MPASM assembler. A software
of the program in its memory the microcontroller turns on simulation was carried out with the simulator built into the
(or off) the tap or pump depending on the input it has MPLAD IDE to ensure that the program variables and
received from the sensors. One of the four LEDs (D1 - D4) registers changed as desired. The program required few
is also turned on to visually indicate the state of events at registers but the output ports (PORTA and PORTB) were
the input of the microcontroller. observed to have the correct values.
Figure 5 gives the flowchart of the program executed by
the microcontroller. As indicated in the flowchart the
microcontroller polls the input sensors and after taking the
appropriate decision it goes back to monitoring the sensors
in a continuous loop.
656
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
VCC
VCC
R7 R8 R9
VCC
R1
U2
16 17
OSC1/CLKIN RA0 U1
15 18
8
OSC2/CLKOUT RA1 VCC
1
RA2
4 2 3 4
VCC
MCLR RA3 Q R
3
RA4/T0CKI
7
DC VCC
6 R5
RB0/INT
7 5
RB1 CV Q1
8
RB2
R10 9 R13 R12
2
1
RB3
10
GND
RB4 VCC
RB5
11 R11 6
TH TR
2
RB6
12 R14
RB7
13 R2
1
555
Upper Level Water Sensor TF
PIC16F84A
D7 R3
VCC D6 VCC
D4
VCC
X1 R16 R15 D5 R4
Q2
R17
R6
Q3
VCC1 VCC1 VCC
C1
2
1
C2
AC Power AC Power
R18
Q4 Lower Level Water Sensor TL
D1
2
1
D2
Pump Valve
The circuit shown in figure 4 was then built and the Light emitting diodes (LED) driven through transistors
hardware was debugged in the Proteus Virtual System were used to indicate the valve and pump output signals.
Modeling (VSM) environment version 7.7 [16]. Switches The conditions of the switches and the outputs observed
were used to represent the soil moisture sensor and the from the microcontroller are given in table 1.
water level sensors. A miniature version of the farm irrigation system, shown
in figure 6, was constructed and fully tested.
657
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
TABLE 1
SENSOR CONDITIONS AND MICROCONTROLLER DECISIONS
Switch Conditions
S1 TF TL Indication Output
H H H Soil Dry, Tank Empty Tap ON, Pump ON, Red LED ON
H H L Soil Dry, Tank Part Full Tap ON, Pump ON, Red LED ON
H L L Soil Dry, Tank Full Tap ON, Pump OFF, Blue LED ON
L H H Soil Wet, Tank Empty Tap OFF, Pump ON, Yellow LED ON
L H L Soil Wet, Tank Part Full Tap OFF, Pump ON, Yellow LED ON
L L L Soil Wet, Tank Full Tap OFF, Pump OFF, Green LED ON
Note that in table 1; L= Low Logic Level Signal and H= High Logic Level Signal.
658
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
Start
Initialize
Processor
Monitor Soil
Sensor Inputs
Is soil Yes
wet ?
No
Is Aerial Is Aerial
Tank Tank
dry? full ?
No Yes No Yes
Open Tap, Turn Open Tap, Turn Close Tap, Close Tap, Turn
OFF pump, Turn ON pump, Turn Turn ON pump, off pump, Turn
ON Blue LED ON Red LED Turn ON ON Green LED
Yellow LED
659
International Journal of Emerging Technology and Advanced Engineering
Website: www.ijetae.com (ISSN 2250-2459, ISO 9001:2008 Certified Journal, Volume 4, Issue 6, June 2014)
Aerial Tank
Pump
Control
Unit Farm
Water
Reservoir
IV. CONCLUSION [7] R.G. Evans and W.M. Iversen, “Remote Sensing and Control of an
Irrigation System Using a Distributed Wireless Sensor Network”,
A stand alone farm irrigation system has been designed IEEE Transactions on Instrumentation and Measurement, Vol. 57,
and implemented using a microcontroller. Due to the few No. 7, pp.1379-1387, 2008.
number of components used the system has a high degree [8] G. Yang, Y. Liu, L. Zhao, S. Cui, Q. Meng and H. Chen, “Automatic
of reliability. The size of the pump and tap used can be Irrigation System Based on Wireless Network”, International
Conference on Control and Automation, ICCA, 2010, pp.2120-2125.
varied to meet the required expanse of a particular farm.
[9] R.M. Faye, F. Mora-Camino, S. Sawadogo, and A. Niang, “PC-
The system can easily be deployed in remote farms as the Based Automation of a Multi-Mode Control for an Irrigation
amount of electrical power it consumes is small. System, International Symposium on Industrial Embedded Systems”,
Lisbon, 4-6 July, 2007, pp.310-315.
REFERENCES [10] Y. Zhou, K. Yang, L. Wang, and Y. Ying, “A Wireless Design of
[1] J. Dhiman, S. Singh, and S. Dhiman, “Utilization of Irrigation Water Low-Cost Irrigation System Using ZigBee Technology”,
Using Microcontroller”, Automatic Control and Information International Conference on Networks, Security, Wireless
Sciences, Vol.1, No. 1, pp.1-5, 2013. Communications and Trusted Computing, 2009.
[2] J.S. Awati and V.S. Patil, “Automatic Irrigation Control by Using [11] Y. Kim and R.G. Evans, “Software Design for Wireless Sensor-
Wireless Sensor Networks”, Journal of Exclusive Management Based Site-Specific Irrigation”, Computer and Electronics in
Science, Vol. 1, Issue 6, pp. 1-7, June 2012. Agriculture, Vol. 66, No.2, pp.159-165, 2009.
[3] T. Boutraa, A. Akhkha, A. Alshuaibi and R. Atta, “Evaluation of the [12] F.S. Zazueta and J. Xin, “Soil Moisture Sensors”, Bulletin 292,
Effectiveness of an Automated Irrigation System Using Wheat Florida Cooperative Extension Service, Institute of Food an
Crops”, Agriculture and Biology Journal of North America, Vol. 2, Agricultural Sciences, University of Florida, April, 1994.
No. 1, pp.80-88, 2011. [13] Microchip Technology Inc., PIC16F84A Data Sheet,
[4] M. Yildirim and M. Demirel, “An Automated Drip Irrigation System http://ww1.microchip.com/downloads/en/DeviceDoc/35007b.pdf
Based on Soil Electrical Conductivity”, The Philippine Agricultural (Accessed 15/05/2013)
Scientist, Vol. 94, No. 4, p.343-349, December, 2011. [14] M.A. Mazidi, R.D. McKinlay and D. Causey, PIC “Microcontroller
[5] S. Singh, and N. Sharma, “Research Paper on Drip Irrigation and Embedded Systems: Using Assembly and C for PIC18”, Pearson
Management Using Wireless Sensors”, International Journal of Education Inc., Upper Saddle River, New Jersey, 2008.
Computer Networks and Wireless Communications, Vol. 2, No. 4, [15] Microchip IDE,
pp.461-464, August 2012. http://www.microchip.com/microchip.www.SecureSoftwareList/
[6] A. Cellatoglu, and B. Karuppanan, “Remote Sensing and Control for [16] Proteus VSM, Labcenter Electronics,
Establishing and Maintaining Digital Irrigation”, International http://www.labcenter.com/Products/
Journal of Advanced Information Technology, Vol. 2, No.1, pp.11-
25, February 2012.
660