Download as pdf or txt
Download as pdf or txt
You are on page 1of 111

V SVESVARAYA TECHNOLOGICAL UNIVERSITY,

BELGAUM

CHIGURU
UTOMATED MICRO IRRIGATION SYSTE M
ubmitted in Partial fulfillment for the award of Degree in Bachelor of Engineering
. In
Electronics & Communication Engineering
For the academic Year 2009-2010

Submitted By

VARUN RAOB lST06EC102


VENKATESH HEGDE lST07EC418
PRAVEEN B K lST06EC058
SHANKAR R L lST06EC081

Under the guidance of


Mr. Nagaraj S
Lecturer, Dept of ECE
SaIT, Bangalore

Department of Electronics &. Communication Engineering


Sambhram Institute of Technology
Jyothinagar, M.S.Palya, Vidyaranyapura Post
Bangalore: 560 097
JUNE-20l0
HRAM INSTITUTE OF TECHNOLOGY
l yothinagar, M.S.Palya, Vidyaranyapura Post, Bangalore- 560 097

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

CERTIFICATE

This is to certify that the project work entitled CHIGURU-AN


AUTOMATED MICRO IRRIGATION SYSTEM is a bonafide work carried
out by:

VARUN RAO B lST06EC102


VENKATESH HEGDE lST07EC418
PRAVEEN B K lST06EC058
SHANKARR L lST06EC081

for the partial fulfillment for the award of the degree of "Bachelor of Engineering" in
Electronics and Communication Engineering, Visvesvaraya Technological University,
Belgaum during academic year 2009-2010. It is certified that all the
corrections/suggestions indicated for internal assessment has been incorporated in
the report deposited in the department library. The project report have been
approved as it satisfies the academic requirements with respect to project work as
prescribed for the Degree.

Internal Guide Head of the Department Princi al


t

~ ~,
\
,., 0 \ \\)b \ t,.J
Dr. P. ...,.. I-f ",I i.' ,; r ...::_h"
(Mr.Nagaraj.S) (Dr. P.Shi)tananda,)
Lecturer, Dept of ECE, Asst. Prof, Dept of ECE, sarno;P , iqqil?~~I ' ; ~': ' . :.J~\
SarT, Bangalore. SalT, BaorOOl~Gpanmenl S ~~angalore. ·. ~ in ' (
Head & commn t.n~w " h: \ .\J :.',
I)epIrtmeot of E\ectron\cs oto'
Sambnram ,nstltute of lechn gy
D .... nn~'Ofe.5SO 097.
Names of the Examiners U81'V- Signature with
Date

1.

2.
DIIDICATED TO
OUR BELOVED PARENTS, THE
FARMERS, &. THE SOCIETY
ACKNOWLEDGEMENT

eH/GURU: An automated micro-irrigation system, this concept needed a lot of help and
mentoring from our lecturers, friends and seniors to turn into a reality. Firstly, we would
like to credit our parents for their unending support and confidence in us for whatever we
have achieved till date.

We would like to thank our internal guide, and Project Coordinator Mr. Nagaraj S
Department of Electronics and communication Engineering, SalT, for the constant help
and support extended towards us during the course of the project, and all the faculties and
non teaching staff of Department of Electronics and communication Engineering, SalT
for helping us directly or indirectly in completing the project.

We would also like to thank faculties form our Electronics department Sr. Lecturers, Mr.
Gopalkrishna Murthy C R & Mr. Rangaswamy for their insightful suggestions during
the course of our proje~t and helping us directly or indirectly in completing our project.

We are also grateful to our HOD Mr. C. V Ravishankar, Department of Electronics and
Communication Engineering, SalT, for his support and encouragement that went a long
way in successful completion of this project work.

Our special thanks to Dr. P. Shivananda, Principal, Sambhram Institute of Technology,


for all the faGilities provided. We would also like to extend our gratitude to Karnataka
Slate Council for Science and Technology (KSCST) for recognizing the project and
sponsoring the same.

We would also like to convey our heartfelt thanks to our seniors Mr. Saheblal Bhagwan,
Mr. Prabhat Kumar, and Mr. Sandeep Patil for their never-ending support.

VARUNRAOB
VENKATESH HEGDE
PRAVEENB.K
SHANKAR R LAMAN]
ABSTRACT
Agriculture is the lifeline of our country and irrigation is the lifeline of agriculture. Our country
has an ever growing population (one third of worlds hungry people are in India) to cater to and
the land and water available for agriculture is fast depleting. This mismatch in available land
resources and ever increasing demand has lead to a spate of innovative techniques to make
efficient use of available water and to increase yields. It is in this context that we would like to
put forth our idea of CHI GURU that in the years to come might revolutionize agriculture.
CONTENTS
TITLES PAGE NO

I. INTRODUCTION
1.1 THE INSPIRATION 2
1.2 THE VISION 2
1.3 THE APPLICATION 2
1.4 TOOLS USED 3

2. BLOCK DIAGRAM DESCRIPTION


2.1 BLOCK DIAGRAM 5
2.2 THE BRAIN 5
2.3 THE INPUT/OUTPUT DEVICES 6
2.3.1 LIQUID CRYSTAL DISPLAY 6
2.3.2 HEX KEYPAD 6
2.3.3 WATER LEVEL SENSOR 6
2.3.4 RAIN SENSOR 6
2.3.5 MOISTURE SENSOR 7
2.3.6 TEMPERATURE SENSOR 7
2.3.7 IRRIGATION PUMP 7
2.3.8 LOCK 7

3. SCHEMATIC DIAGRAM & DESCRIPTION


"
3.1 TOOLS USED 9
3.2 SCHEMATIC DESCRIPTION 9
3.2.1 CLOCKING CIRCUITARY 9
3.2.2 RESET CIRCUITARY 9
3.2.3 POWER SUPPLY 9
3.3 ATMEGA 128 PORTS & INTERFACE 10
3.3.1 PIN CONFIGURATION 10
3.3.2 BLOCK DIAGRAM II
3.3.3 PIN DESCRIPTION 12
3.3.4 FEATURES 15
4. LIQUID CRYSTAL DISPLAY
4.1 INTRODUCTION 19
4.2 FUNCTION DESCRIPTION 20
4.3 INSTRUCTION DESCRIPTION 21
4.4 FEATURES 25

5. HEX KEYPAD
5.1 INTRODUCTION 28
5.2 READING THE VALUES FROM KEYPAD 29
5.3 MEMBRANE KEYPAD 31
5.3.1 WORKING 32

6. SENSOR
6.1 INTRODUCTION 34
6.2 WATER LEVEL SENSOR 35
6.2.1 NEED OF WATER LEVEL SENSOR 35
6.3 RAIN SENSOR 36
6.3.1 NEED OF RAIN SENSOR 36
6.4 MOISTURE SENSOR 37
6.4.1 SOIL MOISTURE CONCEPTS AND TERMS 37
6.4.2 CONSTRUCTION OF MOISTURE SENSOR USING 39
GYPSUM BLOCK
6.4.3 STEPS THAT SHOULD BE FOLLOWED WHILE 40
a
CONSTRUCTING A MOISTURE SENSOR
6.4.4 METHODS OF MEASURING SOIL MOISTURE 41
6.4.5 INSTALLATION 43
6.4.6 RULES FOR INSTALLATION 43
6.4.7 NEED OF MOISTURE SENSOR 44
6.5 TEMPERATURE SENSOR 44
6.5.1 WORKING OF TEMPERATURE SENSOR 44
6.5.2 NEED OF TEMPERATURE SENSOR 45
7. PUMP
7.1 INTRODUCTION 47
7.2 WORKING PRINCIPLE 47
7 .3 FEATURES 47
7.4 TECHNICAL SPECIFICATION 48

8. RELAY
8.1 INTRODUCTION 50
8.2 BASIC DESIGN & OPERATION 50
8.3 ELECTROMAGNETIC RELAY 52
8.4 WORKING PRINCIPLE 54
8.5 RELAY DRIVER 56
8.6 MAIN FEATURES 56
8.7 RELAY SPECIFICATION 57
8.8 APPLICATION 58

9. REAL TIME CLOCK


9.1 INTRODUCTION 60
9.2 PURPOSE 60
9.3 POWER SOURCE 61
9.4 TIMING 61
9.5 NEED OF REAL TIME CLOCK 61

10. SOLENOID LOCK


10.1 INTRODUCTION 64
10.2 WORKING PRINCIPLE 65
10.3 FEATURES 66

11. MOTORS
11.1 INTRODUCTION 68
11.2 DC MOTORS 68
11.3 TOY MOTORS 68
11.4 SPECIFICATION & FEATURES 69
12. RAIN WATER HARVESTING
12.1 INTRODUCTION 71
12.2 ROOF CATCHMENT SYSTEM 71
12.3 GROUND WATER RECHARGE 71
12.4 ADVANTAGES 72
12.5 NEED FOR RAIN WATER HARVEATING 72
12.6 OUR ENDEAVOUR 72

13. POWER SUPPLY


13.1 INTRODUCTION 74
13.1.1 POWER SUPPLY TYPES 75
13.2 VOLTAGE REGULATORS 75
13.3 CIRCUIT DESCRIPTION OF 7805 76
13.4 MODIFICATION IDEA 77
13.5 FEATURES 78

14. PROJECT WORKING


14.1 EMBEDDED C LAUNGUAGE 80
14.2 ADVANTAGES 80
14.3 DISADVANTAGES 80
14.4 FLOWCHART 81
14.5 APPLICATION 82
14.6 COMPONENT LIST 82

15. CONCLUSION 83
16. BIBLIOGRAPHY 84
17. APPENDIX-A
A PHOTOLOGUE OF OUR PROJECT 85
18. APPENDIX-B
DATASHEET 88
NAME OF THE Fl6URE PA6ENO
FIG.2.0: FUNCTIONAL UNIT 5
FIG.3.3 PIN OUT OF AT MEGA 128 10
FIG 3.3.2: BLOCK DIAGRAM OF ATMEGA128 11
FIG 4.1 LCD DISPLAY 19
FIG 5.1 (A): HEX KEY PAD LAYOUT 28
FIG 5.1(B): HEX KEYPAD INTERNAL WIRING 29
FIG 5.3: MEMBRANE KEYPAD 31
FIG 5.4: LAYERS OF MEMBRANE KEYPAD 32
FIG 6.4.1 : AVAILABILITY OF WATER IN SOIL 38
FIG 6.4.5: GYPSUM BLOCK 42
FIG 6.5: PIN OUTS OF LM35DZ 44
FIG 7.1: SUBMERSIBLE PUMP 48
FIG 8.1 RELAY PARTS 51
FIG 8.2 SIMPLE ELECTROMAGNETIC RELAY 51
FIG 8.3 RELAY WORKING 54
FIG 8.4 DPDT AC COIL RELAY 54
FIG 8.5: RELAY DRIVER CIRCUIT 56

FIG 9.1: PIN OUTS OF DS1307 Ie 60


FIG 10.1: SOLENOID 64
FIG 10.2: SOLENOID LOCK 66
FIG 11.3: A TOX MOTOR 69
FIG 13.2: VOLTAGE REGULATOR 76
FIG 13.2(A): 78XX PINOUT IC 76
FIG 13.3: 7805 DESCRIPTION 77
FIG 14.4: FLOW CHART 91
NAME OF THE TABLE. PAGE NO

TABLE.4.2: REGISTER SELECTION 21


TABLE 4.3: INSTRUCTION DESCRIPTION 24
TABLE4.3 (A): SHIFT FUNCTION 25
TABLE4.3 (B): FUNCTION SET 25

TABLE 6.4.1 : AVAILABLE WATER CAPACITIES 39


FOR VARIOUS TYPES OF SOIL
TABLE 7.4: SPECIFICATION OF PUMP 48
TABLE 11.4: SPECIFICATION AND FEATURES 69
CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~ 1

DEPT.OFECE Page 1 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

INTRODUCTION

1.1 THE INSPIRATION


Agriculture is one of the mainstays of the Indian economy from time
immemorial. As a lifeline of the country, agriculture is now fighting a fast losing
battle and one of the main reasons for this being dwindling water resources. It was
this very fact that got our minds thinking on developing an efficient and reliable
solution to automate the water management part and help in the revival of irrigation
in India.

1.2 THE VISION


We as a team set out with our sights targeted on creating a device that
would be easy to use, require no technical knowledge, and yet be powerful enough to
control the irrigation schedule. Our aim is to create a device controlled by a
microcontroller (preferably the Atmega128) that is programmed to accept just one
input from the farmer (selection of type of crop). The device upon accepting the input
performs all the related actions itself without external assistance.

1.3 THE APPUCATION


The module we plan to develop would work as an irrigation scheduler
in fields, a greenhouse controller (with a few modifications in the sensors and
algorithm), and also as mini weather stations. We, also plan to make the system work
as a data logger in future enhancements of the module. So, this truly makes our
project module a multi-role module.

DEPT. OF ECE Page 2 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

t .4 TOOLS USED
• CODE VISION AVR
• ROBOKITS PROGRAMMER
• ORCAD EVALUATION VERSION
• AVR STUDIO 4
• SINAPROG

DEPT.OFECE Page 3 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~2

DEPT.OFECE Page 4 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

BLOCK DIAGRAM DESCRIPTION


2.1 BLOCK DIAGRAM

"'"
USER INTERFACES AND OTHER END·
USER PERIPHERALS
"- ./

POWER SUPPLY AND POWER "'"


ELECTRONIC CONTROL SYSTEM
"- ./

~<!~
r
PUMPS, MOTORS AND OTHER
CONTROL PERIPHERALS
\.. ../
UCONTROLLER
'- :\ ATMEGA128
RAIN MOISTURE
~
ADC
SENSORS SENSORS ~
-v' -V
TEMP. WATER LEVEL

"-
SENSORS INDICATORS
~t
LCD
F1S.!.O: FUNCTIONAL UNIT

2.2 THE BRAIN (ATME6A 128 MICROCONTROLL£R)


Microcontroller ATMEGA 128 is the BRAIN of our project. It is
responsible for control and co-ordination of various modules interfaced with it. It can
be programmed accorfIing to the given environment. ATMEGA 128 with the help of
various ports and 1/0 devices communicate with users. It acts as a scheduler and
manages the entire irrigation schedule in conjunction with the other modules.

DEPT.OFECE PageS SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

2.3 INPUT/OUTPUT DEVICES

2.3.1 UQUID CRYSTAL DISPLA\'

Liquid Crystal Display is an output device. LCD used here is a 20X4 matrix
which displays various results of the parameters being measured. In addition it also helps the
user to set the date and time during initial setup by displaying the date and time values
entered.

2.3.2 HEX KEYPAD

Hex key pad is a 4X4 matrix, which is used for taking input and various
command from user and they are processed by microcontroller which ultimately controls the
mechanical system and also display the corresponding results on the output device - LCD
Display.

2.3.3 WATER LEVEL SENSOR


The water level sensor is a module built on the principle of conductivity of
water. It consists of probes used to sense the water level and basically these probes are
attached at different levels to indicate the height of water in the field (in cm). This data is the
fed to the microcontroller as an input and the microcontroller takes an appropriate decision
based on the control algorithm.

