Documente Academic
Documente Profesional
Documente Cultură
HUMIDITY
MINI PROJECT REPORT
submitted in partial fulfillment of the requirements for the award of
the degree of
Bachelor of Technology
in
ELECTRONICS AND COMMUNICATION
ENGINEERING
of
MAHATMA GANDHI UNIVERSITY
by
SHARON FRANCIS(12012989)
Certified that the mini project work titled IRRIGATION CONTROL BASED
ON HUMIDITY is a bonafide report of the mini project done by
SHARON FRANCIS (Uni. Reg. No:12012989) of sixth semester Electronics
and Communication Engineering in partial fulfillment of the requirement for the award of degree of Bachelor of Technology in Electronics
and Communication of the Mahatma Gandhi University, Kottayam, during the academic year 2014-2015
Project Guide
Internal Examiner
External Examiner
Place: Kakkanad
Date :
ACKNOWLEDGEMENT
We are grateful to the almighty God for his blessings and for
helping us complete this project successfully.
We would like to thank Rev. Dr Antony Kariyil CMI, Director,
RSET, Kakkanad and Dr A.Unnikrishnan, Principal for providing
us all the necessary facilities including a very well furnished lab.We
would also like to thank Mr. Jaison Jacob, HOD, Department of
Electronics and Communication for his constant and sincere efforts
to help us bring out the best that we could.We are also grateful to
our guide Ms.Maleeha Abdul Azeez, Asst. Professor, Department of
Electronics and Communication for her valuable and most helpful
guidance all through the course of the project.
This acknowledgement would be incomplete without thanking
Mr.Sreekumar G., Mr. K Ramavarma, Mr. Abhishek Viswakumar, Asst. Professors, Department of Electronics and Communication, RSET, Kakkanad for their constant encouragement and support throughout the course of this project. We also thank other
teaching and non teaching staff of Department of Electronics and
Communication for helping us in some way or the other. Last but
not the least we thank all our classmates in S6 ECE for helping
us a lot with their valuable suggestions and for their whole hearted
support.
ii
ABSTRACT
iii
Contents
ACKNOWLEDGEMENT
ii
ABSTRACT
iii
1 Introduction
1.1 Objective . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Project Definition . . . . . . . . . . . . . . . . . . . .
1.3 Working Methodology . . . . . . . . . . . . . . . . .
1
1
1
2
2 System Overview
2.1 Block Diagram . . . . . . . . .
2.2 Block Diagram Explanation . .
2.2.1 PIC Microcontroller . .
2.2.2 GSM Module . . . . . .
2.2.3 DC Motor . . . . . . . .
2.2.4 LCD Display . . . . . .
2.2.5 Regulated power supply
.
.
.
.
.
.
.
3
3
4
4
4
4
4
5
.
.
.
.
.
.
.
.
.
.
.
.
6
6
6
7
8
8
8
8
9
9
10
10
10
3 Hardware Implementation
3.1 Circuit Diagram . . . . . . .
3.1.1 Power Supply circuit
3.1.2 Circuit Diagram . . .
3.2 Components Description . .
3.2.1 PIC16F877A . . . .
3.2.2 IC7805 . . . . . . . .
3.2.3 DC MOTOR . . . .
3.2.4 L293D . . . . . . . .
3.2.5 LCD DISPLAY . . .
3.2.6 GSM MODULE . . .
3.2.7 MAX232 . . . . . . .
3.3 Circuit Operation . . . . . .
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4 Software Implementation
4.1 Program . . . . . . . . .
4.2 Software Tools . . . . . .
4.2.1 Proteus . . . . .
4.2.2 MPLAB . . . . .
4.2.3 DIPTRACE . . .
5 PCB Design
5.1 PCB Technology . .
5.2 PCB Layout . . . . .
5.2.1 Top Layer . .
5.2.2 Bottom Layer
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
12
12
21
21
21
22
.
.
.
.
23
23
25
25
26
27
7 Applications
28
8 Conclusion
29
List of Figures
2.1
Block Diagram . . . . . . . . . . . . . . . . . . . . .
3.1
3.2
6
7
5.1
5.2
Top Layer . . . . . . . . . . . . . . . . . . . . . . . .
Bottom Layer . . . . . . . . . . . . . . . . . . . . . .
25
26
vi
Introduction
1.1
Objective
1.2
Project Definition
1.3
Working Methodology
The project consist of a main control unit which is the microcontroller. Moisture detector system is made by using two iron nails
kept in the soil, where the moisture content is to be measured. The
detector is also connected to the microcontroller. It detects the
voltage variation which determines the moisture content in the soil.
This variation is given to the Analog-to-Digital converter of the PIC
controller. The digital output decides the working of the motor. The
PIC controller is programmed to run the motor when the moisture
content falls below a reference value. When the moisture content
reaches that particular value, the motor is turned off. The LCD
displays the instantaneous value of soil moisture content and the
status of the pump.
The system also consists of a GSM module which allows manual
operation of the device. The PIC controller is programmed to analyse the SMS received by the GSM module and based on this, the
motor is operated.
System Overview
2.1
Block Diagram
2.2
2.2.1
GSM Module
A GSM module can be interfaced to the serial port of the microcontroller to send and receive message or to make a call . It is a specialized type of modem that accepts a SIM card, and operates over
a subscription to mobile operator, just like a mobile phone. From
the mobile operator perspective, a GSM module looks just like a
mobile phone. The GSM module used is SIMCOM 300 which uses
SIM memory to store the number of system owner or housemates
and distributor or to whoever the messages have to be forwarded.
2.2.3
DC Motor
LCD Display
2.2.5
Hardware Implementation
3.1
3.1.1
Circuit Diagram
Power Supply circuit
3.1.2
Circuit Diagram
3.2
3.2.1
Components Description
PIC16F877A
IC7805
DC MOTOR
electromagnetism The Device is a monolithic integrated high voltage, high current four channel driver designed to accept standard
DTL or TTL logic levels and drive inductive loads (such as relays
solenoides, DC and stepping motors) and switching power transistors. To simplify use as two bridges each pair of channels is equipped
with an enable input. A separate supply input is provided for the
logic, allowing operation at a lower voltage and internal clamp diodes
are included. This device is suitable for use in switching applications
at frequencies up to 5 kHz.
3.2.4
L293D
LCD DISPLAY
3.2.6
GSM MODULE
GSM Module is used to establish communication between the microcontroller and a GSM system.GSM is an architecture used for mobile communication in most of the countries.GSM module consists
of a GSM modem assembled together with power supply circuit and
communication interfaces(like RS-232,USB etc) for computer.The
modem is soul of such modules.GSM module can collect some data
and send it to the central place using SMS or GSM data call
3.2.7
MAX232
3.3
Circuit Operation
of PIC. The GSM module uses RS232 logic for communication while
the PIC uses TTL logic. A serial converter IC is used in between
them for the conversion between the two logics.
When the circuit is powered on PIC constantly checks the output
of the moisture detector. When it produces a low voltage, ie when
the water content of the soil is below a reference value, the motor is
turned on and water is pumped. When the moisture detector output
is high, the PIC reads the input value at the analog pin and motor
is switched off. The input to the analog pin is calibrated so as to
display the water content and motor status on the LCD display.
11
Software Implementation
4.1
Program
#i n c l u d e <p i c . h>
#i n c l u d e l c d . h
#i n c l u d e s e r i a l . h
#i n c l u d e p i c a d c . h
#d e f i n e IN1 RA3
#d e f i n e IN2 RA5
#d e f i n e EN RE0
i n t i =0, t , dd=0, aa =0;
char sms [ 2 ] ;
void gsm init ( )
{
RCIE=0;
CREN=0;
u s a r t t x s t r i n g ( AT ) ;
u s a r t t r a n s m i t ( 0X0D ) ;
u s a r t t r a n s m i t ( 0X0A ) ;
delay ( 2 ) ;
u s a r t t x s t r i n g ( AT+CMGF=1);
u s a r t t r a n s m i t ( 0X0D ) ;
u s a r t t r a n s m i t ( 0X0A ) ;
delay ( 2 ) ;
u s a r t t x s t r i n g ( AT+CNMI= 2 , 2 , 0 , 0 , 0 ) ;
u s a r t t r a n s m i t ( 0X0D ) ;
u s a r t t r a n s m i t ( 0X0A ) ;
12
delay ( 2 ) ;
u s a r t t x s t r i n g ( AT+CMGD=1);
u s a r t t r a n s m i t ( 0X0D ) ;
u s a r t t r a n s m i t ( 0X0A ) ;
delay ( 2 ) ;
u s a r t t x s t r i n g ( AT+CMGD=2);
u s a r t t r a n s m i t ( 0X0D ) ;
delay ( 2 ) ;
RCIE=1;
CREN=1;
}
v o i d main ( )
{
ADCON1=0x0E ;
TRISD=0X00 ;
TRISA0=1;
TRISA3=0;
TRISA5=0;
TRISE0=0;
TRISC=0X80 ;
PORTB=0X00 ;
PORTE=0X00 ;
PORTA=0X00 ;
PORTC=0X00 ;
PORTD=0X00 ;
EN=1;
ADCON0=0X05 ;
ADCON1=0X8E ;
GIE=1;
PEIE=1;
RCIE=1;
RCIF=0;
IN1 =0;
IN2 =0;
lcd init ();
usart init ();
gsm init ( ) ;
13
i f ( t=498&&t >=440)
{
aa =1;
RC1=1;
lcd command ( 0 xC0 ) ;
l c d d i s p l a y ( Pump ON ) ;
IN1 =1;
IN2 =0;
}
else {
aa =0;
}
i f ( dd==1|| aa==1)
{
IN1 =1;
IN2 =0;
}
i f ( ! dd && ! aa )
{
RC1=0;
lcd command ( 0 xC0 ) ;
14
IN1 =0;
IN2 =0;
l c d d i s p l a y (
}
);
i f ( i >1)
{
i f ( sms [1]== Y )
{
dd=1;
lcd command ( 0 x01 ) ;
lcd command ( 0 xC0 ) ;
l c d d i s p l a y ( Pump ON ) ;
RC1=1;
}
e l s e i f ( sms [1]== N )
{
lcd command ( 0 x01 ) ;
lcd command ( 0 xC0 ) ;
l c d d i s p l a y ( Pump OFF ) ;
RC1=0;
IN1 =0;
IN2 =0;
dd=0;
}
sms [ 1 ] = \ 0 ; sms [ 0 ] = \ 0 ;
i =0;
}
}
}
s t a t i c void i n t e r r u p t i s r ( )
{
i f (RCIF)
{
RCIF = 0 ;
sms [ i ]= u s a r t r e c e i v e ( ) ;
i f ( sms [ 0 ] = = ) i ++;
e l s e i =0;
}
15
#i n c l u d e l c d . h
#d e f i n e RS RC2
#d e f i n e E RC3
void delay ( i n t n)
{
w h i l e ( n);
}
v o i d lcd command ( i n t a )
{
PORTD=a ;
RS=0;
//RW=0;
E=1;
delay (100);
E=0;
}
v o i d l c d d a t a ( char a )
{
PORTD=a ;
RS=1;
//RW=0;
E=1;
delay (100);
E=0;
}
v o i d l c d d i s p l a y ( c o n s t char s )
{
w h i l e ( s )
{
l c d d a t a ( s ) ;
s++;
}
}
v o i d lcd num ( u n s i g n e d i n t x )
{
char a [ 1 0 ] ;
i n t i =0;
while (x)
{
a [ i ]=x%10;
i ++;
x= x / 1 0 ;
16
}
a [ i ]= \0 ;
i ;
w h i l e ( i >=0)
{
l c d d a t a ( a [ i ]+0 x30 ) ;
i ;
}
l c d d i s p l a y (
);
}
void l c d i n i t ( )
{
lcd command ( 0 x38 ) ;
lcd command ( 0 x01 ) ;
lcd command ( 0 x0c ) ;
}
#i n c l u d e s e r i a l . h
v o i d u s a r t t r a n s m i t ( char a )
{
TXREG=a ;
w h i l e ( ! TXIF ) ;
TXIF=0;
}
char u s a r t r e c e i v e ( )
{
char a ;
w h i l e ( ! RCIF ) ;
a=RCREG;
return (a ) ;
}
v o i d u s a r t t x s t r i n g ( c o n s t char s )
{
w h i l e ( s )
{
u s a r t t r a n s m i t ( s ) ;
s++;
}
}
void u s a r t i n i t ( )
{
17
TXSTA=0X24 ;
RCSTA=0X90 ;
SPBRG=0X19 ;
}
#i n c l u d e p i c a d c . h
Adc8 Cha ( u n s i g n e d char ) ;
Adc10 Cha ( u n s i g n e d char ) ;
unsigned i n t adc hbit , a d c l b i t ;
u n s i g n e d i n t adc temp , adc temp0 , a d c v a l 1 ;
u n s i g n e d char a d c v a l , a d c d e l , a d c j ;
Adc10 Cha ( u n s i g n e d char v a l )
{
ADFM=1;
a d c d e l =25;
i f ( v a l ==0)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x00 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x05 ;
w h i l e (ADCON0!=0X01 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==1)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x08 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x0d ;
18
w h i l e (ADCON0!=0X09 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==2)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x10 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x15 ;
w h i l e (ADCON0!=0 x11 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==3)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x18 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x1d ;
w h i l e (ADCON0!=0 x19 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==4)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
19
{
ADCON0=0x20 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x25 ;
w h i l e (ADCON0!=0 x21 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==5)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x28 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x2d ;
w h i l e (ADCON0!=0 x29 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
e l s e i f ( v a l ==6)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x30 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x35 ;
w h i l e (ADCON0!=0 x31 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
20
}
e l s e i f ( v a l ==7)
{
adc temp0 =0;
f o r ( a d c j =0; a d c j <10; a d c j ++)
{
ADCON0=0x38 ;
ADON=1;
w h i l e ( a d c d e l );
ADCON0 =0x3d ;
w h i l e (ADCON0!=0 x39 ) ;
a d c h b i t=ADRESH;
a d c l b i t=ADRESL;
adc temp = a d c l b i t + (256 a d c h b i t ) ;
adc temp0=adc temp0+adc temp ;
}
}
a d c v a l 1=adc temp0 / 1 0 ;
return adc val1 ;
}
4.2
4.2.1
Software Tools
Proteus
MPLAB
DIPTRACE
Electronic design automation (EDA or ECAD) is a category of software tools for designing electronic systems such as printed circuit
boards and integrated circuits. The tools work together in a design
flow that chip designers use to design and analyze entire semiconductor chips.
DipTrace is an EDA software for creating schematic diagrams
and printed circuit boards. In this project the PCB design software
DipTrace was used to draw the schematic and obtain the board layout.This software offers user friendly, powerful and affordable solutions for PCB design, including Schematic, Capture, Board Layout
and Autorouter. The PCB layout editor allows back annotation
to the schematic and auto-routing to automatically connect traces
based on the connections defined in the schematic. It also shows a
3D Preview of the PCB layout. We used DipTrace CAD to create
our PCB design files and the layout for printing.
22
PCB Design
A printed circuit board, or PCB, is used to mechanically support and
electrically connect electronic components using conductive pathways, tracks or signal traces etched from copper sheets laminated
onto a non-conductive substrate. The design of PCB is considered
as the last step in electronics circuit design as well as the first step
in production of PCBs. It forms a distant factor in the circuits
performance and reliability. The designing of the PCB consists of
designing of the layout followed by generation of the artwork. The
board is typically coated with a solder mask that is green in color.
Other colors that are normally available are blue, black, white and
red. Conducting layers are typically made of thin copper foil. Insulating layers dielectric is typically laminated together with epoxy
resin prepreg.Well known prepreg materials used in the PCB industry are FR-2 (Phenolic cotton paper), FR-3 (Cotton paper and
epoxy), FR-4 (Woven glass and epoxy), FR-5 (Woven glass and
epoxy), FR-6 (Matte glass and polyester), G-10 (Woven glass and
epoxy), CEM-1 (Cotton paper and epoxy), CEM-2 (Cotton paper
and epoxy), CEM-3 (Non-woven glass and epoxy).
5.1
PCB Technology
PCB) then removing unwanted copper after applying a temporary mask (e.g., by etching), leaving only the desired copper
traces.
LAMINATION Some PCBs have trace layers inside the PCB
and are called multilayer PCBs. These are formed by bonding
together separately etched thin boards.
DRILLING Holes through a PCB are typically drilled with
small-diameter drill bits made of solid coated tungsten carbide.
Coated tungsten carbide is recommended since many board
materials are very abrasive and drilling must be high RPM
and high feed to be cost effective. These holes are often filled
with annular rings (hollow rivets) to create vias. Vias allow
the electrical and thermal connection of conductors on opposite
sides of the PCB.
SCREEN PRINTING Line art and text may be printed onto
the outer surfaces of a PCB by screen printing. Screen print is
also known as the silk screen, or, in one sided PCBs, the red
print.
PRINTED CIRCUIT ASSEMBLY After the printed circuit
board (PCB) is completed, electronic components must be attached to form a functional printed circuit assembly, or PCA
(sometimes called a printed circuit board assembly PCBA).In
through-hole construction, component leads are inserted in holes.
In surface-mount construction, the components are placed on
pads or lands on the outer surfaces of the PCB. In both kinds
of construction, component leads are electrically and mechanically fixed to the board with a molten metal solder. Soldering
techniques are used to attach components to a PCB.
TESTING While the power is on, in-circuit tests, where physical measurements (i.e voltage, frequency) can be done. Moreover while the power is on, functional test, just checking if the
PCB does what it had been designed to do can also be done.
24
5.2
5.2.1
PCB Layout
Top Layer
25
5.2.2
Bottom Layer
26
27
Applications
The applications of irrigation control system based
on humidity are :
Applications
28
Conclusion
The Irrigation Control Based on Humidity was successfully implemented and tested. In this current scenario where there is shortage
of water, this system can play a vital role in water conservation.
This system when practically implemented would help users to irrigate their farms efficiently and timely. It can reduce the over-use
of water, and also excessive irrigation and damaging of plants. This
system have following advantages,
It reduces human intervention and still ensures proper irrigation.
It helps in water conservation.
It avoids over irrigation of the soil which may damage the plant
crops.
It can be switched to manual mode whenever required.
29
Bibliography
[1] John B. Peatman, Design with PIC Microcontrollers, Prentice
Hall, 1998
[2] Barnett, Ocull, and Cox, Embedded C Programming and the
Microchip PIC, DELMAR CENGAGE Learning, 2004.
[3] Hayes,
GSM
modem
AT
Command
Set,
http://www.engineersgarage.com/tutorials/at-commands,
March 4, 2013
30