Professional Documents
Culture Documents
SYSTEM
A Project Report Submitted
in Partial Fulfillment of the Requirements
for the Degree of
BACHELOR OF TECHNOLOGY
in
ELECTRONICS & COMMUNICATION ENGINEERING
by
MAYANK JAIN
VARUN KUMAR
(2008UEC057)
MAYUR MATHUR
BHARDWAJ
(2008UEC059)
VIKRAMADITYA SINGH
(2008UEC104)
(2008UEC102)
SONAL
(2007UEC
HEMANT KUM
to the
MANGALAYATAN UNIVERSITY
BESWAN, ALIGARH
Department of
Electronics and
Communication Engineering
CERTIFICATE
This is to certify that the project work entitled
MOBILE CONTROLLED IRRIGATION SYSTEM
is a bonafide work carried out by
MAYUR MATHUR (2008UEC059)
VIKRAMADITYA SINGH(2008UEC104)
VARUN KUMAR(2008UEC102)
MAYANK JAIN(2008UEC057)
SONAL BHARDWAJ(2007UEC )
(Signature)
(Signature)
ACKNOWLEDGEMENT
the
Department
of
Electronics
and
Communication
Finally, we thank all the people who have directly or indirectly help us through the
course of our Project.
ABSTRACT
TABLE OF CONTENTS
CERTIFICATE FROM ECE DEPARTMENT
ACKNOWLEDGEMENTS
ABSTRACT
LIST OF FIGURES
LIST OF TABLES
CHAPTER 1. INTRODUCTION
1.1 Aim of the project
11
1.2 Methodology
11
1.3 Organization of work
12
CHAPTER 2. OVERVIEW
2.1 Overview of project
14
14
2.1.3 Description
16
19
33
36
3.2.3 Transformer
3.2.4 Capacitor
3.2.5 Crystal oscillator
3.2.6 Resistance
3.2.7 LED
3.2.8 LCD
CHAPTER 5. CONCLUSIONS
5.1 Conclusions and Future scope
BIBLOGRAPHY
REFERENCES
CHAPTER 1
INTRODUCTION
1.INTRODUCTION
1.1 INTRODUCTION
The aim of the project is to develop a system, which uses mobile
technology that keeps control on irrigation system.
Mobile Controlled irrigation system is automatic control system
which is capable of receiving a set of command instructions in the
form of Short message service and performs the necessary actions like
Start, Stop. We will be using a dedicated modem at the receiver
module i.e. with the robot itself and send the commands using SMS
service as per the required actions. The mobile unit which is dedicated
at the motor driver is interfaced with an intellectual device called
Micro controller so that it takes the responsibility of reading the
received commands in the form of SMS from the mobile unit and
perform the corresponding predefined tasks such as motor start, stop,
motor direction and speed control at different levels etc.
In this project we interfaced 8051 Microcontroller with GSM modem
to decode the received message and do the required action. The
protocol used for the communication between the two is AT
10
11
CHAPTER 2
OVERVIEW
12
2 OVERVIEW OF PROJECT
2.1.1 BLOCK DIAGRAM
GSM BASED
Motor Control
SMS
8051
Level
Converter
13
Motor
14
15
2.1.3 DESCRIPTION
In this project we are going to control the motor based on mobile
communication. The idea behind this particular work is to give user the full
flexibility to control the motor from remote distances when there is busy schedule
concerned to his daily routine.
The main parts of this schematic diagram are:
1. TRANSFORMER.
2. BRIDGE RECTIFIER.
3. MICROCONTROLLER UNIT (AT89S52).
4. GSM MODEM.
5. REGULATOR.
6. CRYSTAL OSCILLATOR.
7. LIQUID CRYSTAL DISPLAY.
8. RESISTANCE.
9. CAPACITOR.
10.LIGHT EMITTING DIODE.
11.L293DNE IC.
16
CHAPTER 3
HARDWARE DESCRIPTION
17
3. HARDWARE DESCRIPTION
The block diagram of the system is as shown in the fig. The system basically
consists of a
1 Micro controller.
2 Power supply.
3 GSM MODEM.
18
three microcontrollers will have the same internal architecture, but they differ in
the following aspects.
1. 8031 has 128 bytes of RAM, two timers and 6 interrupts.
2. 89S51 has 4KB ROM, 128 bytes of RAM, two timers and 6 interrupts.
3. 89S52 has 8KB ROM, 128 bytes of RAM, three timers and 8 interrupts.
Of the three microcontrollers, 89S51 is the most preferable. Microcontroller
supports both serial and parallel communication.
In
the
concerned
project
89S52
microcontroller
is
used.
Here
19
20
21
Pin Description
VCC
Pin 40 provides Supply voltage to the chip. The voltage source is +5v.
GND.
Pin 20 is the grounded.
Port 0
Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. As an
output port each pin can sink eight TTL inputs. When 1s are written to port 0 pins,
the pins can be used as high-impedance inputs. Port 0 may also be configured to be
the multiplexed low-order address/data bus during accesses to external program
and data memory. In this mode P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming, and outputs
the code bytes during program verification. External pull-ups are required during
program verification.
23
Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups from pin 1 to 8.
The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to
Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 1 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2
external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX),
respectively, as shown in following table.
Port 1 also receives the low-order address bytes during Flash programming
and program verification.
Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to
28. The Port 2 output buffers can sink / source four TTL inputs. When 1s are
written to Port 2 pins they are pulled high by the internal pull-ups and can be used
24
as inputs. As inputs, Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external
program memory and during accesses to external data memory that uses 16-bit
addresses (MOVX @ DPTR). In this application it uses strong internal pull-ups
when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to
17. The Port 3 output buffers can sink / source four TTL inputs. When 1s are
written to Port 3 pins they are pulled high by the internal pull-ups and can be
used as inputs. As inputs, Port 3 pins that are externally being pulled low will
source current (IIL) because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89C52
as listed below
25
Port 3 also receives some control signals for Flash programming and
programming verification.
RST
Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this
pin, the microcontroller will reset and terminate all activities. A high on this pin for
two machine cycles while the oscillator is running resets the device.
ALE/PROG
Address Latch is an output pin and is active high. Address Latch Enable
output pulse for latching the low byte of the address during accesses to external
memory. This pin is also the program pulse input (PROG) during Flash
programming. In normal operation ALE is emitted at a constant rate of 1/6 the
oscillator frequency, and may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external
Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR
location 8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit
has no effect if the microcontroller is in external execution mode.
26
PSEN
Program Store Enable is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during
each access to external data memory.
EA/VPP
External Access Enable EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up
to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage (VPP) during Flash
programming when 12-volt programming is selected.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2
Output from the inverting oscillator amplifier.
27
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on chip oscillator, as shown in
Figure 5.3. Either a quartz crystal or ceramic resonator may be used. To drive the
device from an external clock source, XTAL2 should be left unconnected while
XTAL1 is driven .
28
There are no requirements on the duty cycle of the external clock signal, since the
input to the internal clocking circuitry is through a divide-by two flip-flop, but
minimum and maximum voltage high and low time specifications must be
observed.
Idle Mode
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM
and all the special functions registers remain unchanged during this mode. The idle
mode can be terminated by any enabled interrupt or by a hardware reset. It should
be noted that when idle is terminated by a hardware reset, the device normally
resumes program execution, from where it left off, up to two machine cycles
before the internal reset algorithm takes control.
29
On-chip hardware inhibits access to internal RAM in this event, but access
to the port pins is not inhibited. To eliminate the possibility of an unexpected write
to a port pin when Idle is terminated by reset, the instruction following the one that
invokes Idle should not be one that writes to a port pin or to external memory.
Table 3.2 Status Of External Pins During Idle and Power Down Mode
On the chip are three lock bits which can be left unprogrammed (U) or can
be programmed (P) to obtain the additional features listed in the table 5.4. When
lock bit 1 is programmed, the logic level at the EA pin is sampled and latched
during reset. If the device is powered up without a reset, the latch initializes to a
random value, and holds that value until reset is activated. It is necessary that the
latched value of EA be in agreement with the current logic level at that pin in order
for the device to function properly.
TIMERS
Timer 0 and 1
Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and
Timer 1 in the AT89S52.
Register pairs (TH0, TL1), (TH1, TL1) are the 16-bit counter registers for
timer/ counters 0 and 1.
31
Timer 2
Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an
event counter. The type of operation is selected by bit C/T2 in the SFR T2CON.
Timer 2 has three operating modes: capture, auto-reload (up or down counting),
and baud rate generator. The modes are selected by bits in T2CON, as shown in
Table 5.2. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer
function, the TL2 register is incremented every machine cycle. Since a machine
cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator
frequency.
32
There are no restrictions on the duty cycle of external input signal, but it
should for at least one full machine to ensure that a given level is sampled at least
once before it changes.
3.1.5 Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts
(INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port
interrupt. These interrupts are all shown in Figure 2.5
33
Note that Table 5.3 shows that bit position IE.6 is unimplemented. In the
AT89C51, bit position IE.5 is also unimplemented. User software should not write
1s to these bit positions, since they may be used in future AT89 products.
34
35
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in
which the timers overflow. The values are then polled by the circuitry in the next
cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same
cycle in which the timer overflows.
a) Accumulator (0E0h)
As its name suggests, it is used to accumulate the results of large no. of
instructions. It can hold 8 bit values.
b) B register (oFoh)
The B register is very similar to accumulator. It may hold 8-bit value. The B
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the products gets stored in B register. In DIV AB the quotient gets stored in
B with the remainder in A.
36
e) Program counter
The program counter is a 16 bit register, which contains the 2 byte address,
which tells the next instruction to execute to be found in memory. When the 8052
is initialized PC starts at 0000h and is incremented each time an instruction is
executes. It is not addressable SFR.
37
----
---
----
GF1
GF0
PD
IDL
TF1
TR1
TF0
TR0
IE1
IT1
IE0
IT0
h)TMOD(Timer Mode,89h)
The timer mode SFR is used to configure the mode of operation of each of
the two timers. Using this SR your program may configure each timer to be a 16bit timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers.
Additionally you may configure the timers to only count when an external pin is
activated or to count events that are indicated on an external pin.
38
Gate
C/ T
M1
M0
Gate
TIMER1
C/ T
M1
M0
TIMER0
40
___
EA
ET2
ES
ET1
EX1
ET0
EX0
___
___
PT2
PS
PT1
41
PX1
PT0
PX0
CY
AC
F0
RS1
RS0
OV
----
42
43
3.2.1 REGULATOR
A variable regulated power supply, also called a variable bench power
supply, is one where you can continuously adjust the output voltage to your
requirements. Varying the output of the power supply is the recommended way to
test a project after having double checked parts placement against circuit drawings
and the parts placement guide. This type of regulation is ideal for having a simple
variable bench power supply. Actually this is quite important because one of the
first projects a hobbyist should undertake is the construction of a variable regulated
power supply. While a dedicated supply is quite handy e.g. 5V or 12V, it's much
handier to have a variable supply on hand, especially for testing. Most digital logic
circuits and processors need a 5 volt power supply. To use these parts we need to
build a regulated 5 volt source. Usually you start with an unregulated power supply
ranging from 9 volts to 24 volts DC (A 12 volt power supply is included with the
Beginner Kit and the Microcontroller Beginner Kit.). To make a 5 volt power
supply, we use a LM7805 voltage regulator IC .
Fig.3.7-Regulator
44
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the
power, you get a 5 volt supply from the Output pin.
Circuit Features:
Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA
Circuit protection: Built-in overheating protection shuts down output when
regulator IC 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 mA
Component costs: Few dollars for the electronics components + the input
transformer cost.
45
IC Voltage Regulators:
Vin
C1
IN OUT
78XX
Vout
C2
GND
46
Output voltage(v)
7805
+5
7806
+6
7808
+8
7810
+10
7812
+12
7815
+15
7818
+18
7824
+24
35V
40V
47
Filtration
The rectifier circuits we have discussed above deliver an output voltage that
always has the same polarity: but however, this output is not suitable as DC power
supply for solid-state circuits. This is due to the pulsation or ripples of the output
voltage. This should be removed out before the output voltage can be supplied to
any circuit. This smoothing is done by incorporating filter networks. The filter
network consists of inductors and capacitors. The inductors or choke coils are
generally connected in series with the rectifier output and the load. The inductors
oppose any change in the magnitude of a current flowing through them by storing
up energy in a magnetic field. An inductor offers very low resistance for DC
whereas; it offers very high resistance to AC. Thus, a series connected choke coil
in a rectifier circuit helps to reduce the pulsations or ripples to a great extent in the
output voltage. The fitter capacitors are usually connected in parallel with the
rectifier output and the load. As, AC can pass through a capacitor but DC cannot,
the ripples are thus limited and the output becomes smoothed. When the voltage
across its plates tends to rise, it stores up energy back into voltage and current.
48
Thus, the fluctuations in the output voltage are reduced considerable. Filter
network circuits may be of two types in general:
49
3.2.3 TRANSFORMER
A transformer is a device that transfers electrical energy from one circuit to
another through inductively coupled conductors the transformer's coils or
"windings". Except for air-core transformers, the conductors are commonly wound
around a single iron-rich core, or around separate but magnetically-coupled cores.
A varying current in the first or "primary" winding creates a varying magnetic field
in the core (or cores) of the transformer. This varying magnetic field induces a
varying electromotive force (EMF) or "voltage" in the "secondary" winding. This
effect is called mutual induction.
Fig.3.9-Transformer
If a load is connected to the secondary circuit, electric charge will flow in the
secondary winding of the transformer and transfer energy from the primary circuit
to the load connected in the secondary circuit.The secondary induced voltage VS, of
an ideal transformer, is scaled from the primary VP by a factor equal to the ratio of
the number of turns of wire in their respective windings:
50
51
COMPONENTS OF A TRANSFORMER
Two coils of wire (called windings) are wound on some type of core material. In
some cases the coils of wire are wound on a cylindrical or rectangular cardboard
form. In effect, the core material is air and the transformer is called an AIR-CORE
TRANSFORMER. Transformers used at low frequencies, such as 60 hertz and 400
hertz, require a core of low-reluctance magnetic material, usually iron. This type of
transformer is called an IRON-CORE TRANSFORMER. Most power transformers
are of the iron-core type. The principle parts of a transformer and their functions
are:
The CORE, which provides a path for the magnetic lines of flux.
The PRIMARY WINDING, which receives energy from the ac source.
The SECONDARY WINDING, which receives energy from the primary
winding and delivers it to the load.
The ENCLOSURE, which protects the above components from dirt,
moisture, and mechanical damage.
52
3.2.4 CAPACITORS
It is an electronic component whose function is to accumulate charges and then
release it.
terminal are marked as (-) and (+) so check it while using capacitors in the circuit in
right direction. Mistake can destroy the capacitor or entire circuit in operational.
Fig.3.11-Capacitor
Fig.3.12-Crystal oscillator
3.2.6 RESISTANCE
55
Fig.3.13-Resistance
56
COLOURS CODE
Black--------------------------------------------0
Brown-------------------------------------------1
Red----------------------------------------------2
Orange------------------------------------------3
Yellow-------------------------------------------4
Green--------------------------------------------5
Blue----------------------------------------------6
Violet--------------------------------------------7
Grey---------------------------------------------8
White--------------------------------------------9
The first rings give the first digit. The second ring gives the second digit. The third ring
indicates the number of zeroes to be placed after the digits. The fourth ring gives
tolerance (gold 5%, silver 10%, No colour 20%).In variable resistors, we have the
dial type of resistance boxes. There is a knob with a metal pointer. This presses over
brass pieces placed along a circle with some space b/w each of them.
Resistance coils of different values are connected b/w the gaps. When the knob is
rotated, the pointer also moves over the brass pieces. If a gap is skipped over, its
resistance is included in the circuit. If two gaps are skipped over, the resistances of
both together are included in the circuit and so on. A dial type of resistance box
contains many dials depending upon the range, which it has to cover. If a resistance
box has to read upto 10,000, it will have three dials each having ten gaps i.e. ten
resistance coils each of resistance 10. The third dial will have ten resistances each
of 100.
57
The dial type of resistance boxes is better because the contact resistance in this
case is small & constant.
3.2.7 LED
When a junction diode is forward biased, energy is released at the junction diode is
forward biased, energy is released at the junction due to recombination of electrons
and holes. In case of silicon and germanium diodes, the energy released is in
infrared region. In the junction diode made of gallium arsenate or indium
phosphide, the energy is released in visible region. Such a junction diode is called a
light emitting diode or LED.
58
Fig.3.14-LED
59
CHARACTERISTICS OF LEDs
Forward Voltage (VF) drop across LED Diodes are current driven!
Wavelength variations Crystal and junction growth defects
Brightness variations Crystal defects resulting formation of phonons
and non-radiation energy transfer
Temperature Junction temperature of the device affects each of the
parameters above
60
3.2.8 LCD
It is a liquid crystal display of thin flat panel used for electronically displaying
information such as text, images and moving pictures.
Fig.3.15-LCD
FEATURES
61
62
63
64
Note that the starting "AT" is the prefix that informs the modem about the start of a
command line. It is not part of the AT command name. For example, D is the actual
AT command name in ATD and +CMGS is the actual AT command name in
AT+CMGS. However, some books and web sites use them interchangeably as the
name of an AT command.
Here are some of the tasks that can be done using AT commands with a
GSM/GPRS modem or mobile phone
Get basic information about the mobile phone or GSM/GPRS modem. For
example, name of manufacturer (AT+CGMI), model number (AT+CGMM),
IMEI number (International Mobile Equipment Identity) (AT+CGSN) and
software version (AT+CGMR).
Get basic information about the subscriber. For example, MSISDN
(AT+CNUM) and IMSI number (International Mobile Subscriber Identity)
(AT+CIMI).
Get the current status of the mobile phone or GSM/GPRS modem. For
example, mobile phone activity status (AT+CPAS), mobile network
registration status (AT+CREG), radio signal strength (AT+CSQ), battery
charge level and battery charging status (AT+CBC).
Establish a data connection or voice connection to a remote modem (ATD,
ATA, etc).
Send and receive fax (ATD, ATA, AT+F*).
Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write
(AT+CMGW) or delete (AT+CMGD) SMS messages and obtain
notifications of newly received SMS messages (AT+CNMI).
66
Benefits of GSM
1. Emergency
Response.
112 is now a universal emergency number among GSM networks. No matter where
the user is, if they are using GSM, they can call for help.
2. Technological Growth
The growth of communications technology has been prompted by worldwide
competition, allowed by the universality of GSM. This has lead to a reliable cellphone service and improved quality in both connection stability and ease.
3. Universal Data Transfer
The Global System for Mobile Communications allows for reliable and efficient
67
data transfer. It even allows text and pictures to be sent from anywhere the system
is available.
4. Better sound
As digital carrier, a GSM cell phone makes for clearer connections as it can filter
background noise. This makes communication, despite distance easy.
5. Greater Security
Due to the way its designed, a call needs to request access. This is a safety features
that makes sure that only the caller and the receiver are in the conversation.
APPLICATION
Voting Machine
Home Appliance Control
Robot Control
E-Notice Board
68
CHAPTER 4
SOFTWARE DESCRIPTION
69
4 INTRODUCTION
The software used in this project is KEIL u Version3.
Keil Software to provide you with software development tools for 8051
based microcontrollers. With the Keil tools, you can generate embedded
applications for virtually every 8051 derivative. The supported
microcontrollers are listed in the Vision Device Database. The Keil
Software 8051 development tools are designed for the professional software
developer, but any level of programmer can use them to get the most out of
the 8051 microcontroller architecture.
Keil software converts the C-codes into the Intel Hex code.
The coding used in this project is as follows:
void lcdinit(void);
void lcdData(unsigned char l);
void lcdcmd(unsigned char k);
void DelayMs(unsigned int count);
void InitModem(void);
void initdisplay(void);
//--------------------------------------// Lcd initialization subroutine
//--------------------------------------void lcdinit(void)
{
70
lcdcmd(0x38);
DelayMs(250);
lcdcmd(0x0C);
DelayMs(250);
lcdcmd(0x01);
DelayMs(250);
lcdcmd(0x06);
DelayMs(250);
lcdcmd(0x80);
DelayMs(250);
}
//--------------------------------------// Lcd data display
//--------------------------------------void lcdData(unsigned char l)
{
LCD_PORT=l;
RS=1;
EN=1;
DelayMs(1);
EN=0;
return;
}
71
72
CHAPTER 5
CONCLUSION
73
5.1 Conclusion
74
BIBLIOGRAPHY
1.
WWW.MITEL.DATABOOK.COM
2.
WWW.ATMEL.DATABOOK.COM
3.
WWW.FRANKLIN.COM
4.
WWW.KEIL.COM
REFERENCES
1.
2.
75