2.8.4 RAIN SENSOR


The rain sensor is developed based on the principle of conductivity. It is
developed using a PCB and can be of various shapes and sizes. The PCB is connected to the
input port of the microcontroller and the corresponding input is processed by the algorithm
and the corresponding actions are taken.

DEPT.OFECE Page 6 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

2.3.5 MOISTURE SENSOR

The moisture level sensor is based on the principle of soil suction


measurement and electrical conductivity. The moisture sensors are blocks of gypsum and are
connected to the ADC port of the microcontroller as input. The output of the ADC is then fed
to the algorithm for further decision making and management.

2.3.6 TEMPERATURE SENSOR


The temperature sensor used in our application is LM35DZ from national
semiconductors. It is a linear temperature sensor that is one degree change in temperature is
recorded as a change in voltage of IOmv. The temperature sensor is connected to the ADC of
the microcontroller and the ADC output is fed to the algorithm for further processing.

2.3.7 IRRIGATION PUMP


The irrigation pump used in our prototype is a small capacity fountain pump
that has a capability to pull water up to a height of 2 feet. The pump is a submersible type
pump with capability to run dry for a few minutes without affecting its working.

2.3.8 LOCK
The lock is a device used to secure the chamber in which the microcontroller
is housed to prevent any foul play. The lock is a solenoid based device that is energized by an
output from the J1licrocontroller. The lock unlock mechanism is controlled by various
authentication measures making it tough for any unauthorized people to gain entry into the
microcontroller chamber.

DEPT.OFECE Page 7 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~8

DEPT. OF ECE PageS SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

SCHEMATIC DIAGRAM AND DESCRIPTION


3. t TOOL USED: ORCAD DEMO VERSION
This is a tool from CADENCE, a very powerful tool for schematic
design simulation and even debugging. This was chosen as it had all the components
available including ATmega128 in its rich library.

3.2 SCHEMATIC DESCRIPTION


This chapter describes the interconnection of various sections to the
atmega 128 microcontroller and also gives an overview of port utilization of the
controller.

3.2. t CLOCKIN6 CIRCUITARY


As shown in the schematic clocking circuitry comprises of a 6 MHz crystal
with 10pF capacitors. Clocking source specifies speed of operation. As the processor
has a RISC architecture most instructions are carried out in maximum of two machine
cycles and also the robot operates in real world 6MHz proved to be an ample speed.

3.2.2 RESETCIRCUITAIlY
The reset PIN on microcontroller is active low hence it is tied to Vcc using an
RC combination. Whenever there is a need to reset the microcontroller, the reset
switch is pressed discharging the capacitor and holding the PIN low for 10ms. This
time is enough for microcontroller to reset.

3.2.3 poWER SUPPL)'


The power requirement of the project is 5v, 1A. This is done with the
conventional Step-down transformer, Bridge rectifier, and a 7805 voltage regulator.
In addition a separate voltage supply of 12v is supplied to the relay circuitry by using
the transformer in conjunction with a bridge rectifier and a 7812 voltage regulator.
DEPT. OF ECE Page 9 SAlT
CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

s.s ATME6A 12B PORTS AND INTERFACES


The A VR is a modified Harvard architecture 8-bit RIse single chip
microcontroller (IJC) which was developed by Atmel in 1996. The A VR was one of the
first microcontroller families to use on-chip flash memory for program storage, as
opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other
microcontrollers at the time.

ATMEGA128 has 7 ports with 110 capability as well as other functions. Here
the use of 110 capability and the use of ADC function of PORTA are described. Each port
has 8 physical pins which can be individually or collectively made as input or output. A
total of 53 programmable 110 pins are available in ATMEGA 128.

8.8. t PIN CONFl6URATION

PEN lOco.. CO)N-OCDaI) .....


WJ CD co II) II) 10
colof')~l")<\Ii-.~m
II) II) ... 1ft ." .., .. , "48
PA3 (ADa)
RXDOI(PDt) PEa 2 47 PA4(A04)
(TXOOIPOO) PEl 3 46 PA5(A05)
(XCKOIAtNO) PE2 45 PA6 (AD6)
(OC3A1AIN1) PE3 44 PA7(A07)
(0C3B11NT4) PE4 6 43 PG2(AlE)
(OC3C1rNTS) PE5 7 PC7 CAtS)
(TMNT6) ~6 8 Pes (A14)
(lCP3ttNT7) PEl 9 Pe5 (Al3)
(SS) PBO 10 PC4 (A12)
(SCI<) PBl 11 Pea (A11)
(MOSI) PB2 12 PC2 (Al0)
(MISO) PB3 13 PCl (A9)
(OCO) P94 14 PCo (AS)
(0C1A) PBS 15 PG1{RO)
(OC1B) PB6 1q.,. lID at 0 ..- NCO) .. It') lID .... cO at <:) _ ~~ PGo(WR)
...-..-..-t'IINNNNNNNNNC')l")C")

Nata: The Pnd rvn appflBS to baCh TOFP .u MLF packagas. 1ha bottom pad under tho QFNlMLF
padcage should be scIdamd to ~

FI6.S.S PIN OUT OF ATME6A 12B

DEPT. OF ECE Page 10 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

3.3.2 BLOCK DIA6RAM

IT
-r-..,

HDr!l
e I~
~·PFJ MO PAl ~
Pm FeT
~
t j--------- - - -- - - - -------_. -- - -- _. -- -- --------- -- - - - r- _. _. ---- --_. --
\U
1-- ~- 1---- -,
QNJI

I
PORl'F !RV9IS PORTA~
J PORl't [);;JVL=iS
I
1 ~t! I I I II i '1I
- H!A\T~mR Q\TADR
REO pam:
llmfl:GIsmt
POOl"
DATAOIR.
REG POOr"
I ~lA AEG~TEfl
FtRTC
~iADR
J:\EG Falrt

.A &lIT flIUAlIJS
~

<.,. II'
>
.a;
oo.aoa::
........ I
CI AlIt Me!W.
OSC'UAiOff
I
NEF I
t ! ClD.WDA I

~ I M=~ ~ Hm~~
JOOW' StO
PONTER ,~
L.L

~_rou~ H~
i
-~ ~ H~Im~~
!flAM TIYI.'t'lNfJ
~

~-
I
, aa:-I
~ H
MTFIETI:ft aEHEfW. --'"
~..R TIllETt jti
oo..NTERS "
fto Pl.&'::6E.
~
.t-:- i'I"
~R8


Pii ~
L.OO£
I
NSrfllCTCft
DECOiER
~
"-
1
I H 1NT:r Jt:
~

CXJmIl.
LIIEB
W ~~
!
H E.EPIIlM
J

~ t
~
t18ARrO
"I
fill
I 0lWI'1 ~NWFESEJlIAl
INrnlF~

