Example Document
Example Document
CHAPTER 1
Since these early applications in the 1960s, embedded systems have come
down in price. There has also be an enormous rise in processing power and
functionality. For example the first microprocessor was the Intel 4004, which found
its way into calculators and other small systems, but required external memory and
support chips.
The operating system runs above the hardware, and the application
software runs above the operating system. The same architecture is applicable to any
computer including a desktop computer. However, there are significant differences. It
is not compulsory to have an operating system in every embedded system. For small
appliances such as remote control units, air conditioners, toys etc., there is no need for
an operating system and you can write only the software specific to that application.
For applications involving complex processing, it is advisable to have an operating
system. In such a case, you need to integrate the application software with the
operating system and then transfer the entire software on to the memory chip. Once
the software is transferred to the memory chip, the software will continue to run for a
long time you don’t need to reload new software.
Now, let us see the details of the various building blocks of the hardware of an
embedded system. As shown in Fig. the building blocks are;
· Input Devices
· Output devices
· Communication interfaces
· Application-specific circuitry
The Central Processing Unit (processor, in short) can be any of the following:
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-
controller is a low-cost processor. Its main attraction is that on the chip itself, there
will be many other components such as memory, serial communication interface,
analog-to digital converter etc. So, for small applications, a micro-controller is the
best choice as the number of external components required will be very less. On the
other hand, microprocessors are more powerful, but you need to use many external
components with them. DSP is used mainly for applications in which signal
processing is involved such as audio and video processing.
1.3.2 Memory:
Unlike the desktops, the input devices to an embedded system have very
limited capability. There will be no keyboard or a mouse, and hence interacting with
the embedded system is no easy task. Many embedded systems will have a small
keypad-you press one key to give a specific command. A keypad may be used to input
only the digits. Many embedded systems used in process control do not have any
input device for user interaction; they take inputs from sensors or transducers 1’fnd
produce electrical signals that are in turn fed to other systems.
The output devices of the embedded systems also have very limited capability.
Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate
the health status of the system modules, or for visual indication of alarms. A small
Liquid Crystal Display (LCD) may also be used to display some important
parameters.
The embedded systems may need to, interact with other embedded systems at
they may have to transmit data to a desktop. To facilitate this, the embedded systems
are provided with one or a few communication interfaces such as RS232, RS422,
RS485, Universal Serial Bus (USB), IEEE 1394, Ethernet etc.
1.4 PERIPHERALS:
Peripherals are the various devices that are connected to the CPU, for
performing various functions. Embedded systems talk with the outside world via
peripherals, such as:
1.5
PROCCESORS:
Processors are the key elements in any embedded system. They interact with
the memory, where the various instructions of useful functions into a single IC
package.
The ability to execute a stored set of instructions to carry out user defined
tasks.
The ability to be able to access external memory chips to both read and writes
data from and to the memory.
1.6 RELIABILITY:
The system cannot safely be shut down for repair, or it is too inaccessible to
repair. Solutions may involve subsystems with redundant spares that can be
switched over to, or software “limp modes” that provide partial function. Examples
include space systems, undersea cables, navigational beacons, bore-hole systems
and automobiles.
The system must be kept running for safety reasons. “Limp modes” are less
tolerable. Often backups are selected by an operator. Examples include Aircraft,
Navigation, Reactor control systems, safety-critical Chemical factory controls, Train
signals and engines on single-engine Aircraft.
The system will loose large amounts of money when shutdown: Telephone
switches, Factory controls, Bridge and elevator controls, funds transfer and
market making, automated sales and service.
Physically, embedded systems ranged from portable devices such as MP3
players, to large stationary installations like traffic lights, Factory controllers. In
terms of complexity embedded systems can range from very simple with a single
microcontroller chip to very complex with multiple units, peripherals and networks
mounted inside a large chassis or enclosure.
CHAPTER 2
CIRCUIT OPERATION
2.1 OVERVIEW
The proposed system is an embedded system which will be used at toll gates
for the automatic deduction of toll tax without stopping the vehicles. This process is
done with help of GPS and GSM technology. When the vehicle crossed the toll gate
then the money will be deducted from the owners account if there is insufficient
balance then the request will be sent to deduct from friends account
Initially start the circuit and set all initial values to zero
Now the gps ,finds the exact position(latitude and longitude)of the vehicle
The obtained gps data is sent to microcontroller for further processing this data is
initially stored in a buffer
Initially the location of the toll gates are predefined in the gpsn the similar manner ,as
and when the vehicle crosses the toll gates the ssame process will be repeated
Then again a message indicating the toll tax fee and remaining balance is displayed on
the mobile screen
For suppose if there is no balance in the customer account then there will be another
facility to add friends acoount and use his balance at instance ,officially
To access friends account a meesage indicating ACC Account number is sent to the
sim
CHAPTER 3
MICRO CONTROLLERS
3.1. Introduction:
Integration of Functionality
Microcontrollers sometimes are called single-chip computers because they
have on-chip memory and I/O circuitry and other circuitries that enable them to
function as small standalone computers without other supporting circuitry.
Field Programmability, Flexibility
Microcontrollers often use EEPROM or EPROM as their storage device to
allow field programmability so they are flexible to use. Once the program is tested to
be correct then large quantities of microcontrollers can be programmed to be used in
embedded systems.
Easy to Use
Assembly language is often used in microcontrollers and since they usually follow
RISC architecture, the instruction set is small. The development package of
microcontrollers often includes an assembler, a simulator, a programmer to "burn" the
chip and a demonstration board. Some packages include a high level language
compiler such as a C compiler and more sophisticated libraries.
A Timer module to allow the microcontroller to perform tasks for certain time
periods.
A serial I/O port to allow data to flow between the microcontroller and other
devices such
as a PC or another microcontroller.
An ADC to allow the microcontroller to accept analogue input data for
processing.
VSS - Ground.
Port 0:
Port 1
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. Port 1 also receives the low-order address bytes during Flash
programming and verification.
Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1
output.
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull ups. 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 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 use 16-bit addresses
(MOVX @DPTR). In this application, it uses strong internal pull ups when emitting
1s. During accesses to external data memory hat use 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 bi-directional I/O port with internal pull ups. 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 AT89C51 as listed
below:
Port 3 also receives some control signals for Flash programming and verification.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG
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.
PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89C51 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,
for parts that require 12-volt VPP.
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
1.Costly:
The microprocessor system had to satisfy the data and program requirements
so, sufficient RAM and ROM are used to satisfy most applications .The peripheral
control equipment also had to be satisfied. Therefore, almost all-peripheral chips were
used in the design. Because of these additional peripherals cost will be comparatively
high.
In comparison a typical Micro controller 8051 chip has all that the 8051 board
has except a reduced memory as follows.
4K bytes of ROM as compared to 32-KB, 128 Bytes of RAM as compared to 32-KB.
2 .Bulky:
On comparing a board full of chips (Microprocessors) with one chip with all
components in it (Micro controller) .
3. Debugging:
The heart of the 8051 circuitry that generates the clock pulses by which all the
internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is
provided for connecting a resonant network to form an oscillator. Typically a quartz
crystal and capacitors are employed. The crystal frequency is the basic internal clock
frequency of the microcontroller. The manufacturers make 8051 designs that run at
specific minimum and maximum frequencies typically 1 to 16 MHz.
Indirect Access:
To access the expanded RAM, the EXTRAM bit must be cleared and MOVX
instructions must be used. The extra 768 bytes of memory is physically located on the
chip and logically occupies the first 768 bytes of external memory (addresses 000H to
2FFH). When EXTRAM = 0, the expanded RAM is indirectly addressed using the
MOVX instruction in combination with any of the registers R0, R1 of the selected
bank or DPTR. Accessing the expanded RAM does not affect ports P0, P3.6 (WR),
P3.7
(RD), or P2. With EXTRAM = 0, the expanded RAM can be accessed as in the
following example.
Expanded RAM Access (Indirect Addressing only):
When EXTRAM = 1, MOVX @Ri and MOVX @DPTR will be similar to the
standard 8051. Using MOVX @Ri provides an 8-bit address with multiplexed data on
Port 0. Other output port pins can be used to output higher order address bits. This
provides external paging capabilities. Using MOVX @DPTR generates a 16-bit
address. This allows external addressing up the 64 kB. Port 2 provides the high-order
eight address bits (DPH), and Port 0 multiplexes the low order eight address bits
(DPL) with data. Both MOVX @Ri and MOVX @DPTR generates the necessary
read and write signals (P3.6 - WR and P3.7 - RD) for external memory use. shows
external data memory RD, WR operation with EXTRAM bit. The stack pointer (SP)
can be located anywhere within the 256 bytes of internal RAM (lower 128 bytes and
upper 128 bytes). The stack pointer may not be located in any part of the expanded
RAM.
3.7.3 Special Function registered memory:
Special function registers are the areas of memory that control specific
functionality of the 8051 micro controller.
a) Accumulator (0E0h)
b) B register (0F0h)
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 product gets stored in B register. In div AB the quotient gets stored in B
with the remainder in A.
d) Data pointer
The SFRs DPL and DPH work together work together to represent a 16-bit
value called the data pointer. The data pointer is used in operations regarding
external RAM and some instructions code memory. It is a 16-bit SFR and also an
addressable SFR.
e) Program counter
The program counter is a 16 bit register, which contains the 2 byte address,
which tells the 8051 where the next instruction to execute to be found in memory.
When the 8051 is initialized PC starts at 0000h. And is incremented each time an
instruction is executes. It is not addressable SFR.
The power control SFR is used to control the 8051’s power control modes.
Certain operation modes of the 8051 allow the 8051 to go into a type of “sleep mode
” which consume much lee power.
The timer control SFR is used to configure and modify the way in which the
8051’s two timers operate. This SFR controls whether each of the two timers is
running or stopped and contains a flag to indicate that each timer has overflowed.
Additionally, some non-timer related bits are located in TCON SFR. These bits are
used to configure the way in which the external interrupt flags are activated, which
are set when an external interrupt occurs.
The timer mode SFR is used to configure the mode of operation of each of the
two timers. Using this SFR your program may configure each timer to be a 16-bit
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.
These two SFRs taken together represent timer 0. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up. What is configurable is how and when they increment in value.
These two SFRs, taken together, represent timer 1. Their exact behavior
depends on how the timer is configured in the TMOD SFR; however, these timers
always count up. What is
This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.
This is port latch1. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g.,
bit 0 of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it
to low level
This is a port latch2. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g.,
bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it
to low level.
This is a port latch3. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g.,
bit 0 of port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR
will send a high level on the corresponding I/O pin whereas a value of 0 will bring it
to low level
The Interrupt Enable SFR is used to enable and disable specific interrupts. The
low 7 bits of the SFR are used to enable/disable the specific interrupts, where the
MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of IE is 0
all interrupts are disabled regardless of whether an individual interrupt is enabled by
setting a lower bit.
TXD. The other is read only and holds received data from external sources via RXD.
Both mutually exclusive registers use address 99h.
PORT 0
Port 0 pins may serve as inputs, outputs, or, when used together, as a bi
directional low-order address and data bus for external memory. To configure a pin as
input, 1 must be written into the corresponding port 0 latch by the program. When
used for interfacing with the external memory, the lower byte of address is first sent
via PORT0, latched using Address latch enable (ALE) pulse and then the bus is
turned around to become the data bus for external memory.
PORT 1
Port 1 is exclusively used for input/output operations. PORT 1 pins have no
dual function. When a pin is to be configured as input, 1 is to be written into the
corresponding Port 1 latch.
PORT 2
Port 2 may be used as an input/output port. It may also be used to supply a
high –order address byte in conjunction with Port 0 low-order byte to address external
memory. Port 2 pins are momentarily changed by the address control signals when
supplying the high byte a 16-bit address. Port 2 latches remain stable when external
memory is addressed, as they do not have to be turned around (set to 1) for data input
as in the case for Port 0.
PORT 3
Port 3 may be used to input /output port. The input and output functions can be
programmed under the control of the P3 latches or under the control of various special
function registers. Unlike Port 0 and Port 2, which can have external addressing
functions and change all eight-port b se, each pin of port 3 maybe individually
programmed to be used as I/O or as one of the alternate functions. The Port 3 alternate
uses are:
3.9. INTERRUPTS:
Interrupts are hardware signals that are used to determine conditions that exist
in external and internal circuits. Any interrupt can cause the 8051 to perform a
hardware call to an interrupt –handling subroutine that is located at a predetermined
absolute address in the program memory.
Five interrupts are provided in the 8051. Three of these are generated
automatically by the internal operations: Timer flag 0, Timer Flag 1, and the serial
port interrupt (RI or TI) Two interrupts are triggered by external signals provided by
the circuitry that is connected to the pins INTO 0 and INTO1. The interrupts maybe
enable or disabled, given priority or otherwise controlled by altering the bits in the
Interrupt Enabled (IE) register, Interrupt Priority (IP) register, and the Timer Control
(TCON) register. . These interrupts are mask able i.e. they can be disabled. Reset is a
non maskable interrupt which has the highest priority. It is generated when a high is
applied to the reset pin. Upon reset, the registers are loaded with the default values.
Each interrupt source causes the program to do store the address in PC onto
the stack and causes a hardware call to one of the dedicated addresses in the program
memory. The appropriate memory locations for each for each interrupt are as follows:
Interrupt Address
RESET 0000
IE0 (External interrupt 0) 0003
TF0 (Timer 0 interrupt) 000B
IE1 (External interrupt 1) 0013
TF1 (Timer 1 interrupt) 001B
SERIAL 0023
Functions of micro controller in main unit are
2. Collects the output of ADC for every 10 sec and stores in buffer,
3. Sends command to the modem for dialing the base every 80 sec,
There are two internal flash memory blocks in the device. Block 0 has 64
kbytes and contains the user’s code. Block 1 contains the Philips-provided ISP/IAP
routines and may be enabled such that it overlays the first 8k bytes of the user code
memory. The 64 kB Block 0 is organized as 512 sectors, each sector consists of 128
bytes. Access to the IAP routines may be enabled by clearing the BSEL bit in the FCF
register. However, caution must be taken when dynamically changing the BSEL bit.
Since this will cause different physical memory to be mapped to the logical program
address space, the user must avoid clearing the BSEL bit when executing user code
within the address range 0000H to 1FFFH.
3.10.1.Programming Algorithm:
Before programming the P89V51RD2, the address, data and control signals should be
set up according to the Flash programming mode table. To program the P89V51RD2,
take the following steps.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The
byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1
through 5, changing the address and data for the entire array or until the end of the
object file is reached.
CHAPTER 4
HARDWARE DESCRIPTION
4.1 REGULATED POWER SUPPLY
4.1.1 DESCRIPTION
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 Microcontro.. Fig 4.1
Transformer:
A bridge rectifier coupled with a step down transformer is used for our design.
The voltage rating of transformer used is 0-12V and the current rating is
500mA. When AC voltage of 230V is applied across the primary winding an output
AC voltage of 12V is obtained. One alteration of input causes the top of transformer
to be positive and the bottom negative. The next alteration will temporarily cause the
reverse.
Rectifier:
In the power supply unit, rectification is normally achieved using a solid state
diode. Diode has the property that will let the electron flow easily at one direction at
proper biasing condition. Bridge rectifiers of 4 diodes are used to achieve full wave
rectification. Two diodes will conduct during the negative cycle and the other two will
conduct during the positive half cycle.
Filtering unit:
Regulators:
The voltage regulators play an important role in any power supply unit. The
primary purpose of a regulator is to aid the rectifier and filter circuit in providing a
constant DC voltage to the device. Power supplies without regulators haveinherent
problem of changing DC voltage values due to variations in the load or due to
fluctuations in the AC line voltage. With a regulator connected to DC
output, the voltage can be maintained within a close tolerant region of the desired
output. IC 7805 and 7812 regulators are used in this project for providing a DC
voltage of +5V and +12V respectively.
LM78XX
The LM78XX series is available in an aluminium TO-3 package which will allow
over 1.0A load current if adequate .
Heat sinking is provided. Current limiting is included to limit the peak output current
to a safe value. Safe area protection for the output transistor is provided to limit
internal power dissipation. If internal power dissipation becomes too high for the heat
sinking provided, the thermal shutdown circuit takes cover preventing the IC from
overheating. Considerable effort was expanded to make the LM78XX series of
regulators easy to use and minimize the number of external components. It is not
necessary to bypass the output, although this does improve transient response. Input
bypassing is needed only if the regulator is located far from the filter capacitor of the
power supply. For output voltage other than 5V, 12V and 15V the LM117 Series
provides an output voltage range from 1.2V to 57V.
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
BLOCK DIAGRAM
Fig 4.2
Now the RMS secondary voltage (primary is whatever is consistent with your
area) for our power transformer T1 must be our desired output Vo PLUS the voltage
drops across D2 and D4 ( 2 * 0.7V) divided by 1.414.
This means that Vsec = [13V + 1.4V] / 1.414 which equals about 10.2V.
Depending on the VA rating of your transformer, the secondary voltage will vary
considerably in accordancewith the applied load. The secondary voltage on a
transformer advertised as say 20VA will be much greater if the secondary is only
lightly loaded.
If we accept the 2.5% ripple as adequate for our purposes then at 13V this
becomes 13 * 0.025 = 0.325 Vrms. The peak to peak value is 2.828 times this value.
Vrip = 0.325V X 2.828 = 0.92 V and this value is required to calculate the value of
C1. Also required for this calculation is the time interval for charging pulses. If you
are on a 60Hz system it it 1/ (2 * 60 ) = 0.008333 which is 8.33 milliseconds. For a
50Hz system it is 0.01 sec or 10 milliseconds.
Remember the tolerance of the type of capacitor used here is very loose.
The important thing to be aware of is the voltage rating should be at least 13V X
1.414 or 18.33. Here you would use at least the standard 25V or higher (absolutely not
16V).With our rectifier diodes or bridge they should have a PIV rating of 2.828 times
the Vsec or at least 29V. Don't search for this rating because it doesn't exist. Use the
next highest standard or even higher. The current rating should be at least twice the
load current maximum i.e. 2 X 0.5A or 1A. A good type to use would be 1N4004,
1N4006 or 1N4008 types.
INTRODUCTION:
levels (approx. -10V and +10V) internally. This greatly simplified the design of
circuitry.
Circuitry designers no longer need to design and build a power supply with three
voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply,
e.g. with the help of a simple 78x05 voltage converter.
Capacitor
Capacitor
No. Name Purpose Signal Voltage Value
Value MAX232
MAX232A
+10V, capacitor
output of voltage
2 V+ should stand at 1µF to VCC 100nF to VCC
pump
least 16V
should stand at
pump / inverter
least 16V
The MAX232 has two receivers (converts from RS-232 to TTL voltage
levels) and two drivers (converts from TTL logic to RS-232 voltage levels). This
means only two of the RS-232 signals can be converted in each direction.
Typically a pair of a driver/receiver of the MAX232 is used for TX and RX and the
second one for CTS and RTS.
OPERATING CONDITIONS:
ELECTRICAL CHARACTERISTICS:
4.3 RS232 :
computers with USB support.RS-232 full duplex serial port furnished with a 9 pin D-
type male connector similar to which can be found on back of PC. The port is fully
configured with two data, six control I/O lines and one signal return. Driver provided
for Win98, ME, 2K, XP, Vista, Mac and Linux.
4.3.1 Specifications:
Parameter Value
USB Driver Interface Works with existing COM Port PC applications
(Installs Virtual COM port on PC to which existing
software can connect)
Communication speed 75 to 6MBPS baud
Power consumption 50mA @5volt (power provided by the PC’s USB
port.)
Temperature Range 0ºC to 50ºC.
USB Compliant USB Specification 2.0 compliant; full-speed (12
Mbps)
Asynchronous Serial Data All handshaking and modem interface signals
BUS (UART)
Data formats supported: - Data bits: 5, 6, 7, and 8
- Stop bits: 1, 1.5, and 2
Buffer 256 Byte receive buffer; 256 byte transmit buffer
4.4 IR SENSOR:
The cheapest way to remotely control a device within a visible range is via
Infra-Red light. Almost all audio and video equipment can be controlled this way
nowadays. Due to this wide spread use the required components are quite cheap,
thus making it ideal for us to use IR control for our own projects. Infra-Red actually
is normal light with a particular color. We humans can't see this color because its
wave length of 950nm is below the visible spectrum. That's one of the reasons why
IR is chosen for remote control purposes, we want to use it but we're not interested
in seeing it. Another reason is because IR LED’s are quite easy to make, and
therefore can be very cheap. Fig: 4.7 IR SENSORS
To interface the LCD, to the Micro controller it require an 8 bit and also three
control signals differentiate the data from the control words send to the LCD. The
Micro controller has to send the necessary control words followed by the data to be
displayed.
Depending on the operation to be performed the control words are selected and
passes to the LCD. The data to be displayed on the LCD is to be sent in the ASCII
format. Thus all the character to be displayed are converted into ASCII form and then
sent to the LCD along with different control words. The control word differentiated
the various operations and are executed. It is also possible to read the LCD data if
required.
The control signals to the LCD are also provided by the Micro controller. This is
also done through pins 3.5,3.6&3.7.Through program necessary control signals are
passed to the LCD by using the bits of the port. The remaining can be used for some
other purpose if there is a need. The software controls the necessary ports and
performs the task it is designed for. The soft ware and associated hardware perform
the LCD interface.
LCD DISPLAY
A liquid crystal is a material (normally organic for LCDs) that will flow like a
liquid but whose molecular structure has some properties normally associated with
solids. The Liquid Crystal Display (LCD) is a low power device. The power
requirement is typically in the order of microwatts for the LCD. However, an LCD
requires an external or internal light source. It is limited to a temperature range of
about 0C to 60C and lifetime is an area of concern, because LCDs can chemically
degrade.
1) Dynamic-scattering LCD s
2) Field-effect LCD s
Field-effect LCD s are normally used in such applications where source of energy is a
prime factor (e.g., watches, portable instrumentation etc.).They absorb considerably less
power than the light-scattering type. However, the cost for field-effect units is typically
higher, and their height is limited to 2 inches. On the other hand, light-scattering units are
available up to 8 inches in height. Field-effect LCD is used in the project for displaying the
appropriate information. The turn-on and turn-off time is an important consideration in all
displays. The response time of LCD s is in the range of 100 to 300ms.The lifetime of LCD s
is steadily increasing beyond 10,000+hours limit. Since the colour generated by LCD units is
dependent on the source of illumination, there is a wide range of colour choice.
The same energy is released when an electron recombines with a hole. This released
energy may result in the emission of photon and such a recombination. Hear the
amount of energy released when the electro reverts from the conduction band to the
valence band appears in the form of radiation. Alternatively the released energy may
result in a series of phonons causing lattice vibration. Finally the released energy may
be transferred to another electron. The recombination radiation may be lie in the infra-
red and visible light spectrum. In forward is peaked around the band gap energy and
the phenomenon is called injection luminescence. I n a junction biased in the
avalanche break down region , there results a spectrum of photons carrying much
higher energies . Almost White light then gets emitted from micro-plasma breakdown
region in silicon junction. Diodes having radioactive recombination are termed as
Light Emitting Diode , abbreviated as LEDs.
Photons emitted per carrier. The internal efficiency of GaAs LED may ba very close
to 100% but because of high index of refraction, only a small fraction of the internal
radiation can usually come out of the device surface. In spite of this low efficiency of
actually radiated light , these LEDs are efficiency used as light emitters in visual
display units and in optically coupled circuits, The efficiency of light generation
ECE Department, SITAM 42
AUTONOMOUS ELECTRONIC TOLL GATE USING GPS AND GSM
increases with the increase of injected current and with decreases in temperature.
The light so generated is concentrated near the junction since most of the charge
carriers are obtained within one diffusion length of the diode junction.
GaAs LED produces infra-red light while red, green and orange lights are
produced by gallium arsenide phosphide (GaAs) and gallium phosphide (Gap)
.
INTRODU
Fig 4.9 GPS Module
CTION:
PRODUCT INTRODUCTION:
The ProGin SR-87 series GPS modules incorporates high sensitivity, high
Performance SiRF Star chipset solution in a compact design. The module tracks Up to
20 satellites at a time while offering fast time-to-first-fix and 1Hz navigation Update.
The unit is very suitable for broad applications such as Handheld, PDA, PPC or other
battery operated navigation system.
The SR-87 design utilizes the latest surface mount technology and high level circuit
Integration to achieve superior performance while minimizing dimension and power
consumption. This hardware capability combined with software intelligence makes
the board easy to be integrated and used in all kinds of navigation applications or
products. The module communicates with application system via RS232 (TTL level)
with NMEA-0183 protocol.
ELECTRICAL CHARACTERISTICS:
GENERAL:
SENSITIVITY:
Default WGS-84
ACQUISITION RATE:
DYNAMIC CONDITIONS:
POWER:
RF INTERFACE:
SERIAL PORT:
Default NMEA GGA, GSA, GSV, RMC, (GLL, VTG, and ZDA
Optional).
4800 baud rate (other rate optional).
8 bits data, 1 stop bit, no parity.
TIME:
ENVIRONMENTAL CHARACTERISTICS:
PIN ASSIGNMENT:
4.7.3 APPLICATIONS:
INTRODUCTION TO GSM:
GSM was first introduced in 1991. As of the end of 1997, GSM service was
available in more than 100 countries and has become the de facto standard in Europe
and Asia.
Global System for Mobile communications is the most popular standard for
mobile phones in the world. Its promoter, the GSM Association, estimates that 82% of
the global mobile market uses the standard. GSM is used by over 3 billion people
across more than 212 countries and territories. Its ubiquity makes international
roaming very common between mobile phone modulators, enabling subscribers to use
their phones in many parts of the world. GSM differs from its predecessors in that
both signaling and speech channels, and thus is considered a second generation (2g)
mobile phone system. This has also meant that data communication was easy to build
into the system.
bits per second (bps)—a single on-off pulse of data; eight bits are equivalent
to one byte
hertz (Hz)
kilo (k)—kilo is the designation for 1,000; the abbreviation kbps represents
1,000 bits per second
GSM GPRS Yagi Omni Panel Antenna 2 dBi 3, 5, 10 dBi antenna China Korea
Taiwan Singapore India RFID Tags gprs antenna gsm antenna booster gsm car
antenna GSM gps antenna gsm external antenna gsm antenna gsm enhanced data
rates for enhanced data for gsm enhanced data rate for 900 1800 gsm 900 1800 1900
Gsm900 dual band triple band 1800 MHz dual band gsm1900 gsm1800 antenna tri
band 1900 MHz iden800 dcs1800 tri band pcs1900 gprs gsm850 1900 egsm900 uhf
antennas 1800 900 MHz units wave COM vhf tc35 MHz gsm800 gsm+ frequency
band single band 900 Quad band 900 MHz dcs. A wide variety of Antennas are
available for various models of mobile Phones and different wireless applications.
Please find a brief description of the Different antennas and their applications.
GSM differs from first generation wireless systems in that it uses digital
technology and time division multiple access transmission methods. GSM is a circuit-
switched system that divides each 200 kHz channel into eight 25 kHz time-slots. GSM
supports data transfer speeds of up to 9.6 kbps, allowing the transmission of basic data
services such as SMS (Short Message Service). Another major benefit is its
international roaming capability, allowing users to access the same services when
traveling abroad as at home. GSM satellite roaming has also extended service access to
areas where terrestrial coverage is not available
There are five different cell sizes in a GSM network they are macro,
micro, Pico, femto and umbrella cells. The coverage area of each cell varies according
to the implementation environment. Macro cells can be regarded as cells where the base
station antenna is installed on a mast or a building above average roof top level. Micro
cells are cells whose antenna height is under average roof top level; they are typically
used in urban areas. Pico cells are small cells whose coverage diameter is a few dozen
meters; they are mainly used indoors. Femto cells are cells designed for use in
residential or small business environments and connect to the service provider’s
network via a broadband internet connection. Umbrella cells are used to cover
shadowed regions of smaller cells and fill in gaps in coverage between those cells.
The GSM 07.05 commands are for performing SMS and CBS related
operations.SIM300II supports both text and PDU modes.
Quartz crystals are manufactured for frequencies from a few tens of kilohertz
to tens of megahertz. More than two billion (2×10 9) crystals are manufactured
annually. Most are used for consumer devices such as wristwatches, clocks, radios,
computers, and cell phones. Quartz crystals are also found inside test and
measurement equipment, such as counters, signal generators, and oscilloscopes.
Crystal Reactance
The slope of the reactance against frequency above, shows that the series
reactance at frequency ƒs is inversely proportional to Cs because below ƒs and
above ƒp the crystal appears capacitive, i.e. dX/dƒ, where X is the reactance.
Between frequencies ƒs and ƒp, the crystal appears inductive as the two
parallel capacitances cancel out. The point where the reactance values of the
capacitances and inductance cancel each other out Xc = XL is the fundamental
frequency of the crystal.
We have seen in the previous tutorials, that an amplifier circuit will oscillate if
it has a loop gain greater or equal to one and the feedback is positive. In a Quartz
Crystal Oscillator circuit the oscillator will oscillate at the crystals fundamental
parallel resonant frequency as the crystal always wants to oscillate when a voltage
source is applied to it. However, it is also possible to "tune" a crystal oscillator to any
even harmonic of the fundamental frequency, (2nd, 4th, 8th etc.) and these are known
generally as Harmonic Oscillators while Overtone Oscillators vibrate at odd
multiples of the fundamental frequency, 3rd, 5th, 11th etc). Generally, crystal
oscillators that operate at overtone frequencies do so using their series resonant
frequency.
CHAPTER 5
Software
5.1 *Keil software for c programming
µVision3 adds many new features to the Editor like Text Templates ,Quick Function
Navigation, Syntax Coloring with brace high lighting Configuration Wizard for
dialog based startup and debugger setup. µVision3 is fully compatible to µVision2
and can be used in parallel with µVision2.
What is µVision3?
A project manager.
A make facility.
Tool configuration.
Editor.
A powerful debugger.
To help you get started, several example programs (located in the \C51\Examples, \
C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
HELLO is a simple program that prints the string "Hello World" using the
Serial Interface.
MEASURE is a data acquisition system for analog and digital systems.
TRAFFIC is a traffic light controller with the RTX Tiny operating system.
SIEVE is the SIEVE Benchmark.
DHRY is the Dhrystone Benchmark.
WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each device
architecture.
1. SelectProject-(forexample,166\EXAMPLES\HELLO\HELLO.UV2).
2. Select Project - Rebuild all target files or Build target.
µVision2 compiles, assembles, and links the files in your project.
Project – New Project…. This opens a standard Windows dialog that asks you
We suggest that you use a separate folder for each project. You can simply use
the icon Create New Folder in this dialog to get a new empty folder. Then
select this folder and enter the file name for the new project, i.e. Project1.
µVision2 creates a new project file with the name PROJECT1.UV2 which contains
a default target and file group name. You can see these names in the Project
Window – Files.
Now use from the menu Project – Select Device for Target and select a CPU
for your project. The Select Device dialog box shows the µVision2 device
database. Just select the microcontroller you use. We are using for our examples the
Philips 80C51RD+ CPU. This selection sets necessary tool options for the 80C51RD+
device and simplifies in this way the tool Configuration
Typical, the tool settings under Options – Target are all you need to start a
new application. You may translate all source files and line the application with a
click on the Build Target toolbar icon. When you build an application with syntax
errors, µVision2 will display errors and warning messages in the Output Window –
Build page. A double click on a message line opens the source file on the correct
location in a µVision2 editor window.
Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX
file to download the software into an EPROM programmer or simulator. µVision2
creates HEX files with each build process when Create HEX file under Options for
Target – Output is enabled. You may start your PROM programming utility after the
make process when you specify the program under the option Run User Program #1.
CPU Simulation
Mapped for read, write, or code execution access. The µVision2 simulator traps
In addition to memory mapping, the simulator also provides support for the
of the CPU you have selected are configured from the Device
Database selection
you have made when you create your project target. Refer to page 58 for more
Information about selecting a device . You may select and display the on-chip
peripheral components using the Debug menu. You can also change the aspects of
each peripheral using the controls in the dialog boxes.
Start Debugging
You start the debug mode of µVision2 with the Debug – Start/Stop Debug
configuration, µVision2 will load the application program and run the startup
code µVision2 saves the editor screen layout and restores the screen layout of the last
debug session. If the program execution stops, µVision2 opens an
editor window with the source text or shows CPU instructions in the disassembly
window. The next executable statement is marked with a yellow arrow .During
debugging, most editor features are still available.
For example, you can use the find command or correct program errors. Program
source text of your application is shown in the same windows. The µVision2 debug
mode differs from the edit mode in the following aspects:
Disassembly Window
The Disassembly window shows your target program as mixed source and assembly
program or just assembly code. A trace history of previously executed instructions
may be displayed with Debug – View Trace Records. To enable the trace history, set
Debug – Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step
commands work on CPU instruction level rather than program source lines. You can
select a text line and set or modify code breakpoints using toolbar buttons or the
context menu commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions.
That allows you to correct mistakes or to make temporary changes to the target
program you are debugging.
14. Now double click on the Target1, you would get another option “Source
group 1” as shown in next page.
15. Click on the file option from menu bar and select “new”
16. The next screen will be as shown in next page, and just maximize it by
double clicking on its blue boarder.
18. For a program written in Assembly, then save it with extension “. asm”
and for “C” based program save it with extension “ .C”
19. Now right click on Source group 1 and click on “Add files to Group
Source”
20. Now you will get another window, on which by default “C” files will
appear.
21. Now select as per your file extension given while saving the file
23. Now Press function key F7 to compile. Any error will appear if so happen.
27. Now Click on the Peripherals from menu bar, and check your required port
as shown in fig below
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key “F11” slowly and observe.
PROGRAM
SOURCE CODE
#include<reg51.h>
#include"lcddisplay.h"
#include"UART.h"
#include<string.h>
void readmsg(void);
SBUF=temprature[0];
while(TI==0);
TI=0;
SBUF=temprature[1];
while(TI==0);
TI=0;
SBUF=temprature[2];
while(TI==0);
TI=0;
void another_acc(void)
{
another:
lcdcmd(0x01);
msgdisplay("Insufficient Bal");
lcdcmd(0xc0);
msgdisplay("Try another acc");
delay(50);
gsm=0;
gps=1;
delay(50);
ES=1;
newmsg=0;
while(newmsg==0);
ES=0;
readmsg();
lcdcmd(0x01);
msgdisplay(msg);
delay(500);
ES=1;
if(!strcmp(msg,"ACC 1234"))
{
lcdcmd(0x01);
msgdisplay("Amount dedected");
lcdcmd(0xc0);
msgdisplay("from another acc");
delay(1000);
}
else
{
lcdcmd(0x01);
msgdisplay("Invalid account");
lcdcmd(0xc0);
msgdisplay(" Try again.. ");
goto another;
}
}
void main()
{
unsigned char i,gpsdata[45],msgtype=0;
lcd_init();
UART_init();
lcdcmd(0x85);
gps=1;
gsm=0;
RI=0;
lcdcmd(0x01);
msgdisplay("searching for");
lcdcmd(0xc0);
msgdisplay("GSM modem");
delay(300);
send_to_modem("ate0"); //to avoid echo signals,
enter();
again:
send_to_modem("at"); // TO CHECKING GSM MODEM...
enter();
if(!RI) // Here we are waiting for data whitch is sending by GSM modem
goto again;
RI=0;
EA=1;
ES=1;
delay(100);
send_to_modem("at+creg=0"); //
enter();
delay(300);
newmsg=0;
xxx:
lcdcmd(0x01);
msgdisplay("CHECKING GSM");
send_to_modem("AT+CPIN?"); //
enter();
delay(500);
if(newmsg==0)
goto xxx;
lcdcmd(0xC0);
msgdisplay("GSM CONNECTED");
delay(500);
send_to_modem("at+cmgf=1"); //
enter();
send_to_modem("at+cmgd=1"); //
enter();
send_to_modem("at+cmgd=2"); //
enter();
lcdcmd(0x01);
msgdisplay("store number:");
delay(200);
newmsg=0;
while(newmsg==0);
ES=0;
readmsg();
lcdcmd(0xc0);
msgdisplay(mobilenum);
delay(300);
strcpy(mobilenum1,mobilenum);
delay(700);
lcdcmd(0x01);
st1:
ES=1;
delay(100);
newmsg=0;
ES=0;
gps=0;
gsm=1;
RI=0;
delay(50);
while(1)
{
RI=0;
a=0;
while(a!='$')
{
while(RI==0);
a=SBUF;
RI=0;
}
i=0;
while(RI==0);
i=i+1;
RI=0;
while(RI==0);
RI=0;
i=i+1;
while(RI==0);
if(SBUF=='R')
{
RI=0;
while(RI==0);
i=i+1;
if(SBUF=='M')
{
RI=0;
while(RI==0);
i=i+1;
if(SBUF=='C')
{
RI=0;
while(RI==0);
i=i+1;
while(i<43)
{
while(RI==0);
gpsdata[i]=SBUF;
RI=0;
i++;
}
lcdcmd(0x01);
msgdisplay("LT ");
for(i=19;i<30;i++)
{
lcddata(gpsdata[i]);
lcdcmd(0xc0);
msgdisplay("LG ");
for(i=31;i<43;i++)
{
lcddata(gpsdata[i]);
delay(50);
if(toll1==1)
{
if(balance<10)
another_acc();
else
balance=balance-10;
lcdcmd(0x01);
msgdisplay("Toll_1 tax paid");
lcdcmd(0xc0);
msgdisplay("Paid Rs. 10/-");
msgtype=1;
goto sendmsg;
}
if(toll2==1)
{
if(balance<20)
another_acc();
else
balance=balance-20;
lcdcmd(0x01);
msgdisplay("Toll_2 tax paid");
lcdcmd(0xc0);
msgdisplay("Paid Rs. 20/-");
msgtype=2;
goto sendmsg;
}
if(toll3==1)
{
if(balance<30)
another_acc();
else
balance=balance-30;
lcdcmd(0x01);
msgdisplay("Toll_3 tax paid");
lcdcmd(0xc0);
msgdisplay("Paid Rs. 30/-");
msgtype=3;
goto sendmsg;
if(toll4==1)
{
if(balance<40)
another_acc();
else
balance=balance-40;
lcdcmd(0x01);
msgdisplay("Toll_4 tax paid");
lcdcmd(0xc0);
msgdisplay("Paid Rs. 40/-");
msgtype=4;
goto sendmsg;
}
lcdcmd(0x01);
}
}
}
}
sendmsg:
delay(500);
gsm=0;
gps=1;
delay(50);
buzzer=0;
lcdcmd(0x01);
msgdisplay("sending message");
send_to_modem("at+cmgs=");
ch_send_to_modem('"');
send_to_modem(mobilenum1);
ch_send_to_modem('"');
enter();
delay(100);
if(msgtype==1)
{
send_to_modem("Toll Gate 1 tax paid Rs. 10/- at ");
}
if(msgtype==2)
{
send_to_modem("Toll Gate 2 tax paid Rs. 20/- at ");
}
if(msgtype==3)
{
send_to_modem("Toll Gate 3 tax paid Rs. 30/- at ");
}
if(msgtype==4)
{
send_to_modem("Toll Gate 4 tax paid Rs. 40/- at ");
}
send_to_modem("LT:");
for(i=19;i<30;i++)
ch_send_to_modem(gpsdata[i]);
send_to_modem(" LG:");
for(i=31;i<43;i++)
ch_send_to_modem(gpsdata[i]);
ch_send_to_modem(0x1a);
ES=1;
delay(3000);
lcdcmd(0x01);
msgdisplay("MESSAGE SENT");
buzzer=1;
delay(2500);
lcdcmd(0x01);
goto st1;
void readmsg(void)
{
unsigned char ss=1,a,b,i,count,numcnt;
delay(100);
ES=1;
delay(200);
ES=0;
while(RI==1)
{
RI=0;
delay(100);
}
send_to_modem("at+cmgr=1");
enter();
count=0;
i=0;
a=0;
numcnt=0;
while(count!=3)
{
while(RI==0);
b=SBUF;
if((b=='O')&&(ss==1))
{
ss=0;
strcpy(msg,"NO MESSAGE !!");
goto down;
}
if((b==',')||(a==1))
{
ss=0;
if(numcnt<15)
{
if(numcnt>4)
{
mobilenum[numcnt-5]=b;
}
a=1;
numcnt++;
}
else
a=0;
}
if(count==2)
{
msg[i++]=SBUF;
}
RI=0;
if(b==10)
count+=1;
}
msg[--i]='\0';
msg[--i]='\0';
mobilenum[10]='\0';
down:
send_to_modem("at+cmgd=1");
enter();
delay(500);
send_to_modem("at+cmgd=2"); //delete the message1
enter();
ss=1;
CONCLUSION
Finally, we would co include by saying that, this project “AUTONOMOUS
ELECTRONIC TOLL GATE USIG GSM AND GPS” is an automatic process which
is unmanned,
The first GPS based system advantage is absence of the need for new road
infrastructure (gantries), operators can keep using the existing infrastructure. System
works without toll booths, extra lanes, speed restrictions or complex structures along
toll roads. The second is much greater flexibility in defining or changing payment by
simply redefining the "virtual" toll areas. It means ability to adapt easily and quickly
to changes in charge parameters (road classes, vehicle types, emission levels, times
slots etc). The third is the systems ability to support other value-added services on the
same technology platform. These services might include fleet and vehicle engine
management systems, emergency response services, payas- you-drive insurance
services and navigation capabilities. These systems were implemented in the
Germany and Hong Kong and will be implemented in UK, India, USA, China, and
Australia. With regard to future expansion and development, this satellite-based toll
collection system will be a better solution, especially with regard to flexibility when it
comes to extending toll collection to every road category, every category of vehicle
and, what's more, in terms of cost efficiency in implementation and operation.
FUTURE SCOPE
A new class of electronic toll collection mechanism will arise which will be an
extension to the present GPS AND GSM based electronic toll collection in which
additional features like, automatic engine engage and shut down mechanism’s, will be
implemented in which any vehicle which violates or is unauthorised under the
aspects of rules and regulations of the concerned authority can be controlled remotely
REFERENCE