+4 + ,...-
A .. t Ir- ...
<... I I
...>
~
1
~t~\I-=""
!~ Utt It
a.TADR.
F£Q. PCiITE
DAlA f£.OI8lER
R:fiTB
~TADR
F£Q P(Jfl'8 ID\TA~STEA IlATADIR.
fEaFamJ
IlIt.TARro,
~T\l
"~TA DIR II
REG POOm

8 'J,,'t. '"'1'''
III I
'T""""" tll UJl.1~ 1illnJ rl II LU!
I RlRJE [Hi£f!S PORTB 00IVEfIi
I Pam> I:InERS
I PORTI) DRYERS

~~
.-------- - ---- --~------ - -- - - -- I--- ------- - -- - -- - - -- -------- - - -- - --
FI6URE 3.3.2: BLOCK DIA6RAM OF ATME6A 12a

DEPT.OFECE Page 11 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

3.3.3 PIN DESCRIPTIONS

VCC: Digital supply voltage.


GND: Ground.

PORT A (PA7-PAO)
Port A is an 8-bit bi-directional 110 port with internal pull-up resistors
(selected for each bit). The Port A output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port A pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port A pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
Port A also serves the functions of various special features of the ATmegal28.

PORT B (PB7-PBO)
Port B is an 8-bit bi-directional 1/0 port with internal pull-up resistors
(selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port B pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
Port B also serves the functions of various special features of the ATmega 128

PORT C (PC7-PCO)
Port C is an 8-bit bi-directional 1/0 port with internal pull-up resistors
(selected for each bit). The Port C output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port C pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
Port C also serves the functions of special features of the ATmega 128. In
ATmega 103 compatibility mode, Port C is output only, and the port C pins are not tri-
stated when a reset condition becomes active.

DEPT. OF ECE Page 12 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Note: The ATmega 128 is by default shipped in ATmega I 03 compatibility


mode. Thus, if the parts are not programmed before they are put on the PCB, PORTC
will be output during first power up, and until the ATmegal03 compatibility mode is
disabled.

PORT D (PD7-PDO)
Port D is an 8-bit bi-directional 110 port with internal pull-up resistors
(selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port 0 pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
Port D also serves the functions of various special features of the A Tmega 128

PORT E (PE7-PEO)
Port E is an 8-bit bi-directional 110 port with internal pull-up resistors
(selected for each bit). The Port E output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port E pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port E pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
Port E also serves the functions of various special features of the ATmega 128

PORT F (PF7-PFO)
Poll F serves as the analog inputs to the AID Converter. Port F also serves as
an 8-bit bi-directional 1/0 port, if the AID Converter is not used. Port pins can
provide internal pull-up resistors (selected for each bit). The Port F output buffers
have symmetrical drive characteristics with both high sink and source capability. As
inputs, Port F pins that are externally pulled low will source current if the pull-up
resistors are activated. The Port F pins are tri-stated when a reset condition becomes
active, even if the clock is not running. If the JTAG interface is enabled, the pull-up
resistors on pins PF7 (TDI), PF5 (TMS), and PF4 (TCK) will be activated even if a
Reset occurs.
DEPT. OF EeE Page 13 SAlT
CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

The TOO pin is tri-stated unless TAP states that shift out data are entered.
Port F also serves the functions of the JTAO interface. In ATmegal03 compatibility
mode, Port F is an input Port only.

PORTS (P64-P60)
Port a is a 5-bit bi-directional 110 port with internal pull-up resistors
(selected for each bit). The Port G output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port a pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port a pins are tri-stated when a reset condition becomes active, even if the clock is
not running. Port G also serves the functions of various special features. The port G
pins are tri-stated when a reset condition becomes active, even if the clock is not
running.
In ATmegal03 compatibility mode, these pins only serves as strobes signals
to the external memory as well as input to the 32 kHz Oscillator, and the pins are
initialized to POO = 1, PG 1 =1, and PG2 = 0 asynchronously when a reset condition
becomes active, even if the clock is not running. PG3 and PG4 are oscillator pins.

RESET
Reset input. A low level on this pin for longer than the minimum pulse length will
generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to
generate a reset.

XTALt
Input to tha inverting Oscillator amplifier and input to the internal clock operating
circuit.

XTAL2
Output from the inverting - Oscillator amplifier.

AVeC
AVCC is the supply voltage pin for Port F and the AID Converter. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter.

DEPT. OF ECE Page 14 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

AREF
AREF is the analog reference pin for the AID Converter.

PEN
PEN is a programming enable pin for the SPI Serial Programming mode, and
is internally pulled high. By holding this pin low during a Power-on Reset, the device
will enter the SPI Serial Programming mode. PEN has no function during normal
operation.

3.3.4F~11U~

~ High-performance, Low-power AVR® 8-bit Microcontroller


~ Advanced RISC Architecture
o 133 Powerful Instructions - Most Single Clock Cycle Execution
o 32 x 8 General Purpose Working Registers + Peripheral Control
Registers
o Fully Static Operation
o Up to 16 MIPS Throughput at 16 MHz
o On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments
o 128K Bytes of In-System Self-programmable Flash program memory
o 4K Bytes EEPROM
o 4K Bytes Internal SRAM
o • WritelErase cycles: 10,000 Flashll 00,000 EEPROM .
o Data retention: 20 years at 85°CI1 00 years at 25°C(1)
o Optional Boot Code Section with Independent Lock Bits
> In-System Programming by On-chip Boot Program
> True Read-While-Write Operation
o Up to 64K Bytes Optional External Memory Space
o Programming Lock for Software Security
o SPI Interface for In-System Programming
> JTAG (IEEE std. 1149.1 Compliant) Interface
DEPT. OF ECE Page 15 SAlT
CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

o Boundary-scan Capabilities According to the JTAG Standard


o Extensive On-chip Debug Support
o Programming of Flash, EEPROM, Fuses and Lock Bits through the
JTAG Interface
Peripheral Features
o Two 8-bit Timer/Counters with Separate Prescalers and Compare
Modes
o Two Expanded 16-bit Timer/Counters with Separate Prescaler,
Compare Mode and
Capture Mode
o Real Time Counter with Separate Oscillator
o Two 8-bit PWM Channels
o 6 PWM Channels with Programmable Resolution from 2 to 16 Bits
o Output Compare Modulator
o 8-channel, 10-bit ADC
~ 8 Single-ended Channels
~ 7 Differential Channels
~ 2 Differential Channels with Programmable Gain at 1x, JOx, or 200x
o Byte-oriented Two-wire Serial Interface
o Dual Programmable Serial USARTs
o Master/Slave SPI Serial Interface
o Programmable Watchdog Timer with On-chip Oscillator
o • On-chip Analog Comparator
Special Microcontroller Features
o Power-on Reset and Programmable Brown-out Detection
o Internal Calibrated RC Oscillator
o External and Internal Interrupt Sources
o Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-
dovvn,Standby,and
Extended Standby
o Software Selectable Clock Frequency

DEPT. OF ECE Page 16 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

o ATmegal03 Compatibility Mode Selected by a Fuse


o Global Pull-up Disable
1/0 and Packages
o 53 Programmable 110 Lines
o 64-lead TQFP and 64-pad QFN/MLF
Operating Voltages
o 2.7 - 5.5V ATmegal28L
o 4.5 - 5.5V ATmegal28
Speed Grades
o 0 - 8 MHz ATmegal28L
o 0 - 16 MHz ATmegal28

DEPT. OF ECE Page 17 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~4

DEPT. OF ECE Page 18 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

UQUID CRYSTAL DISPLAY


4. 1 INTRODUCTION

A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the
light modulating properties of liquid crystals (LCs). LCs do not emit light directly.
LCOs therefore need a light source and are classified as "passive" displays. Some
types can use ambient light such as sunlight or room lighting. There are many types
of LCOs that are designed for both special and general uses. They can be optimized
for static test, detailed still images, or dynamic, fast-changing, video content.

fl6 4.1 LCD DISPLAY

The HD44780U dot-matrix liquid crystal display controller and driver LSI displays
alphanumeric, Japanese kana characters, and symbols. It can be configured to drive a dot-
matrix liquid crystal display under the control of a 4- or 8-bit microprocessor. Since all the
functions such as display RAM, character generator, and liquid crystal driver, required for
driving a dot-matrix liquid crystal display are internally provided on one chip, a minimal
system can be interfaced with this controller/driver.

DEPT. OF ECE Page 19 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

A single HD44780U can display up to one 8-character line or two 8-character lines. The
HD44780U has pin function compatibility with the HD44780S which allows the user to
easily replace an LCD-II with an HD44780U. The HD44780U character generator ROM is
extended to generate 208 5X8 dot character fonts and 32 5 XIO dot character fonts for a total
of 240 different character fonts. The low power supply (2.7V to 5.5V) of the HD44780U is
suitable for any portable battery-driven product requiring low power dissipation.

4.2 FUNCTION DESCRIPTION

RESISTERS:
The HD44780U has two 8-bit registers, an instruction register (IR) and a data
register (DR). The IR stores instruction codes, such as display clear and cursor shift, and
address information for display data RAM (DDRAM) and character generator RAM
(CGRAM). The IR can only be written from the MPU.
The DR temporarily stores data to be written into DDRAM or CGRAM and
temporarily stores data to be read from DDRAM or CGRAM. Data written into the DR
from the MPU is automatically written into DDRAM or CGRAM by an internal operation.
The DR is also used for data storage when reading data from DDRAM or CGRAM. When
address information is written into the IR, data is read and then stored into the DR from
DDRAM or CGRAM by an internal operation. Data transfer between the MPU is then
completed when the MPU reads the DR. After the read, data in DDRAM or CGRAM at the
net address is sent to the DR for the net read from the MPU. By the register selector (RS)
signal, these two registers can be selected (Table 4.2).

BUSYFLA6 (SF):

When the busy flag is 1, the HD44780U is in the internal operation mode, and the
net instruction will not be accepted. When RS = 0 and RJW = 1 (Table 4.2), the busy flag is
output to DB7. The net instruction must be written after ensuring that the busy flag is O.

DEPT.OFECE Page 20 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

ADDRESS COUNTER CAe):

The address counter (AC) assigns addresses to both DDRAM and CGRAM.
When an address of an instruction is written into the IR, the address information is sent
from the IR to the AC. Selection of either DDRAM or CGRAM is also determined
concurrently by the instruction. After writing into (reading from) DDRAM or CGRAM, the
AC is automatically incremented by ] (decremented by I). The AC contents are then output
to OBO to DB6 when RS = 0 and RlW = ] (Table 4.2).
R S RlW Operation

0 0 IR write as an internal operation (display clear, etc.)

0 1 Read busy flag (OB7) and address counter (DBO to DB6)

I 0 DR write as an internal operation (DR to DDRAM or CGRAM)

1 1 read as an internal operation (DDRAM or CGRAM to DR)

TABLE.4.2: REGISTER SELECTION

4.3 INSTRUCTION DESCRIPTION

CLEAR DISPLAY
Clear display writes space code 20H (character pattern for character code 20H
must be a blank pattern) into all DDRAM addresses. It then sets DDRAM address 0 into
the address counter, and returns the display to its original status if it was shifted. In other
words, the display disappears and the cursor or blinking goes to the left edge of the display
(in the first line if 2 lines are displayed). It also sets lID to 1 (increment mode) in entry
mode. S of entry mode does not change.

DEPT. OF ECE Page 21 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

RETURN HOME
Return home sets DDRAM address 0 into the address counter, and returns the
display to its original status if it was shifted. The DDRAM contents do not change.
The cursor or blinking go to the left edge of the display (in the first line if 2 lines
are displayed).

ENTRY MODE SET


lID: Increments (I/D = 1) or decrements (lID = 0) the DDRAM address by 1 when
8 character code is written into or read from DDRAM. The cursor moves to the right when
incremented by 1 and to the left when decremented by 1.
The same applies to writing and reading of CGRAM.
S: Shifts the entire display either to the right (lID = 0) or to the left (liD = 1) when
S is 1. The display does not shift if S is o.
If S is I, it will seem as if the cursor does not move but the display does. The
display does not shift when reading from DDRAM. Also, writing into or reading out from
CGRAM does not shift the display.

DISPLAY ON/OFF CONTROL


0: The display is on when 0 is 1 and off when D is O. When off, the display data
remains in DDRAM, but can be displayed instantly by setting D to 1.
e: The cursor is displayed when C is I and not displayed when C is o. Even if the
cursor disappears, the function of liD or other specifications will not change during display
data write. The cursor is displayed using 5 dots in the 8th line for 58 dot character font
selection and in tile 11 th line for the 5 10 dot character font selection.
B: The character indicated by the cursor blinks when B is I (Figure 13). The
blinking is displayed as switching between all blank dots and displayed characters at a
speed of 409.6-ms intervals when fcp or rose is 250 kHz. The cursor and blinking can be
set to display simultaneously. (The blinking frequency changes according to rosc or the
reciprocal offcp. For example, when fcp is 270 kHz, 409.6 ' 250/270 = 379.2 ms)

DEPT.OFECE Page 22 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CURSOR OR DISPLAY SHIFT


Cursor or display shift shifts the cursor position or display to the right or left
without writing or reading display data. This function is used to correct or search the
display. In a 2-line display, the cursor moves to the second line when it passes the 40th
digit of the first line. Note that the first and second line displays will shift at the same time.
When the displayed data is shifted repeatedly each line moves only horizontally.
The second line display does not shift into the first line position. The address counter (AC)
contents will not change if the only action performed is a display shift.

FUNCTION SET
DL: Sets the interface data length. Data is sent or received in 8-bit lengths (DB7
to DBO) when DL is I, and in 4-bit lengths (DB7 to OB4) when OL is o. When 4-bit length
is selected, data must be sent or received twice.
N: Sets the number of display lines.
F: Sets the character font.
Note: Perform the function at the head of the program before executing any
instructions (except for the read busy flag and address instruction). From this point, the
function set instruction cannot be executed unless the interface data length is changed.

SE.T C6RAM ADDRESS


Set CORAM address sets the CGRAM address binary AAAAAA into the address
counter. Data is then written to or read from the MPU for CGRAM.

SET DDRAM ADDRESS


Set DDRAM address sets the DDRAM address binary AAAAAAA into the
address counter. Data is then written to or read from the MPU for DDRAM.
However, when N is 0 (I-Hne display), AAAAAAA can be OOH to 4FH. When N
is 1 (2-line display), AAAAAAA can be OOH to 27H for the first line, and 40H to 67H for
the second line.

DEPT. OF ECE Page 23 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

RS RIW DB7 DB6 DB5 DB4 DB3 DB2 DB 1 DBO

Clear
display

RS RIW DBl 086 085 DB4 DB3 DB2 DB1 DBO

Retum
home Code IIII0 0 0 0 10 10 10 I 0 11 1 · 1 Nom:' Don' care.

RS RIW DBT OB6 DD5 DB4 DB3 DB2 DB1 080


Entry
mode set

RS RiW DBl DBS 085 DB4 DBl OB2 081 OBO

~~, Code loioioioiolol11Dl c lsJ

RS RNi DB7 DBS DBS DB4 DB3 Da2 DB1 DBD

Cursor or
display shift Code I 0 1 0 1 0 1 0 1 0 11 1SIC 1RAJ • 1· I~:' Don' tare.

RS Rf'N DB7 DB6 DB5 DB4 DB3 DB2 DB1 DBO

RS RNI OB7 OB6 DB5 DB4 DB3 DB2 DB1 DBO

SetCGRAM
address

... Higher
order bit
Lower
order bit •
TABLE 4.S: INSTRUCTION DESCRIPTION

READ BUS~ FLA6 AND ADDRESS


Read busy flag and address reads the busy flag (BF) indicating that the system is
now internally operating on a previously received instruction. If BF is 1, the internal
operation is in progress. The net instruction will not be accepted until BF is reset to o.
Check the BF status before the net write operation. At the same time, the value of the
address counter in binary AAAAAAA is read out. This address counter is used by both CG

DEPT.OFECE Page 24 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

and DDRAM addresses, and its value is determined by the previous instruction. The
address contents are the same as for instructions set CGRAM address and set DDRAM
address.

SIC RlL
o o Shifts the cursor position to the left. (AC is d&remented by one.)
o 1 Shifts the cursor position to the right. (AC is incremented by one.)
1 o Shifts the entire display to the left The cursor follows the display shift
1 1 Shifts the entire display to the right The cursor follows the display shift

TABLE4.3 (A): SHIFT FUNCTION

No. of
Display Duty
N F Lines Character Font Factor Remarks
0 0 1 5 x 8 dots 1/8
0 1 1 5 x 10 dots 1/11
1 • 2 5 x Bdots 1/16 Cannot display two lines for 5 x 10 dot character font
Note: * Indicates don't care.

TABLE4.3 (B): FUNCTION SET

1t..1t. FEATURES

· 5X8 and 5X 10 dot matrix possible


· Low power operation support:
.:. 2.7 to 5.5V
· Wide rcp1ge of liquid crystal display driver power
.:. 3.0 to II V
· Liquid crystal drive waveform
.:. A (One line frequency AC waveform)
· Correspond to high speed MPU bus interface
.:. 2 MHz (when vec = 5V)
· 4-bit or 8-bit MPU interface enabled
· 80 ' 8-bit display RAM (80 characters rna.)
· 9,920-bit character generator ROM for a total of 240 character fonts

DEPT. OF ECE Page 25 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

.) 208 character fonts (5X 8 dot)


+ 32 character fonts (5XIO dot)
. 64 ' 8-bit character generator RAM
.:. 8 character fonts (5X8 dot)
.:. 4 character fonts (5 X I 0 dot)
· 16-common ' 40-segment liquid crystal display driver
· Programmable duty cycles
.:. 1/8 for one line of 5X8 dots with cursor
.:. 1111 for one line of 5X I 0 dots with cursor
.:. 1116 for two lines of 5X8 dots with cursor
· Wide range of instruction functions:
.:. Display clear, cursor home, display on/off, cursor on/off, display character
blink, cursor shift, display shift
· Pin function compatibility with HD44780S
· Automatic reset circuit that initializes the controller/driver after power on
· Internal oscillator with eternal resistors
· Low power consumption

DEPT. OF ECE Page 26 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPT£R~5

DEPT. OF ECE Page 27 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

HEX KEYPAD
5. t INTRODUCTION
The hex keypad is a peripheral that connects to the microcontroller through its
ports using a 16 pin cable. It has 16 buttons in a 4 by 4 grid, labeled with the hexadecimal
digits 0 to F. An example of this can be seen in Figure I, below.
Internally, the structure of the hex keypad is very simple. Wires run in vertical
columns (we call them CO to C3) and in horizontal rows (called RO to R3). These 8 wires
are available externally, and will be connected to the lower 8 bits of the port. Each key on
the keypad is essentially a switch that connects a row wire to a column wire. When a key
is pressed, it makes an electrical connection between the row and column. The internal
structure of the hex keypad is shown in Figure 2. The specific mapping of hex keypad
wires (CO to C3 and RO to R3) to pins is given in Table I.

l J
4x4Keypad
Layout

Fl6 5.t(A): HEX KE'iPAD LA'iOUT

DEPT. OF ECE Page 28 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Col. 1 Col. 2 C';of. 3 Col. 4-

now 1 --

Row3-----.~r---~~----~_r--_+~._----

FI6 5.1 (8): HEX KEYPAD INTERNAL WIRlN6

At this point, you may be wondering exactly where the signals on the hex keypad
come from. The keys just create a short between a row and column wire when pressed,
but the row and column wires all come from the ports of the microcontroller, rather than
connecting to power or ground.

5.2 READING "ALUES FROM THE HEX KEYPAD


It is tempting to view the hex keypad as a peripheral which just tells us which key
was pressed, and all we have to do is read the value via the microcontroller port. This is
the wrong view to take. The hex keypad is just a way for a user to interact with the
microcontroller board. As described in the previous section, all the keypad does is make
electrical connections between rows and columns - it is up to your program to determine
from that which key was pressed.
The hex keypad is connected to the microcontroller via its input/output ports. We
need to remember a few things about the microcontroller ports in order to read and
interpret hex keypad input properly. Each pin on the microcontroller ports can be
configured individually as input or output.

DEPT. OF ECE Page 29 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Finally, remember that each pin in the HEX keypad is connected to a pull-up
resistor, so any input coming from the hex keypad will read a 1 by default (Le. when a
key is not being pressed). These facts, coupled with our knowledge of how the row and
column wires of the hex keypad are wired up to the microcontroller board, will allow us
to detennine which key has been pressed.
Ifwe treat all the hex keypad wires as inputs, we will always read in a OxFF, since
there is nothing driving those wires - they are unconnected. Even when a key is pressed,
the effect is of connecting one input port to another, so the pull-up resistors will always
output a 1.
The basic concept is that, since all the hex keypad wires are connected to the
microcontroller ports, we need to use some of those wires to output values, and some to
read in values. If we output values onto the columns, say, then when we read from the
rows, if a key is pressed there will be a short between a row and a column and we will
read in whatever value we have set the column to output.
Rows in which no key is pressed will be unconnected, and thus read in as a 1.
Consequently, in order to be able to differentiate between unconnected inputs and inputs
for which a key has been pressed so that they are reading the value put onto a column, we
need to always output o.
Thus, we should write 0 to all of the column wires, and then read in from the row
wires. If no key is pressed, the row wires will all be unconnected, so we will read a 1
value on pins 0 to 3 of the ports. However, if a key is pressed, one of the row wires will
be shorted with a column wire, and will thus have whatever value is on that wire (Le. 0).
Thus, we can id«ntify the row of which key was pressed by reading the row values and
finding which is o.
This could also work if we treated the rows as outputs and the columns as inputs.
In that case, we would output 0 to the rows, and read in from the columns, and whichever
column wire was 0 would indicate the column in which the pressed key resides.
So, being able to identify the row or column of a pressed key helps, but still does
not tell us which key was pressed. The trick is that if you know both the row and the
column, you can determine which key was pressed from their intersection.

DEPT. OF ECE Page 30 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

This means that we must take advantage of the ability to change the direction of
the individual pins of the ports within our program. First, we set one half of the lower 8
bits as input (bits 0 to 3, say) and the other as output (bits 4 to 7), and get one value (the
row, in this case), then we set them the other way around, get the other value, and then
we determine which key was pressed.
So, for example, if we read in that row wire R2 is 0 and column wire C3 is 0, we
know that the B key on the hex keypad was pressed. There are a number of different
ways you can write code that will figure out which key was pressed based on the row and
column numbers. Thus, to summarize, the following steps should be followed in order to
determine which key on the hex keypad has been pressed.
• 16 keys arranged as a 4X4 matrix.
• Must "activate" each row by placing a 1 on its Row output.
• Then the column output is read.
• If there is a 1 on one of the column bits, then the button at the column/row
intersection has been pressed.
• Otherwise, try next row.
• Repeat constantly

5.3 MEMBRANE KEYPAD


A membrane keyboard is a computer keyboard whose "keys" are not
separate, moving parts, as with the majority of other keyboards, but rather are
pressure pads that have only outlines and symbols printed on a flat, flexible
surface. Very little, if any, tactile feedback is felt when using such a keyboard and
error-free blind typing can be difficult.

..
CD
G
e
E)

~
-:-"~~~"l.!

: ......
,~

4&) a 0 : c:

«» a 0-
0

Fl6 5.8: MEMBRANE KEYPAD

DEPT. OF ECE Page 31 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Membrane keyboards, which work by electrical contact between the keyboard


surface and the underlying circuits when key top areas are pressed, were used with some
early 1980s home computers, and have been much used in consumer electronic devices.
The keyboards are very inexpensive to mass produce, and are more resistant against dirt
and liquids than most other keyboards, but due to the low or non-existent amount of
tactile feedback provided, most people have difficulty typing with them, especially when
large numbers of characters need to be typed. Chiclets keyboards were a slight
improvement, at least allowing individual keys to be felt to some extent.

5.3. t WORKINS

As can be seen from the diagram below, the membrane keyboard basically
consists of three layers; two of these are membrane layers containing conductive traces.
The center layer is a "spacer" containing holes wherever a "key" exists.

_ __ TOp j·h:; rnbrane


Laver
~ 'H~les' Layer
"-- Bottom i'1embrane
La yer
. . .~ _ _ _ _ ___ Conductive
"Traces

Fl6 5.4: LA\'EftS OF MEMBRANE KEYPAD

It keeps the other two layers apart. Under normal conditions, the switch (key) is
open, because current cannot cross the non-conductive gap between the traces on the
bottom layer. However, when the top layer is pressed down (with a finger), it makes
contact with the bottom layer. The conductive traces on the underside of the top layer can
then bridge the gap, allowing current to flow. The switch is now "closed", and the parent
device registers a key press.

DEPT. OF ECE Page 32 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~6

DEPT.OFECE Page 33 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

SENSOR
6. t INTRODUCTION
A sensor is a device that measures a physical quantity and converts it into a signal
which can be read by an observer or by an instrument. For example, a thermocouple converts
temperature to an output voltage which can be read by a voltmeter. For accuracy, all sensors
need to be calibrated against known standard.
A sensor is a device which receives and responds to a signal or stimulus. Here, the
term "stimulus" means a property or a quantity that needs to be converted into electrical
form. Hence, sensor can be defined as a device which receives a signal and converts it into
electrical form which can be further used for electronic devices. A sensor differs from a
transducer in the way that a transducer converts one form of energy into other form whereas
a sensor converts the received signal into electrical form only.
They can be mainly sorted by sensor type.

> Acoustic, sound, vibration


> Automotive, transportation
> Chemical
> Electric current, electric potential, magnetic, radio
> Environment, weather, moisture, humidity
> Flow, fluid velocity
> Ionizing radiation, subatomic particles
> Navigatibn instruments
> Position, angle, displacement, distance, speed, acceleration
> Optical, light, imaging
> Pressure
> Force, density, level
> Thermal, heat, temperature
> Proximity, presence
> Sensor technology.

DEPT.OFECE Page 34 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Here in our project we are going to use mainly four sensors; they are as listed below:
• Water level sensor
• Rain sensor
• Moisture sensor
• Temperature sensor

6.2 WATER LEVEL SENSOR


The water level sensor is a module built on the principle of conductivity of water. It
consists of probes used to sense the water level and basically these probes are attached at
different levels to indicate the height of water in water tank.

When a voltage is applied between the probe and the tank wall the water/liquid comes
in contact with the probe, a conductive path is established between the probe and the tank
wall. This current is sensed and fed to the microcontroller as an input and the microcontroller
takes an appropriate decision based on the control algorithm.

In our project we have built a water level sensor using a CD4066BC IC; it is a quad
bilateral switch intended for the transmission or multiplexing of analog or digital signals and
74LS04 is a hex inverter which is used to at the output to increase the strength of the
obtained signal. Later these signals are fed to the micro controller as input to perform the
task.

6.2.1 NEEDOFWATERLEVELSENSOR
The water level sensor is used in our project to feed the level of water in the tank and
on the field to the microcontroJler which is the logic and control station. The levels obtained
in the field are fed to the controller where it is matched with the optimum value. Based on the
output of the control algorithm, decisions are made on whether or not to switch on the pump.

DEPT. OF EeE Page 35 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

6.3 RAIN SENSOR


The rain sensor is developed based on the principle of conductivity. The main
application of rain sensor is:
• It is a water conservation device connected to an automatic irrigation system
that causes the system to shut down in the event of rainfall.

Rain sensors for irrigation systems are electrical type sensors conductance type
probes to measure rainfall. They use mechanisms to temporarily suspend watering by the
irrigation controller; specifically they are connected to the irrigation controller's sensor
terminals.

In our project we are using wired rain sensor, which is used in the application of
irrigation for the conservation of water. We have built a cheap rain sensor which is made up
of PCB design board.

The PCB design board is cut into two parts, to break connectivity. The two parts are
then connected via a capacitor. The two pieces of boards are then connected to between the
ground and the port pin of the microcontroller.

As it rains, connectivity is established between the two and the signal is sent to the
microcontroller to perform the task.

6.3.1 NEED OF RAIN SENSOR

Since we have to stop the pumping of water from the tank to field during raining, so
by using a rain sensor the system comes to know whether it is raining or not , then the
suitable task is perfonned by the system according to the signal sent by the sensor. By using
this we will able to conserve water to an extent.

DEPT. OF ECE Page 36 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

6.11 MOISTURE SENSOR

Soil moisture sensors measure the water content in soil. Measuring soil moisture is
important in agriculture to help farmers manage their irrigation systems more efficiently. Not
only are farmers able to generally use less water to grow a crop, they are able to increase
yields and the quality of the crop by better management of soil moisture during critical plant
growth stages.

Irrigation water management requires timely application of the right amount of water.
Competition for water, high pumping costs, and concerns for the environment are making
good water management more important. Managing irrigation water needs to combine a
method of measuring soil moisture with some method of irrigation scheduling.
Measuring soil moisture detects if there is a water shortage that can reduce yields or if
there is excessive water application that can result in water logging or leaching of nitrates
below the root zone. Measuring soil moisture also can build an awareness and knowledge of
each irrigated field that is invaluable for planning and management.

Monitoring soil moisture levels is required for effective irrigation water management.
Many tried and proven methods of estimating or measuring soil moisture are available. The
method selected depends on a variety of factors such as accuracy, cost, and ease of use.

6.4.1 SOIL MOISTURE CONCEPTS AND TERMS

Soil moisture levels can be expressed in terms of soil water content or soil water
potential (tension). Soil water content most commonly is expressed as percent water by
weight, percent water by volume, or inches of water per foot of soil. Other units such as
inches of water per inch of soil also are used.

Water content by weight is detennined by dividing the weight of water in the soil by
the dry weight of the soil. It can be converted to percent by multiplying by 100%.

DEPT. OF ECE Page 37 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Water content by volume is obtained by multiplying the water content by weight by


the bulk density of the soil. Bulk density of the soil is the relative weight of the dry soil to the
weight of an equal volume of water. Bulk density for typical soils usually varies between 1.5
and 1.6. Inches of water per foot of soil is obtained by multiplying the water content by
volume by 12 inches per foot. It also can be expressed as inches of water per inch of soil
which is equivalent to the water content by volume. By determining this value for each layer
of soil, the total water in the soil profile can be estimated.
Soil water potential describes how tightly the water is held in the soil. Soil tension is
another term used to describe soil water potential. It is an indicator of how hard a plant must
work to get water from the soil the drier the soil, the greater the soil water potential and the
harder it is to extract water from the soil. To convert from soil water content to soil water
potential requires information on soil water versus soil tension that is available for many
soils.

Water in the soil is classed as available or unavailable water. Available water is


defined as the water held in the soil between field capacity and wilting point (Figure 6.4.1).

fl6 6.-\.1: AVAILABIun' OF WATER IN SOIL

DEPT. OF ECE Page 38 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Field capacity is the point at which the gravitational or easily drained water has
drained from the soil. Traditionally, it has been considered as 1/3 bar tension. However, field
capacity for many irrigated soils is approximately 1/10 bar tension.

Inches water
loilTYJ1I per loot mY

Fine sands 0.7-1.0


Loamy sands 0.9-1.5
Sandyloams 1.3 -1.8
looms 1.8· 2.5
Silt Ioams 1.8· 2.6
Clay Ioams 1.8-25
Clays 1.8-2.4
TABLE 6.4.1: AVAILABLE WATER CAPACITIES FOR VARIOUS TYPES OF SOIL
Wilting point is the soil moisture content where most plants would experience
permanent wilting and is considered to occur at 15 bars tension. Table 1 gives common
ranges of available water for soil types.

Readily available water is that portion of the available water that is relatively easy for
a plant to use. It is common to consider about 50% of the available water as readily available
water. Even though all of the available water can be used by the plant, the closer the soil is to
the wilting point, the harder it is for the plant to use the water. Plant stress and yield loss are
possible after the readily available water has been depleted.

6.4.2 CONSTRUCTION OF MOISTURE SENSOR USING 6YPSUM BLOCK:

For the construction of moisture sensor we required

• Plaster of Paris<Gypsum>
• 2 Galvanized Nails
• 112 inch plastic tubing
• utility knife

DEPT. OF ECE Page 39 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

6.4.3 STEPS THAT SHOULD BE FOLLOWED WHILE CONSTRUCTlN6. A


MOISTURE SENSOQ:

• Take your utility knife and cut the tubing slightly longer than your galvanized
finishing nails. Try to make the cut as straight as possible though it doesn't have to
be completely perfect.
• Use your utility knife to cut the smaller plastic tube lengthwise, this will allow easier
removal of your soil sensor after the mold cures.
• Optional: Make the cut diagonally to prevent a potential vertical fracture line.
• If you were very careful on you vertical cuts you can avoid this step, but to
completely avoid spilling plaster onto my workbench I drilled four holes slightly
larger than your tubing. I used these holes for support but also to catch any of the
plaster in the gaps from you less than accurate vertical cuts.
• Being careful that the tubing fits together where you split the tubing vertically, insert
the tubes into the holes (or carefully on a flat surface) Mix Plaster of Paris and
carefully fill with to the top. The friction between the tubing should keep a water
tight seal where you made the cut, though if the plaster is a little thin and it appears to
be leaking through wait a couple minute for the plaster to setup some and try again, at
that time it should not have the viscosity to seep through the very small gap that may
be causing the leak.
• Take your two galvanized nails and push them through a sma)) piece of wax paper.
You may also allow the plaster to setup for a few minutes and then float the nails in
the plaster. I like the first method since gravity will help ensure they fall straight
down and parallel to each other. As for spacing, I have done some experimentation
with the gaps between the probes and my conclusion was, it doesn't make much
difference. As long as there is a gap (they are not touching) you should get reliable
results.
• After allowing the sensor to cure for about and hour remove it from the holes you
drilled in the wood.
• Gently pull back the plastic tubing and you have a nice clean soil sensor.

DEPT.OFECE Page 40 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

• Lay them out to dry for 24 hours to cure completely and their construction is
complete.

• For attaching the wires there are a couple options. The best would be to solder them
to the probes though to do this you need to heat up the nail hot enough to enable a
strong solder connection. My little 15W soldering iron just can't produce the heat for
this so I am option for the wire wrap method. I take about an inch of wire and strip
off about an inch of insulation and tightly wrap around the probe. Given copper will
rust and could be a point of failure you will want to insulate this connection and the
probes from the moisture. A few dabs of hot glue works pretty well. I am planning
on trying liquid plastic, though I am currently out and when I have some on hand I
will update with how it went.

6.4.4 METHODS OF MEASURlNEi SOIL MOISTURE

Soil moisture can be measures or estimated in a variety of ways ranging from the
simple, low cost feel method to more accurate, expensive neutron probe units. For most
irrigation water management applications, one of the several resistance-block types or
tensiometer is recommended.

6.4.5 6VPSUM BLOCKS

A basic gypsum block comprises two electrodes embedded in a block (in this case a
cylinder) of gypsum (Plaster of Paris, CaS04). A measurement is taken from a gypsum
block by measuring the electrical resistance between the electrodes in the block. The block
transmits water easily and rapidly comes into equilibrium with the soil water suction in the
surrounding soil.
While the soil is wet, the pores in the gypsum are filled with water which dissolves
some of the gypsum - enough to make a saturated solution of calcium sulphate, and the water
conducts electrical current in a manner independent of soil water salinity, except at extreme
levels of salinity. In wet conditions, the resistance would be quite small. As the soil around
the block dries, water is 'pulled' from the block, the largest pores emptying of solution first

DEPT.OFECE Page 41 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

then smaller and smaller pores as the soil suction increases. Electric current travelling
between the electrodes in the block must travel a longer path through smaller pores so the
resistance becomes greater.
The gypsum supplies a fixed environment for the electrodes which is independent of
the soil in which the block is installed. A gypsum block, made to consistent specifications,
has a fixed porosity distribution, i.e. the size range of the pores is the same for each sensor.
So whether the instrument is buried in clay or sand, the porosity around the electrodes
remains the same as does the relationship between soil water suction and electrical resistance.
Hence, a single calibration applies irrespective of the soil material in which the sensor is
placed.
The same 'gassing' problem exists for the gypsum block as for the simple 'nail' sensor
described above. An AC current bridge should be used or the blocks should be read rapidly
by a modem logger (in milli-seconds) provided readings are not taken too frequently.
Obviously, an unmodified gypsum block can be constructed easily with little
equipment, however, the material and spacing of the electrodes, and the consistency and
setting time of the slurry of gypsum need to be controlled to get a consistent calibration.
In summary, the gypsum block measures soil suction and can provide a measure of
plant stress provided the block is located in the plant root zone, and the plant has an adequate
root system (Le. is mature). The calibration of a gypsum block is independent of the material
in which it is installed.

.. ., ~.

fl6 6.4.5: 6YPSUM BLOCK

DEPT. OF ECE Page 42 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

The gypsum block dissolves very slowly and has a lifetime of more than 5 years in
alkaline or neutral soils but usually needs to be replaced every 2-3 years in acid soils. The
two wire flex between the gypsum block and the surface is simply pulled up and thrown
away, leaving the gypsum part of the block in the ground with no detrimental effects.

6.4.6 INSTALLATION
Installation is much less critical than with many other sensors. As long as the block is
touching the soil around it, it will work. A good installation means the block will follow the
soil suction in the surrounding soil minute by minute. A very poor installation means that the
block might be a day or so behind the surrounding soil, but it still reaches the right answer in
the end.

6.4.7 RULES FOR INSTALLATION

) . Label the end of the wire which does not have a block on it with the depth of the sensor
BEFORE you bury it, (or you might have to dig them up again to find out what depth you
put them).
2. Make sure that you don't place the sensor directly under a dripper.
3. Make sure that surface water cannot flow down the hole you dig to jnstaH the sensor or
else your sensor will be giving some rather strange readings (see use of bentonite below).
4. Typical depths might be 20cm, 50cm, 70cm and IOOcm. This covers surface moisture
levels, moisture in the root zone, and moisture in the drainage zone.
5. Resistance methods are suitable for most soils, and the readings cover most of the soil
moisture ranges of concern to irrigation management. The blocks tend to deteriorate over
time, and it may be best to use them for only one season. Problems may occur with
highly acid or highly saline soils.

DEPT. OF ECE Page 43 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

6.4.8 NEED OF MOISTURE SENSOa

Soil moisture readings are useful to determine how much water is available for the
crop, when to start irrigating, and how much water to apply. Soil moisture monitoring can
help conserve water and energy, minimize pollution of surface and ground water, and
produce optimum crop yields. Efficient scheduling of irrigation water applications gives the
highest return for the least amount of water.

6.5 TEMPEQATURE SENSOR

The sensor which measures the temperature of the surrounding environment is called
as a temperature sensor.
The LM35 is an integrated circuit sensor that can be used to measure temperature
with an electrical output proportional to the temperature (in degree Centigrade).
• By using an LM35 we can measure temperature more accurately than a using a
thermistor.
• The sensor circuitry is sealed and not subject to oxidation, etc.

• The LM35 generates a higher output voltage than thermocouples and may not require
that the output voltage be amplified.

LMS6DZ

+Vs GND
Vout

FI6 6.5: PIN OUTS OF LM85DZ

6.5. t WORK-INS OF TEMPEQATURE SENSOR


• It has an output voltage that is proportional to the Celsius temperature.
• The scale factor is .0 I V1°C

DEPT. OF ECE Page 44 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

• The LM35 does not require any external calibration or trimming and maintains an
accuracy of +1-0.4 °C at room temperature and +/- 0.8 °C over a range of 0 °C to
+)OO°C.
• Another important characteristic of the LM35DZ is that it draws only 60 micro amps
from its supply and possesses a low self-heating capability. The sensor self-heating
causes less than 0.1 °C temperature rises in still air.

The LM35 comes in many different packages, including the following.

• TO-92 plastic transistor-like package


• TO-46 metal can transistor-I ike package
• 8-lead surface mount SO-8 small outline package
• TO-202 package.

Here we are using TO-202 package.

6.5.2 NEED OF TEMPERATURE SENSOR

The temperature sensor enables the microcontroller to have an estimation of the heat
variable in the field and provide for slight excesses in water supplied to the field. The slight
excesses are maintained to avoid crop destruction due to non-availability of water in the time
gap between checking the environment variables. In future implementations, the temperature
variable is to be used to calculate crop evapo-transpiration and enable better and advanced
scientific farming practices.

DEPT.OFECE Page 45 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~7

DEPT.OFECE Page 46 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

PUMP

7.1 INTRODUCTION
A submersible pump (or electric submersible pump (ESP» is a device which has a
hermetically sealed motor close-coupled to the pump body. The whole assembly is
submerged in the fluid to be pumped. The main advantage of this type of pump is that it
prevents pump cavitations, a problem associated with a high elevation difference between
pump and the fluid surface. Submersible pumps push water to the surface as opposed to jet
pumps having to pull water. Submersibles are more efficient than jet pumps.

7.2 WORKIN6 PRINCIPLE


Systems of mechanical seals are used to prevent the fluid being pumped from
entering the motor and causing a short circuit. The pump can either be connected to a pipe,
flexible hose or lowered down guide rails or wires so that the pump sits on a "ducks foot"
coupling, thereby connecting it to the delivery pipe work.

The pump we use is a small capacity fountain pump which has enough power to
pump water to the field created in our prototype. The pump has the capacity to lift water to
the height of two feet and works on AC mains supply. We actuate the pump using relays
mentioned in the next section based on the parameters fed to the control algorithm by our
array of sensors. The picture of the pump used by us is as shown below.

7 .3 FEATURES:

• High quality ABS shell with longer life span.


• Axle cores and casings made of high quality ceramics and non-corrosive.
• Compact design, quiet, and safe.
• Highly efficient: save on operating cost.

DEPT.OFECE Page 47 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

FIS 7.1: SUBMERSIBLE PUMP

7.4 TECHNICAL SPECIFICATIONS:

VOLTAGE 165-2S0/50Hz

POWER 5W

H-MAX O.8M (2.62FT)

OUTPUT 400L/H

WEIGHT O.2KG

SIZE 39X15.3X19.4CM

THEORY CENTRIFUGAL PUMP

STRUCTURE SINGLE-STAGE PUMP

TYPE SUBMERSIBLE PUMP

TABLE 7.4: SPECIFICATION OF PUMP

DEPT.OFECE Page 48 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~e

DEPT. OF ECE Page 49 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

RELA~

a. t INTRODUCTION

A relay is an electrical switch that opens and closes under the control of another
electrical circuit. In the original form, the switch is operated by an electromagnet to open or
close one or many sets of contacts. It was invented by Joseph Henry in ) 835. Because a relay
is able to control an output circuit of higher power than the input circuit, it can be considered
to be, in a broad sense, a form of an electrical amplifier.

The relay that we are using in this project is a 120V/ 2Amp relay and it's an electro
mechanical relay. The excitation voltage that is required is +5V DC. It is driven using the
Relay driver GS-TH-20ST/GS-TH-212T.

The device is connected to the electro mechanical relay. When the relay is excited by
applying the SV dc the relay gets activated and in the process turns ON the device and when
the excitation voltage is stopped the relay gets deactivated and in the process Turns OFF the
devices.

8.2 BASIC DESIGN &. OPERATION


A simple electromagnetic relay, such as the one taken from a car in the first picture, is
an adaptation of an electromagnet. It consists of a coil of wire surrounding a soft iron core,
an iron yoke, whic~ provides a low reluctance path for magnetic flux, a moveable iron
armature, and a set, or sets, of contacts; two in the relay pictured. The armature is hinged to
the yoke and mechanically linked to a moving contact or contacts. It is held in pJace by a
spring so that when the relay is de-energized there is an air gap in the magnetic circuit. In this
condition, one of the two sets of contacts in the relay pictured is closed, and the other set is
open. Other relays may have more or fewer sets of contacts depending on their function. The
relay in the picture also has a wire connecting the armature to the yoke. This ensures
continuity of the circuit between the moving contacts on the armature, and the circuit track
on the Printed Circuit Board (PCB) via the yoke, which is soldered to the PCB.

DEPT.OFECE Page 50 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

When an electric current is passed through the coil, the resulting magnetic field
attracts the armature and the consequent movement of the movable contact or contacts either
makes or breaks a connection with a fixed contact. If the set of contacts was closed when the
relay was reenergized, then the movement opens the contacts and breaks the connection, and
vice versa if the contacts were open. When the current to the coil is switched off, the
armature is returned by a force, approximately half as strong as the magnetic force, to its
relaxed position. Usually this force is provided by a spring, but gravity is also used
commonly in industrial motor starters. Most relays are manufactured to operate quickly. In a
low voltage application, this is to reduce noise. In a high voltage or high current application,
this is to reduce arcing.

Fl6 a.l RELA'IPARTS

Fl6 a.2 SIMPLE ELECTROMA6NETIC RELAY

If the coil is' energized with DC, a diode is frequently installed across the coil, to
dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a voltage spike dangerous to circuit components. Some automotive relays
already include that diode inside the relay case. Alternatively a contact protection network,
consisting ofa capacitor and resistor in series, may absorb the surge. If the coil is designed to
be energized with AC, a small copper ring can be crimped to the end of the solenoid. This
"shading ring" creates a small out-of-phase current, which increases the minimum pull on the
armature during the AC cycle.

DEPT. OF ECE Page 51 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

By analogy with the functions of the original electromagnetic device, a solid-state


relay is made with a thyristor or other solid-state switching device. To achieve electrical
isolation an opto - coupler can be used which is a light-emitting diode (LED) coupled with a
photo transistor.

8.3 ELECTROMECHANICAL RELAY

Electromechanical relays are switching devices typically used to control high


power devices. In such relays the switching mechanism that is part of an operating circuit, is
activated by means of a relay solenoid coil through which the switching current flows.
Electromagnetic relays genera)]y comprise two primary components including a movab1e
conductive cantilever beam and an electromagnetic coil. Electromechanical type relays have
one or more mechanical displacement electrical contacts coupled to a mobile element of the
magnetic circuit of an electromagnet. The electromagnet is controlled by supplying power to
its coil which drives the movement of the mobile element and the closing or opening of the
electrical contacts of the relay. Over the years, electromechanical relays have found wide and
varied application in the communications and electrical components. Ultra - miniature
electromechanical relays are used in various applications such as instrumentation,
telecommunications, automatic test systems, wireless technologies, RF signal pulse
generators, automotive and medical electronics, as well as commercial and general aviation
and aerospace applications.

As their name implies, Electromechanical Relays are Electro-Magnetic


devices that convert~ a magnetic flux generated by the application of an electrica1 control
signal either AC or DC current, into a pulling mechanical force which operates the electrical
contacts within the relay. The most common form of electromechanical relay consists of an
energizing coil called the "Primary Circuit" wound around a permeable iron core. It has both
a fixed portion called the Yoke, and a moveable spring loaded part called the Armature, that
completes the magnetic field circuit by closing the air gap between the fixed electrical coil
and the moveable armature. This armature is hinged or pivoted and is free to move within the
generated magnetic field closing the electrical contacts that are attached to it. Connected
between the yoke and armature is nonnally a spring (or springs) for the return stroke to
DEPT. OF ECE Page 52 SAlT
CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

"Reset" the contacts back to their initial rest position when the relay coil is in the "de-
energized" condition, i.e. Turned "OFF".

Electromechanical relays are devices that complete or interrupt a circuit by physicaJly


moving electrical contacts into contact with each other. A relay involves two circuits: the
energizing circuit and the contact circuit. The coil is on the energizing side and the relay
contacts are on the contact side. When a relay coil is energized, current flow through the coil
creates a magnetic field. Whether in a DC unit, where the polarity is fixed, or in an AC unit
where the polarity changes 120 times per second, the basic function remains the same: the
magnetic coil attracts a ferrous plate, which is part of the annature. One end of the armature
is attached to the metal frame that is formed so that the armature can pivot, while the other
end opens and closes the contacts. Relay contacts are designed, built and specified for the
type of application for the relay. No single voltage and current rating applies to a given set of
contacts under all circumstances. Contact the relay manufacturer for guidance if your
requirements are unusual or the specifications seem incomplete.

Relay-type choices available for electromechanical relays include general-purpose


relay, machine control or heavy-duty relay, reed relay, and aerospace or MIL-Spec relay.
General-purpose relays operate with AC or DC current, at common voltages and they can
control currents ranging from 2A to 30A. A heavy-duty relay is used to control starters and
other industrial components. Reed relays are capable of switching industrial components
such as solenoids, contactors and starter motors. An aerospace or MIL-spec relay meets
appropriate military specifications or is intended for aerospace applications. Mounting
choices for electromechanical relays include PC board, socket or plug-in style, bracket or
flange mount, and DIN rail.

Pole and throw specifications are important to consider when searching for
electromechanical relays. Pole choices include single pole (SP), double pole (DP), triple pole
(TP), four pole (4P), and greater than four poles. Throw choices are single throw or double
throw. Single throw (ST) relays have a pair of contacts open in one position and closed in
the other. Double throw (On relays have three contacts. The common one is in contact with

DEPT. OF ECE Page 53 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

the second, but not with the third, in one position of the relay, and reverses this connection in
the other relay position.

Important contact specifications to consider when searching for electromechanical


relays include the number of normally open contacts, the number of normally closed
contacts, and the number of changeover contacts. Contact ratings to consider include
maximum switching current, maximum AC switching voltage, maximum DC switching
voltage, maximum AC switching power, and maximum DC switching power. Important coil
ratings to consider include AC coil voltage, DC coil voltage, coil resistance, coil nominal AC
power, and coil nominal DC power.

Important performance specifications to consider for electromechanical relays


include make time (operate time) and break time (release time). Common features for
electromechanical relays include convertible contacts, poly-phase relay, time delay,
intrinsically safe, visual indicators, sealed relay, push-to-test button, current sensitive,
voltage sensitive, expandable deck, and latching controls. An important operating parameter
to consider is the operating temperature.

t\.4 WORKIN6 PRINCIPLE

)llri1
A <:)
sPOT
8

""O"J"
)IIF~1
A2 0 2 82
DPDT

Fl6 &3 R£LA1' W0RKIN6

• Circuit symbols of relays. "C" denotes the common terminal in SPDT and DPDT types.

FlS B.4 DPDT AC COIL RELAl'

DEPT.OFECE Page 54 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

• The diagram on the package of a DPDT AC coil relay

Since relays are switches, the terminology applied to switches is also applied to
relays. A relay will switch one or more poles, each of whose contacts can be thrown by
energizing the coil in one of three ways:

• Normally-open (NO) contacts connect the circuit when the relay is activated; the
circuit is disconnected when the relay is inactive. It is also called a Form A contact or
"make" contact.
• Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the
circuit is connected when the relay is inactive. It is also called a Form B contact or
"break" contact.
• Change-over (CO), or double-throw (DT), contacts control two circuits: one
normally-open contact and one normally-closed contact with a common terminal. It is
also called a Form C contact or "transfer" contact ("break before make"). If this type
of contact utilizes make before break" functionality, then it is called a Form D
contact.

The following designations are commonly encountered:

• SPST - Single Pole Single Throw. These have two terminals which can be connected
or disconnected. Including two for the coil, such a relay has four terminals in total. It
is ambiguous whether the pole is normally open or nonnally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the ambiguity.
• SPDT - Single Pole Double Throw. A common terminal connects to either of two
others. Including two for the coil, such a relay has five terminals in total.
• DPST - Double Pole Single Throw. These have two pairs of terminals. Equivalent to
two SPST switches or relays actuated by a single coil. Including two for the coil, such
a relay has six tenninals in total. The poles may be Form A or Form B (or one of
each).
• DPDT - Double Pole Double Throw. These have two rows of change-over terminals.
Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has

DEPT. OF ECE Page 55 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

eight terminals; including the coil. The "8" or "0" may be replaced with a number,
indicating multiple switches connected to a single actuator. For example 4PDT
indicates a four pole double throw relay (with 14 terminals).

a.5 RnAY DRIVER

The relay used here is OS-TH-20ST.

~L
Sv For power

Dt
tN4DD7
'l Load
~~-----------------.. ..--~.
• N

For status

-
R

fl6 a.5: RELA~ DRIVER CIRCUIT

a.6 MAIN FEATURE

• 92/8 gold silver alloy on silver palladium contact type is suitable for low level
switching application.
• Small size and light weight can provide high density P.C. Board mounting.
• 2.S4gmm Terminal Pitch.
• Low Coil Power Consumption of OS-T Type and high Coil Power Consumption
of 08-D type are available to meet user's selection.
• Employment of suitable plastic materials to be applied to high temperature and
various chemical solutions.
• Plastic epoxy resin sealed type for washing procedure.

DEPT. OF ECE Page 56 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

B. 7 RELAY SPECIFICATION
). Nominal Load (Resistive Load Cos cP = I)

> Contact Capacity


lA@120VAC.
2A@24VDC.
> Rated Carrying Current
2A.
> Max. Allowable Current
2A.
> Max. Allowable Voltage
AC 120V, DC 24V.
). Max. Allowable Power Force.
50 VA, 30W.
> Min. Switching Load
DC IV, ImA.
> Contact Material
AgAlloy.
> Contact Form
DPDT.
> Max. On/Off Switching:
• Electrical "30 Ops per Minute".
• Mechanical "300 Ops per Minute".
> Temperature Range
-30-80°C
> Humidity Range
45-85%RH.
> Coil Temperature Rise
25°C Max. (D Type)
20°C Max. (T Type)

DEPT.OFECE Page 57 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

a.a APPUCATIONS

• Control a high-voltage circuit with a low-voltage signal, as in some types of modems


or audio amplifiers.
• Control a high-current circuit with a low-current signal, as in the starter solenoid of
an automobile.
• Detect and isolate faults on transmission and distribution lines by opening and closing
circuit breakers (protection relays).
• Isolate the controlling circuit from the controlled circuit when the two are at different
potentials, for example when controlling a mains-powered device from a low-voltage
switch. The latter is often applied to control office lighting as the low voltage wires
are easily installed in partitions, which may be often moved as needs change. They
may also be controlled by room occupancy detectors in an effort to conserve energy,
• Logic functions. For example, the Boolean AND function is realized by connecting
normaJly open reJay contacts in series, the OR function by connecting normally open
contacts in para))el. The change-over or Form C contacts perform the XOR (exclusive
or) function. Similar functions for NAND and NOR are accomplished using normally
closed contacts. The Ladder programming language is often used for designing relay
logic networks.
• Safety-critical logic. Because relays are much more resistant than semiconductors to
nuclear radiation, they are widely used in safety-critical logic, such as the control
panels of radioactive waste-handling machinery.
• Time delay fUnctions. Relays can be modified to delay opening or delay closing a set
of contacts. A very short (a fraction of a second) delay would use a copper disk
between the armature and moving blade assembly. Current flowing in the disk
maintains magnetic field for a short time, lengthening release time. For a slightly
longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid
that is allowed to escape slowly. The time period can be varied by increasing or
decreasing the flow rate. For longer time periods, a mechanical clockwork timer is
installed.

DEPT. OF ECE Page 58 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPT£R~9

DEPT. OF ECE Page 59 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

REAL TIME CLOCK


9. 1 INTRODUCTION
A real-time clock (RTC) is a computer clock (most often in the form of an integrated
circuit) that keeps track of the current time. Although the term often refers to the devices in
personal computers, servers and embedded systems, RTCs are present in almost any
electronic device which needs to keep accurate time.

The term is used to avoid confusion with ordinary hardware clocks which are only
signals that govern digital electronics, and do not count time in human units. RTC should not
be confused with real-time computing, which shares its three-letter acronym, but does not
directly relate to time of day.

-~- ••• -~---, "~-"-~ "- .w~" ,.~ '-.'~~f

VIEW \

t Xi Vee J
I
i,, X2 SQJV/OUT j
V.T SCL I
GNO SOA l
PDIP (300 mil.) ._J
Fl6 9. t: PIN OUTS Of DS 1307 Ie

9.2 PURPOSE
Although keeping time can be done without an RTC, using one has benefits:

• Low power consumption (important when running from alternate power)


• Frees the main system for time-critical tasks
• Sometimes more accurate than other methods

DEPT. OF ECE Page 60 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

9.3 POWER SOURCE


RTCs often have an alternate source of power, so they can continue to keep time
while the primary source of power is off or unavailable. This alternate source of power is
normally a lithium battery in older systems, but some newer systems use a super capacitor,
because they are rechargeable and can be soldered. The alternate power source can also
supply power to battery backed RAM.

9.~ TIMING

Most RTCs use a crystal oscillator, but some use the power line frequency. In many
cases the oscillator's frequency is 32.768 kHz. This is the same frequency used in quartz
clocks and watches, and for the same reasons, namely that the frequency is exactly 215
cycles per second, which is a convenient rate to use with simple binary counter circuits.

In our project we are using DSI307 serial real-time clock which is a low power, full
binary-coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data
are transferred serially through an I2C, bidirectional bus.
The clock/calendar provides seconds, minutes, hours, day, date, month, and year
information. The end of the month date is automatically adjusted for months with fewer than
31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-
hour format with AMIPM indicator. The OS 1307 has a built-in power-sense circuit that
detects power failures and automatically switches to the backup supply. Timekeeping
operation continues while the part operates from the backup supply.

9.5 NEED OF REAL TIME CLOCK


A real-time clock in our project is used to do the scheduling of irrigation. We have
tried to move away from the practice of using simple timers and counters in irrigation
systems to switch the pump on and off.
What we intend to do with a real..time clock is to maintain the start date and the end
date of irrigation of the crop selected. The algorithm then goes about setting optimum values
of the environment variables for the particular day in the irrigation schedule. For example:

DEPT. OF ECE Page 61 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Upon selecting paddy as the crop, the date of selection is stored, and the schedule for the first
day is loaded by the algorithm. As the days progress, the schedule changes and accordingly
the algorithm sets the optimum values for on-field variables. The optimum values are decided
based on research conducted by institutes. What we do is just implement scientific
agriculture practices and prevent water wastage.

DEPT. OF ECE Page 62 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPT£R~ to

DEPT. OF ECE Page 63 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

SOLENOID LOCK

10.1 INTRODUCTION

A magnetic lock is disclosed to include a latch for locking, a movable holder member
supported on a spring and carrying solenoid, which has a plunger and a stop block fastened to
the plunger for controlling the retraction of the latch, and an adjustment device selectively
positioned in one of two positioning grooves of different depths in a locating block and
stopped at one end of the holder member against the spring for controlling the movable
holder member between a first position where the magnetic lock is locked when electrically
connected and a second position where the magnetic lock is unlocked when electrically
connected.

A solenoid is a coil of insulated or enameled wire wound on a rod-shaped form made


of solid iron, solid steel, or powdered iron. Devices of this kind can be used as
electromagnets, as inductors in electronic circuits, and as miniature wireless receiving
antennas.

In a solenoid, the core material is ferromagnetic, meaning that it concentrates


magnetic lines of flux. This increases the inductance of the coil far beyond the inductance
obtainable with an air-core coil of the same dimensions and the same number of turns. When
current flows in the coil, most of the resulting magnetic flux exists within the core material.
Some flux appears outside the coil near the ends of the core; a small amount of flux also
appears outside the cpiJ and ofT to the side.

\~~~00~~~~~0~~~~\
1

F16 10.1 :SOLENOID

DEPT.OFECE Page 64 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

to.2 WORKIN6 PRINCIPLE

Solenoid is the generic term for a spool of thread used as an electromagnet. It also
refers to a device that converts electrical energy into mechanical energy by a solenoid; it
produces a magnetic field of electricity and uses the magnetic field to create linear motion.
Common applications include a solenoid to a power switch as the starter in a car or a valve as
a spray.

Coil winding wire is wound into corkscrew shape around a piston, often iron.
Electromagnets have an advantage over permanent magnets to allow into and out of the
application or remove a power to do what is useful to be activated, such as switches and
valves, and allows them to be fully automated. Like all magnets, the magnetic field coil has a
positive and negative pole, which attracts or repels materials sensitive to magnets. In a valve,
so that the electromagnetic field of the piston to move forwards or backwards, which is how
the traffic generated by a magnetic coil.

In a direct acting valve is activated, electrical energy, which in tum attracts a piston
or pistons, which would otherwise be trapped air or fluid flow. In some way valves magnet,
the electromagnetic field is not directly open the line. In the pilot valves, solenoid moves the
piston, which creates a small opening and the pressure by opening is one that works to seal
the valve.

In both types of valves require a steady flow of electricity to stay open, because once
the power is interrupted, the electromagnetic field propagation and closed the valve to its
original position.

In a flash car, starter, solenoid acts as a link with metal contacts to close a circuit. The
starter solenoid receives a small electrical current when the ignition is turned on, usually by
turning the key. The magnetic field of the magnet then draws on the contacts, closing the
circuit between the battery and starter. The starter solenoid requires constant current to
maintain the circulation, but because the engine began to tum once the solenoid for the most
part inactive.

DEPT.OFECE Page 65 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

The magnets are incredibly versatile and extremely useful. They are in all kinds of
automated factory equipment for fireanns paintball. In a bell rings, the audio magazine
produced for the niche, when a piston ring tone metal bar.

FI6 10.2:S0LENOID LOCK

10.3 fEATURES

• Conventional gold wiping contact system


• Available in PC and surface mount configurations
• Traditional tape seal standard
• 95% Minimum solder coverage (9011 0 tin lead)
• Withstands wave soldering temperature of 245°C for 3-5 seconds
• Heat deflection temperature of 260°C for surface mount compatibility
• End stackable (GDS version)
• Auto-insert able (GDS and GDB version)
• Vacuum pick and place compatible (GDS, GOB and GDH)
• Half pitch .050" terminal spacing (GDH version)
• Available in optional tape & reel packaging
• Shipped in the otT position

DEPT. OF ECE Page 66 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~ 11

DEPT.OFECE Page 67 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

MOTORS
11.1 INTRODUCTION
An electric motor uses electrical energy to produce mechanical energy, very typically
through the interaction of magnetic fields and current-carrying conductors. They may be
powered by direct current (for example a battery powered portable device or motor vehicle),
or by alternating current from a central electrical distribution grid. Electric motors may be
classified by the source of electric power, by their internal construction, by their application,
or by the type of motion they give.

1 1.2 DC MOTORS
A DC motor is designed to run on DC electric power. Two examples of pure DC
designs are Michael Faraday's homopolar motor (which is uncommon), and the ball bearing
motor, which is (so far) a novelty. By far the most common DC motor types are the brushed
and brushless types, which use internal and external commutation respectively to create an
oscillating AC current from the DC source so they are not pure1y DC machines in a strict
sense.

11.3 TOYMOTORS
Toy motors are DC motors that have very low torque and RPM. We have chosen toy
motors for our particular application as these are used for opening and closing the inlets of
the rain water harvesting tank and as such the application requires very little torque and
speed. Moreover the~ toy motors also consume very little power and can be directly driven by
the microcontroller without the need for any additional driver circuits. In addition to the
above features, the toy motors are also very small in size and can be placed easily without
major modifications to design of our prototype.

DEPT. OF ECE Page 68 SAlT


CHfGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

t 1.4 SPECifiCATIONS AND FEATURES:

VOLTAGE 3.0

SPEED 12,000RPM

CURRENT 50MA

TORQUE 0.60. eM

DIAMETER 6MM

LENGTH 10MM

POWER USAGE O.07W--O.] W(APPROX)

WEIGHT 1.6G(APPROX)

TABLE 11.4: SPECIFICATION AND FEATURES

FI6 11.3: A TOY MOTOR

DEPT. OF ECE Page 69 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~ 12

DEPT.OFECE Page 70 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

RAIN WATER HARVESTIN6

12. t INTRODUCTION
Rainwater harvesting is the gathering, or accumulating and storing, of rainwater. Rainwater
harvesting has been used to provide drinking water, water for livestock, water
for irrigation or to refill aquifers in a process called groundwater recharge. Rainwater
collected from the roofs of houses, tents and local institutions, or from specially prepared
areas of ground, can make an important contribution to drinking water. In some cases,
rainwater may be the only available, or economical, water source. Rainwater systems are
simple to construct from inexpensive local materials, and are potentially successful in most
habitable locations. Roof rainwater can be of good quality and may not require treatment
before consumption. However some rooftop materials may produce rainwater that is harmful
to human health. Household rainfall catchment systems are appropriate in areas with an
average rainfall greater than 200mm per year, and no other accessible water sources.

12.2 ROOF CATCHMENT SYSTEMS


Roof catchment systems channel rainwater that falls onto a roof into storage via a system of
gutters and pipes. The first flush of rainwater after a dry season should be allowed to run to
waste as it will be contaminated with dust, bird droppings etc. Roof gutters should have
sufficient incline to avoid standing water. They must be strong enough, and large enough to
carry peak flows. Storage tanks should be covered to prevent mosquito breeding and to
reduce evaporation losses, contamination and algal growth. Rainwater harvesting systems
require regular maintenance and cleaning to keep the system hygienic and in good working
order.

12.3 6ROUNDWATER RECHAR6£


Rain~ater may also be used for groundwater recharge, where the runoff on the
ground is collected and allowed to be absorbed, adding to the groundwater. In the US,
rooftop rainwater is collected and stored in sump. In India this includes Bawdis and johads,
or ponds which collect the run-off from small streams in wide area.

DEPT.OFECE Page 71 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

In India, reservoirs called tanks were used to store water; typically they were shallow
with mud walls. Ancient tanks still exist in some places.

12.4 AD"ANTA6ES
Rainwater harvesting can be adopted in cities are to provide supplemental water for
the city's requirements, to increase soil moisture levels for urban greenery, to increase the
ground water table through artificial recharge, to mitigate urban flooding and to improve the
quality of groundwater. In urban areas of the developed world, at a household level,
harvested rainwater can be used for flushing toilets and washing laundry. Indeed in hard
water areas it is superior to mains water for this. It can also be used for showering or bathing.
It may require treatment prior to use for drinking.

12.5 NEED OF RAIN WATER HARVESTIN6


With increasing pressure due to increasing population and wasteful utilization, water
has become a scarce natural resource. As, humans it is our duty to preserve this priceless
resource and pass it on to the next generation. Rain water harvesting is a step in that
direction.

12.6 OUR £NDEAYOR:


We, as engineers are planning to take it one step ahead and preserve water that is so
often let to run-off in fields and farms. This helps in preserving not only water but also the
top soil which is of utmost importance to farmers. We, intend to introduce a piping system on
the field that will act as both an inlet to feed water to the fields and as an outlet to take excess
water out from the fields. The piping system will be controlled at the tank with the inlet to
the tank being opened and closed as and when desired. The entire system will be based on the
tank water level and the water level required on the field. The algorithm will decide based on
real-time considerations whether or not to open the inlet to the tank.

With this system we intend not only to provide a reliable system to preserve water but
also intend on fulfilling our social responsibilities as engineers of the nation.

DEPT.OFECE Page 72 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER~18

DEPT. OF ECE Page 73 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

POWER SUPPLY
t s_ t INTRODUCTION
Power supply is a supply of electrical power. A device or system that supplies electrical or
other types of energy to an output load or group of loads is called a power supply unit or
PSU. The term is most commonly applied to electrical energy supplies, less often to
mechanical ones, and rarely to others.

A power supply may include a power distribution system as weB as primary or secondary
sources of energy such as: C.M.S

• Conversion of one form of electrical power to another desired form and voltage,
typically involving converting AC line voltage to a well-regulated lower-voltage DC
for electronic devices. Low voltage, low power DC power supply units are commonly
integrated with the devices they supply, such as computers and household electronics;
for other examples, see switched-mode power supply, linear regulator, rectifier and
inverter (electrical).
• Batteries
• Chemical fuel cells and other forms of energy storage systems
• Solar power
• Generators or alternators

For large-scale power supplies, see electricity generation.

Constraints that commonly affect power supplies are the amount of power they can supply,
how long they can supply it without needing some kind of refuel ing or recharging, how
stable their output voltage or current is under varying load conditions, and whether they
provide continuous power or pulses.

A regulated power supply or stabilized power supply is one that includes circuitry to tightly
control the output voltage and/or current to a specific value. The specific value is closely

DEPT. OF EeE Page 74 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

maintained despite variations in the load presented to the power supply's output, or any
reasonable voltage variation at the power supply's input.

13. t.lPoWERSUPPL~n'PES

Power supplies for electronic devices can be broadly divided into

• Linear power supplies


• Switching power supplies.

The linear supply is a relatively simple design that becomes increasingly bulky and heavy for
high current devices; voltage regulation in a linear supply can result in low efficiency.

A switched-mode supply of the same rating as a linear supply will be smaller, is usually more
efficient, but will be more complex.

13.2 VOLTA6E RE6ULATORS


A voltage regulator is an electrical regulator designed to automatically maintain a constant
voltage level. It may use an electromechanical mechanism, or passive or active electronic
components. Depending on the design, it may be used to regulate one or more AC or DC
voltages.
It is a three terminals device, but it is in fact a very complex integrated circuit. It converts
varying input voltage into a constant 'regulated' output voltage. Voltage regulators are
available in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of
voltage regulators are designed for positive input. For applications requiring negative input,
the LM79XX series is used.
We are using LM7812 and LM7805 voltage regulators. To regulates the constant voltage of
12V & 5V respectively. The regulated output of 12V is given as an input to the ATMEGA
128 and onboard 5V regulator is given to the relay circuit.

DEPT.OFECE Page 75 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

>+7.5v I 3 +5v
7805

lOOlF :.~ 2 :.':: 100lF

Ov

FIG 13.2: VOLTAGE RE6ULATOR

FI6 13.2(A): 7aXX PINOUTIC

I. Unregulated voltage in
2. Ground
3. Regulated voltage out

13.3 CIRCUIT DESCRIPTION OF 7805


This circuit is a small +5V power supply, which is useful when experimenting
with digital electronics. Small inexpensive wall transformers with variable output voltage are
available from any electronics shop and supermarket. Those transformers are easily available,
but usually their voltage regulation is very poor, which makes then not very usable for digital
circuit experimenter unless a better regulation can be achieved in some way. The following
circuit is the answer to the problem.

This circuit can give +5V output at about 150 rnA current, but it can be increased to
IA when good cooling is added to 7805 regulator chip. The circuit has over overload and
tenninal protection.

DEPT. OF ECE Page 76 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Fl6 13.3: 7Bo5 DESCRIPTION

The capacitors must have enough high voltage rating to safely handle the input
voltage feed to circuit. The circuit is very easy to build for example into a piece of overboard.

9.3. t MODIFICATION IDEAS

If you need more than 150 mA of output current, you can update the output current up
to I A doing the following modifications:

• Change the transfonner from where you take the power to the circuit to a model
which can give as much current as you need from output
• Put a heat sink to the 7805 regulator (so big that it does not overheat because of the
extra losses in the regulator)

If you need other voltages than +5V, you can modify the circuit by replacing the 7805
chips with another regulator with different output voltage from regulator 78xx chip family.
The last numbers in the chip code tells the output voltage. Remember that the input voltage
must be at least 3V-greater than regulator output voltage or otherwise the regulator does not
work well.
Similarly we can describe for the LM7812.

DEPT. OF ECE Page 77 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

9.4 FEATURES

• Brief description of operation: Gives out well regulated +5V output, output current
capabil ity of 100 rnA.
• Circuit protection: Built-in overheating protection shuts down output when regulator Ie
gets too hot.
• Circuit complexity: Very simple and easy to build.
• Circuit performance: Very stable +5V output voltage, reliable operation.
• Availability of components: Easy to get, uses only very common basic components.
• Design testing: Based on datasheet example circuit, I have used this circuit successfully
as part of many electronics projects.
• Applications: Part of electronics devices, small laboratory power supply.
• Power supply voltage: Unregulated DC 8-18V power supply.
• Power supply current: Needed output current + 5 mAo
• Component costs: Few dollars for the electronics components + the input transformer
cost.

DEPT.OFECE Page 78 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CHAPTER-14

DEPT. OF ECE Page 79 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

PROJECT WORKING

14.1 EMBEDDED C LAN6UA6£

It is an extension of C Language to support embedded processors. It is considered as


the subset of C language. It can be easily embedded into any system. Its programming can
be directly addressed into hardware. It supports different libraries. It can be directly
interfaced with the hardware.

14.2 ADVANTA6ES

• Cost Effective because it makes use of cheaper sensor solutions as compared to high end
sensors.
• Highly efficient owing to a well thought out control algorithm.
• Very user-friendly as the target group may be illiterate.
• Owing to a highly efficient algorithm, the savings in terms of water are phenomenal and
the option to save rain water is another USP of our project.
• Since our control algorithm manages water scheduling in its entirety, there is a huge
saving in terms of labor.

14.3 DlSADVANTA6ES

• Since we make use of cheaper sensors in all our applications, the accuracy of the system
is not the best. But since irrigation isn't a very accuracy critical application the
disadvantage can be overru led.
• Since the entire system is made up of a huge number of electronic components working
mostly on the basis of conductivity, the risk of short circuits looms large. This can be
overcome by good quality of workmanship on the components.
• The risk of failure of electronic components and the need for periodic checks are other
disadvantages.

DEPT. OF ECE Page 80 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

t 4.~ FLOWCHART

INITIALIZE
MODULES &
nI~PI4V

LOAD OPTIMUM
VALUES &
~r~l=nllll= nATA

CHECK DATE/TIME
& WEEK INPUT

CHECK FIELD VARIABLE


VALUES .. RAIN CONOmON
.. nlC;1lI1 6V V6111~C;

NO
NO

TURN ON REQD
EQUIPMENTS & RESTORE
nPTIMllM I ~V~I c;

Fl6 1 ~.~ fLOW CHART

DEPT. OF ECE Page 81 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

14.5 APPUCATIONS

The project can be used to monitor the environment variables in fields, greenhouses, and
farms. The product can also work as mini-weather stations and can provide better insights to
the met department on the regional parameters.

t 4.6 COMPONENTS UST

• ATMEGA 128 DEVELOPMENT BOARD


• ATMEGA 128 MICRO CONTROLLER
• LCD 20X4 MATRIX
• MEMBRANE KEY PAD 4X4 MATRIX

• GYPSUM
• ELECTRODES
• LM35DZ
• CD4066
• IC 7404
• IC 7805
• IC7812
• IN 4007
• BC 547
• RELAY5V
• CAPACITORS (22Pf ,44J1F)
• RESISTORS(6.3KO,3300,180KO)
• TRANSFORMERS (9-0-9)
• CONNECTING WIRES
• GENERAL PCB BOARD
• TOYMOTORS

DEPT. OF ECE Page 82 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

CONCLUSION

CHIGURU- An automated micro-irrigation system was tested extensively by varying the test
conditions and was found to be reliable in the tests thus far. The product provides a very
effective way for better water management in fields and also reduces the labor required for
the same. In addition to this it also provides for rain water harvesting off the field helping us
preserve one of the most priceless resources of the earth-WATER. The product as such can
be improved with better workmanship of the sensors and use of more precise techniques for
the same. At the same time the cost of the product should be kept to a minimum as the target
segment is a very cost sensitiv~ segment. In addition to the features already on board, a data-
logger can be implemented by providing an on-board mmc/sd card reader system. In addition
a GSM system can be interfaced to provide the user updates of the field conditions and
warnings in case of failures.

DEPT. OF ECE Page 83 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

BIBU06RAPHY
BOOKS
1. "WATER SAVING PRACTICES IN RICE PADDY CULTIVATION" A Journal
Written by YOSHISUKE NAKANO Faculty of Agriculture in Kyushu
University,JAPAN.

2. "WATER EFFICIENT IRRIGATION STUDY". AN Report by JENNA SMITH,


Study Manager & TIVA BROWN, Study Evaluation of SEATTLE PUBLIC
UTILITIES, RESOURCE CONSERVATION.
3. RICHARD BARNETT, LARRY O'CULL AND SARAH COX "Embedded C
Programming and the Atmel AVR ", Delmar Learning, 2002.

WEBSITE
l. www.atmel.com
2. www.alldatasheet.com
3. www.edaboard.com

DEPT.OFECE Page 84 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

A PHOTOL06U£ OF
OUR PROJECT

DEPT. OF ECE Page 85 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

DEPT.OFECE Page 86 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

DEPT. OF ECE Page 87 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

DATA SHEET

DEPT. OF ECE Page 88 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

November 1983
I=AI~CHILO
RevISed April 2'002
SEMICONDUCTOATM

CD4066BC
Quad Bilateral Switch
General Description • High degree finearity 0.'4)6 distortion (typ.)
The CD40G68C IS a quad btfateral switdl iIltended for the HIgh deg~e bne3rity «» fl6 = 1 kHz. VIS = 5Vp-f)-
transmisSIOn or multiplexing of analog or drgJtaI sfgnal5. It is High degree linearity VOO-VSS = 1OV, Rt. = 10 kU
P'"~for~pin OCf'I'Ip.Btlble WI1h CD4016BC, but nas a much
• Extremely low "OFF- 0.' nA (typ )
lower "ON" resistance, and -oN- reSlStanclt IS relatively
constant over 1he .,put-signal range. swiIdl leakage: 0 Voo-Vss = ,av. T A =25"'C
• Extremely high control mput impedance 10'Zo(typ.)
Features • Low crosstalk -50 dB (typ.)
• Wide supply watage range 3V to 1W between switches 0 f'5 =0.9 MHz. RL = 1 kn
• Htgh nOse Immunity 0.45 Veo (typ.) • Frequency response, switch -ON" 40 MHz (typ )
• Wide range of digital.nd ±7.5 VPEAK
analog switching Applications
• ·0..,. resIStance lor 1BY operation eoa • Analog SIgnal swKdlinglmuftiplexing
• Matched "ON- resistance ARcH =50 (typ.) • Signal gating
.. Squelch control
OWl' t 5V signal ....pl4
-Chopper
• ·0..,. resIStance flat over puk-tD-peilk signal range
• Htgh -ON-rOFF'" e5 dB (typ.) .. ModulatorlOemoduJatDl'
.. Commuta1mg swtch
output votrage ratio 0 f. = 10 kHz. " = 10.a
• Otgltar SIgna' sWItching/multiplexing
• CMOS logic mplementatJon
• AnaIog-to-digstalldlgita1-to-analog C:OnYeI'5ian
• 0tsJta1 control f:A frequency, impedance. phase. and
anaJog-signal-gain

Ordering Code:
Order Number Package Description
C0406eBCM M14A 14-Lead Small Outline Integrated c..-curt (SOIC), JEDEC M5-012. 0.150" Nafl'Q!W
CD4066BCSJ Ml4D 14-Lead Small Outline Package (SOP), EtAJ TYPE H. 5.3mm Wid1!
C04066BCN N14A 14-Lead PlastJc OuaJ..ln-Lt~ PaclI.age (POIP). JEOEC MS-001. 0.300" Wide

Connection Diagram Schematic Diagram

DEPT.OFECE Page 89 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

IfIN.liorU~1 Semiconductor

LM35/LM35A/LM35C/LM35CA/LM35D
Precision Centigrade Temperature Sensors
General Description
The LM35 leUSI are prSCISKX'l .,tegtatec:k:ircUl tetl1*. avaiab1e packaged 1n h&m'l9tiC T0-46 ttanSfStOt' patbge&.
ture senSOlS. wnO&e output voltage IS Itnearly plOf)Ofbttlal to wtlia the LM35C. LM35CA. and 1.M350 ae al&o SIIailabie 11'1
the C&GIus (Cenl9ade) tempefSiulS. The LM35 tt1Js has the plasbc TQ..92 tra1ISlStor pacMge. The LM35D JS also
an ac;.,antage over Inear temperature &eneas calltJ' Bled ., • available ... . , 8-Je.ad s1.I'tace mount smaI outiIne package
Kelvin. al the uss ia not reqt.Wed to subtract a large C~ tWld a Plastic T~.202 package.
stant voltage from Ita OtJtput to obtain oonvU'U9.nt C6r'1ti-
grade scaling The LM35 does not t&q\We any OIdemai cai- Features
bnlbOn or tnmm.,g to ~ovde typtcal 8CCU'E1S6 of f- Y,,'C • CalibratGd dir9cUy in • Co1sius (Centigrade}
at room tan per sture and ±. ¥.C over a "M - 55 to -t 150'"0
• UnG .. + 10.0 mvrc seals factof
~bn range. Low cost III assued by tnml1Wlg and
• 0 5"C aoctJ'8cy ~aranteeable (at +25"C)
c_babOn at the waf_level The LM35'a lOW outllJt mped-
anee. I..,., Q.ltput. and preC118 _meted caJIlf8bon make • Rated for ful 55- to + lS<1C range
• SUitable fa fEmC1t9 sppJiCabC>ns
inteffaang to readout or conIrd clfCUitry espeaa'y easy. It
C51 be used with M'I~e powa- suppifJa. 01 wdt1 plus and • Low ODSt due to waler~level ttlTlning
mnJ5 QC)P18L ~ It drawa (Illy 5) J.1A from its su~ly. It h85 • OpfUllles from -4 to 3) volts
very low self-heabng.lass th~ Q.1"C in alii aar. Tho L.M35t& • LB_ than 80 fiA curenl d-an
fated to operate OWl' a - 55"' to + 1SO"'C temP9«'Sue • Low &elf-heabng. o.08"C iI"I still a1t
151gB. wille the LM35C .. rated for a ~ 40" k) + 11O"'C • Nonhneanty only ±. W~ typioal
,.,gs (-10- wiIh mprcwed accuacy). The LM35 aerie, ~ • Low ~edance output. 0.1 n f« 1 mA toad

Connection Diagrams
1'()...K T().92
-.til Can Pack...• PIntle Package

vourOa+vs
IIJIIM_
~ N.C.
ke.
(iNO
2
oS
-4
1
6
5
HC.
N.t.
N.C.

'YUH/a,••,
-c.-.c...... ~ft. . . . . pin(GNQ Ord« Mumbet' Ul35CZ. TopVtew
LM35CAZ or LII35DZ
Order Numb. Ul35H, LM35AH, 8M NS Package NumberZQaA
LU35CH, Ul35CAH orUl35OH Order Number LM.3SOM
s.. NS Package Number H03H See NS Package Number MotA
To-20J
"lIettc Pacllage
..
Typical Applications
..,,.+,
..
o
La.
SSOP
r
i
I }-=~.rc
'11.IHIm,...
RClUA! 1.. Basic Cent. . .
11JHI.1e....

T~
...... (+ 2"C to + 111rC)
VQIT .... +1,6G1)mV If +tli&C
- +2I5Q mVat +.25"C
- -550 nN __ ~,.C
1L.IHIa51e-M .... AE 2. Fun·Range Centigrade
Ord« Number Ul35DP Temperature Sensor
s.. NS Package Number PoaA
'IAI-SI'.cJE-........................ 8_. . . . . .~

DEPT.OFECE Page 90 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

SN54/74LS04
HEX INVERTER

HEX INVERTER
v~
lOW POWER SCHOTIKY

;r~«t
I
14
.;
JSUFAX
CERAMIC
CASE 632-08

N SUFFIX
PlASTIC
CASE 646-06

o SUFFIX
..# sOle
CASE 751A-02

ORDERING INFORMATION
SN54lSXXJ Ceramlc
SN74lSXXN Plastic
SN74lSXXD sole
GUARANTEED OPERATING RANGES
Symbol Parameter Min Typ Max Unit
Vee SUpply VoIIage 54 4.5 5.0 5.5 V
74 4.75 5.0 525
TA 0peratJlg AtrDeQ ~ Riqe 54 -55 25 125 OC
74 0 25 70
IoH ()Jtput Ct.nent - ~ 54,74 -04 rnA

lot ~ Ctmft-lDW 54 4.0 rnA


14 8.0

DEPT.OFECE Page 91 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

d JVallonal
JJjy 2006

(ll'Sellliconduclo,

LM340llM78XX Series
3-Terminal Positive Regulators
General Description The 5V, 12V. and 15V regulator opbs are available in the
steel T0-3 power package. The LM340M.M34M..M78XXC
The LM 140ILM340AIlM3401lM7BXXC monolillic senGS is availabJg In too TO-220 plastic power package. and
3-termJnal posItJw voltage regulators employ Internal the lM340-5.0 IS avallabfG In tf'\e SOT-223 package. as welt
cum~nt-hmlbr\Q, thermal shutdown and saf&-area compgnsa- as the LM340-5.0 and LM340-12 In the 8urface-mount TO-
tion. maklng them GSSGnbaity indestructible If ad9quat9 heat 263 package.
SlnkJng IS provided. 1h9Y can dshver OWl t OA output cur-
rent They are intooded 88 fixed voUagg regulators 111 8 wide
range of appiicabons tnclU<ing local (on-eard) regulatIOn for Features
ellnllnallon of nolSB and cistnbu1lon prOO4sms assOCIated • Complete speafications at 1A road
with Slrge-pomt ragulahon In addttion to use as fixed volt- • Output voltage tolerances of :2% at TJ 25'C and ::1:4% =
age r9gUlators. theSQ d9vJea can be used With external OWf the temperature rang& (LM340A)
components to Clbtain aqustable output voltages and cur- • line reguta~n of 0.01% or VovrN of AV IN at 1A load
rents (LM340A)
Cons«ierabIG aIfort was expanded to make Iha en1Im saries • Load fegutation of 0.3% of Vau/A (lM34OA)
of re~ators easy to use and minimIZe the number of exter- • totemal tIlQrmaJ owrtoad protecoon
nal components. It 18 not necesS8IY to bypass the output • totemal short·cucurt current limit
although thIS does improve transalt response Input by- • Output ttaf1Slstor safe 81sa protection
passmg IS n9QdGd only If th9 regulator is located far from the
• ~ Product EnhanCGm9f1t tGstQd
fitter ~aator of the powor suppty.

Typical Applications
AdJustalJle output RQguIator
Fb8d Output ......-

RI

~
- GDmIt01
I the RIII'*I1ar IS IoC*ed IW1hJm 1he power ~ IIW.
-=
aarmKII
-AIh:3t.q\ no ~ capIdOr. needBd lor 818b11y.. doeS haIp tr.IIIant VOUT - sv. (6VlR1 .. Ie) R2 SV1R1 > a 10.
~ (' f18lDICI. tme 0.1 tF. CIIIBIIIC ell&). laid raguIIIIDn (Lr) .. ({A1 .. R2)IR1) tt.r all.M3J4O.6).

Camparillan batwHn SOT·223 and D.pak (TQ..252)


Packagos

hJ ~Q
501-223 TO-252.
(IJrntUI

Scale 1:1

'UO-u . . ._ _ ... 4NngBL

DEPT.OFECE Page 92 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

F=AIRCHILC
SEMICONDUC"'On- May 2009

1 N4001 - 1 N4007
General Purpose Rectifiers

Features
• Low forward vot1Bge drop.
• High surge current capability. ~
00-41
COlOR BAND DENOTES CATHODE

Absolute Maximum Ratings * T" = 25CC unless otherwise noted

Value
Symbol Parameter Units
4OO1J400214OO3140041400514006/4007
VAAM Peak Repebtlve Reverse Voltage 50 I 100 I 200 I 400 I soo I 800 1 1000 V
'F(AV) Average Recbhed FOlWard CUrT9nt
1.0 A
375 .. lead length @ TA = 150C
IFSM Non-RepehbVe Peak Forward SUrge CUrrent
30 A
8 3ms Stngle HaIf-SIne-WCfIe
ft Rating for Fusing (t<8.3ms) 3.7 A2sec
Tsm storage Temperature Range -5510 +175 (lC
TJ Operating junction Temperature -55 to +175 °C
• These ratings are DmiUng valUeS above WhiCh 1he serviceability of any semiconductor deVice may by impaired.

Thermal Characteristics
Symbol Parameter Value Units
PD Pawer~ 3.0 W
ReJA Thermal Resastance, JmctiOn to Ambient 50 OCIW

Electrical Characteristics T" = 25CC unleSS otherwise noted


Symbol Parame.r Value Units
Vf Fcxward VOltage @ 1.OA 1.1 V
Maximum FuiLOad Revarse Ctnant. FuB

'"
~
Cycle
Reverse CtmmI @ Rated VR
T" =75"C
TA =25°C
30

5.0
J1A
J1A
TA= 1000C 50 JJA
c,- Totaf capacitanCe VR =4.fN, f = 1.0MHz 15 pF

DEPT.OFECE Page 93 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

Philips Semiconductors Product specification

NPN general purpose transistors BC546; BC547

FEATURES PINNING
• Low cUfl1ll1t (max. 100 rnA) PIN DESCRIPnoN
• Low voIage (max. 65 V). 1 emitter
2 base
APPlICATIONS 3 collector
• General purpoee switching and amplificatiDn.

DESCRIPlION

NPN transistor in a T0-92; SOT54 plastic package.


PNP complements: BC556 and BC557.

Fig.1 Sifl1)lified outline (TO-92; 5OT54)


and symbol.

UMmNG VALUES
In accordance with 1he Absolute Maxinun Rating ~ (lEe 134).
SYMBOL PARAMETER CONomONS MIN. MAX. UNIT
Vceo coIledor-base voltage open emitter
BC546 - 80 V
BC547 - 50 V
Vceo coIlector..emitter wItage open base
BC546 - 65 V
BC547 - 45 V
Veao emtter-base voltage open coIJectDr
BC546 - 6 V
BCS47 - 6 V
Ie collector cu~ (DC) - 100 rnA
leu peak coIector current - 200 rnA
IBM peak base cumrt - 200 mA
p. total power diSSIpation T.,s2SoC;note 1 - SOO mW
TsIII storage temperatwe -65 +150 °C
T, junction temperatwe - 150 <Ie
T_ operating anDent~ -65 +150 oc
Note
1. Tranlilltl mounted on .. FR.. prinIed-circuI bead.

DEPT.OFECE Page 94 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

l!l~ MAXlhl 051307


2
64 x 8, Serial, 1 C Real-Time Clock

GENERAL DESCRIPTION FEATURES


The OS 1307 serial real-time clock (RTC) is a low· • Real-Time Clock (RTC) Counts Seconds.
power, full blnary-coded decimal (BCD) clock/calendar Minutes, Hours, Date of the Month, Month, Day of
plus 56 bytes d NV SRAM. Address and data are the week, and Year with Leap-Year
transferred serially through an 12 C, bidirectional bus. Compensation Valid Up to 2100
The clock/calendar provides seconds, minutes, hours, • 56-Byte. Battery-Backed, General-Purpose RAM
day, date, month, and year Information. The end of with Unlimited Writes
the month date is automatically adjusted for months • 12C Serial Interface
with fewer than 31 days, Including corrections for leap • Programmable Square-Wave Output Signal
year. The clock operates in either the 24-hour or 12- • Automatic Power-Fail Detect and Switch Circuitry
hour format with AM/PM indicator. The DS1301 has a • Consumes Less than 500nA in Battery-Backup
built-in power-sense circuit that detects power failures Mode with Oscillator Running
and automatically switches to the backup supply. • Optionallndustrial Temperature Range:
Timekeeping operation continues while the part ·40°C to +85c C
operates from the backup supply. • Available in 8-Pin Plastic DIP or SO
• Underwriters Laboratories (UL) Recognized
1YPICAL OPERATING CIRCUIT

t f\U"l.
:. ~:.
~C£..

"I~
CRYSTAl

rO~
X1
SCL
X2
SONIQJ
~s.

Va:.
.. :
:~
GND
X1il
PIN CONFIGURATIONS
rO;)\t'~....

Xl
VeAl sel
SOA
xOva:.
lOUT X2
VfU,.l

GN
SQNK>Ul
SCl
SDA
SO (150 m.ts) POIP (300 mils)
CPU
OS130
SOA Va..T -
~ ... "
I "".,,~
"':
Fr
~=-

ABSOLUTE MAXIMUM RAliNGS


Voltage Range on Any Pin Relative kl Ground ......................................................................................().5V to f7.OV
Operating Temperature Range (Nonoondensing)
Commercial ..................................................................................................................................ODe to +70°C
Industrial ....................................................................................................................................40°C to +85t C
Storage Temperature Range._ .•.. _................................................................................................... -551!C to +125°C
Soldering Temperature {DIP. leads)........................................................................................+260cC for 10 seconds
Sddering Temperature (surface mount~ ................................Referto the JPClJEDEC J-STD-020 Specification.
SmsIS beyond those Istad under aAb.sotM Mmnum Rati1gs· may C3USfJ ptmantnl darragt to ",. dM:8. 1htst 1f9 stress rarngs onIf,
IIK1 furtcbOnal optratJon of tilt d.VJC8 at th8s8 Of any oth8r condltms beyond fh.os9 irrllt;aCtd in th. opsrational ssctiJns of thB sptCIfications is
tallnplMJ. &pout 10 fht IbsobJtJ mmnum ,.tttg oondI/ons for exttndBd pttIods may affet;t delict reliablly.

DEPT. OF EeE Page 95 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

TIMING DIAGRAM

figure 1. Block Diagram

If
• saW/OUT
-
X1 ~y

lC'y
~
ITc•..
.!!

...
1Hzl4.096kH%J8.192kHzll2.768kHz

1Hz
~
... MUXI
BUFFER

-t t
--... .....
X2 --.nr ..

t
OsCIllator
anddrwder t ~
RAM
(56X!)
V= - rt'"
CONTROL
LOGIC
GND .....- POWER
CONTROL CLOCK.
V.T .....- .hi AXI..IM
CALENDAR.
~ AND CONTROL
DS1307 REGISTERS

-
-' i---
+
SCL -. SERIAL BUS
NTERFACE -- USER BUFFER

--- - AND ADDRESS


SOA ..... REGISTER (T8YTES)

• I

DETAILED DESCRIPTION
The 051307 is a low-power clock/calendar with 56 bytes of battery-backed SRAM. The clock/calendar provides
seconds, minutes, hours, day, date, month. and year information. The date at the end of the month is automatically
adjusted for months with fewer than 31 days, including corrections for leap year. The OS 1307 operates as a slave
device on the 12 C bus. Access is obtained by implementing a START condition and providing a device identification
mete foilONed by a register address. Subsequent registers can be accessed sequentially until a STOP condition is
executed. When Vee falls below 1.25 x VSAT• the device terminates an access in progress and resets the device
address counter. Inputs to the device wiff not be recognized ct this time to prevent erroneous data from being
\Witten to the device from an out-of-tolerance system. When Vee falls belaw V BAT• the device switches into a low-
QJrrent battery-backup mode. Upon power-up, the device switches from battery to Vee when Vee is greater than
V eAT +0.2\1 and recognizes inputs when Vee is greater than 1.25 x V FJAT • The block oaagram in Figure 1 shows the
main elements of the serial RTC.

DEPT.OFECE Page 96 SAlT


CHIGURU- AN AUTOMATED MICRO IRRIGATION SYSTEM

PIN DESCRIPTION
PIN NAME FUNCTION
Connections for Standard 32.768kHz Quartz Crystal. The internal oscillator circuitry is
1 X1 designed for operation with a crystal having a specified load capacitance (C l ) of 12.5pF.
X1 is the input to the oscillator and can optionally be connected to an extemal32.768kHz
<scillator The output of the internal oscillator. ><2. Is floated If an external oscillator is
connected to X1.
2 X2 Note: For more information on crystal selection arli crystal layout considerations. refer to
ApplICation Note 58: Crystal ConSiderations with Dallas ReaJ-Time Clocks.

Backup Supply Input for Any Standard 3V Uthium Cell or Other Energy Source. Battery
voltage must be held between tne minimum and maximum limits for proper operation.
Diodes in series between the battery and the V SAT pin may prevent proper operation. If a
backup supply is not required, V BAT must be grounded. The nominal power-fail trip point
3 VIAT (VPF) voltage at which access to the RTC aod user RAM is denied is set by the internal
drcuitry as 1.25 x V SAT nominal. A lithium battery with 48mAh or greater will back up the
081307 for more than 10 years in the absence of power at +25~C.
UL recognized to ensure against reverse charging current when used with a lithium
battery. Go to: VNIW.maxirn-i~ comfgalinfolull.
4 GNO Ground
Serial Data Input/Output. SDA is the data input/output for the I4lC serial interface. The
S SDA SDA pin is open drain and requires an extemal puUup resistor. The pullup voltage can be
UP to 5.5V reQardless of the voltaoe on Vcr..
Serial Clock Input. SCL is the clock input for the IZC interface and is used to synchronize
6 SCL data movement on the serial interface. The pullup voltage can be up to S.5V regardless of
the voltage on V ce.
Square Wave/Output Driver. When enabled the sawe bit set to 1, the SQW/OUT pin
outputs one of four square-wave frequencies (1Hz, 4kHz, 8kHz, 32kHz). The SQW/OUT
7 SaW/OUT pin is open drain and requires an external pullup resistor. SQW/OUT operates with either
Vee or VeAT applied. The pullup voltage can be up to 5.&1 regardless of the voltage on
V~c.1f not used this pjn can be left floating.

Primary Power Supply. When VOltage is applied within normallimits t the device is fully
accessible and data can be written and read. VVhen a backup supply is connected to the
8 Vee device and Vee is below Vtpt read and writes are inhibited. However. the timekeeping
function continues unaffected by the lower input VOltage.

DEPT.OFECE Page 97 SAlT

You might also like