Upload
sampath-kumar-bejgama
View
222
Download
0
Embed Size (px)
Citation preview
7/29/2019 Traffic light control using RFID
1/36
1
1. EMBEDDED SYSTEMS
Introduction:
An embedded system can be defined as a computing device that does a specific
focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer,fax machines, mobile phone etc. are examples of embedded systems. Each of these
appliances will have a processor and special hardware to meet the specific requirement
of the application along with the embedded software that is executed by the processor
for meeting the specific requirement, the embedded software is also called firm
ware. The desktop/laptop computer is a general purpose computer. You can use it for
a variety of applications such as playing games, word processing, accounting, software
development and so on. In contrast, the software in the embedded systems is always
fixed listed below:
Embedded systems do a very specific task; they cannot be programmed to do
things. Embedded systems have very limited resources, particularly the memory.
Generally, they do not have secondary storage devices such as the CDROM pr the
floppy disk. Embedded systems have to work against some deadlines. A specific job
has to be completed within a specific time. In some embedded systems, called real-
time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-
loss of life or damage to property. Embedded systems are constrained for power, as
many embedded systems operate through a battery; the power consumption has to be
very low.
Some embedded systems have to operate in extreme environmental conditions
such as very high temperatures and humidity.
1.1 ARCHITECTURE
Let us see the details of the various building blocks of the hardware of an
embedded system. As shown in fig 1.2.1 the building blocks are;
Central Processing Unit (CPU)
Memory (Read-Only Memory and Random Access Memory)
Input Devices
7/29/2019 Traffic light control using RFID
2/36
2
Output Devices
Communication Interfaces
Application-specific Circuitry
Fig 1.1.1: Block Diagram of Hardware of Embedded System
1.1.1 Central Processing Unit (CPU):
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
microcontroller 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.
7/29/2019 Traffic light control using RFID
3/36
3
1.1.2 Memory:
The memory is categorized as Random Access Memory (RAM) and Read
Only Memory (ROM), the contents of the RAM will be erased if the power is
switched off. So, the firmware is stored in the ROM. When power is switched
on, the processor reads the ROM; the program is executed.
1.1.3 Input Devices:
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 nay be
used to input only the digits. Many embedded systems used in process control do
not have any input device for user interaction.
1.1.4 Output Devices:
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 be used to display some
more important parameters.1.1.5 Communication Interfaces:
The embedded systems may need to interact with other embedded system
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, Rs 485, Universal Serial Bus (USB), and IEEE 1394, Ethernet etc.
1.1.6 Application-specific Circuitry:
Sensors, transducers, special processing and control circuitry may berequired for an embedded system, depending on its application. This circuitry
interacts with the processor to carry out the necessary work. The entire hardware
has to be given power supply either through the 230 volts main supply or through
a battery. The hardware ha to design in such a way that the power consumption is
minimized.
7/29/2019 Traffic light control using RFID
4/36
4
1.2 APPLICATION AREAS
Nearly 99 percent of the processors manufactured end up in the embedded
systems. The embedded system market is one of the highest growth areas as the
systems are used in every market segment-
Consumer electronics,
Offline automation,
Industrial automation,
Biomedical engineering,
Wireless communication,
Data communication,
Telecommunications, and
Transportation,
Military.
7/29/2019 Traffic light control using RFID
5/36
5
2. MODULES OF THE PROJECT
2.1 MICROCONTROLLERS
Microprocessors are single-chip CPUs used in microcomputers.
Microcontrollers and microprocessors are different in three main aspects: hardware
architecture, applications, and instruction set features.
Hardware architecture: A microprocessor is a single chip CPU while a microcontroller
is a single IC contains a CPU and much of remaining circuitry of a complete computer
(e.g., RAM, ROM, serial interface, parallel interface, timer, and interrupt handling
circuit).
Applications: Microprocessors are commonly used as a CPU in computers while
microcontrollers are found in small, minimum component designs performing control
oriented activities.
Microprocessor instruction sets are processing Intensive.
Their instructions operate on nibbles, bytes, words, or even double words.
Addressing modes provide access to large arrays of data using pointers and offsets.
They have instructions to set and clear individual bits and perform bit operations.
They have instructions for input/output operations, event timing, enabling and setting
priority levels for interrupts caused by external stimuli.
Processing power of a microcontroller is much less than a microprocessor.
Difference between 8051 and 8052:
The 8052 microcontroller is the 8051's "big brother." It is a slightly more
powerful microcontroller, sporting a number of additional features which the developer
may make use of:
256 bytes of Internal RAM (compared to 128 in the standard 8051) and it is
having 8k bytes of ROM.
A third 16-bit timer, capable of a number of new operation modes and 16-bit
reloads.
Additional SFRs to support the functionality offered by the third timer.
7/29/2019 Traffic light control using RFID
6/36
6
2.1.1 AT89s52FEATURES:
Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory
Endurance: 1000 Write/Erase Cycles
4.0V to 5.5V Operating Range
Fully Static Operation: 0 Hz to 33 MHz
Three-level Program Memory Lock
256K Internal RAM
32 Programmable I/O Lines
3 16-bit Timer/Counters
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Watchdog Timer
Dual Data Pointer
Power-off Flag
2.1.2 DESCRIPTION OF MICROCONTROLLER 89S52:
The AT89S52 is a low-power, high-performance CMOS 8-bit micro
controller with 8Kbytes of in-system programmable Flash memory. The
device is manufactured
Using Atmels high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 micro controller. The on-chip
Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bitCPU with in-system programmable flash one monolithic chip; the Atmel
AT89S52 is a powerful micro controller, which provides a highly flexible and
cost-effective solution to many embedded control applications.
7/29/2019 Traffic light control using RFID
7/36
7
The AT89S52 provides the following standard features:
8K bytes of Flash,
256 bytes of RAM,
32 I/O lines,
Watchdog timer,
Two data pointers,
Three 16-bit timer/counters,
Full duplex serial port,
On-chip oscillator, and
Clock circuitry
In addition, the AT89S52 is designed with static logic for operation
down to zero frequency and supports two software selectable power
saving modes.
The Idle Mode stops the CPU while allowing the RAM
timer/counters, serial port, and interrupt system to continue
functioning.
The Power-down mode saves the RAM contents but freezes the
oscillator, disabling all other chip functions until the next interrupt or
hardware reset.
7/29/2019 Traffic light control using RFID
8/36
8
2.1.3 89s52 ARCHITECTURE:
Fig 2.1.1: 89s52 Architecture
7/29/2019 Traffic light control using RFID
9/36
9
Fig 2.1.2: Pin Diagram of 89s52
PIN DESCRIPTION OF MICROCONTROLLER 89S52:
VCC
Supply voltage.
GND
Ground
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin
can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used ashigh impedance inputs. Port 0 can 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
7/29/2019 Traffic light control using RFID
10/36
10
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. 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. 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 the following table.
Port 1 also receives the low-order address bytes during Flash programming and
verification.
Table 2.1.1: PORT1 of 89s52
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. 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, Port 2 uses strong internal pull-ups when emitting 1s. During
accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port
2emits 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.
7/29/2019 Traffic light control using RFID
11/36
11
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 AT89S52, as shown in the
following table.
Port 3 also receives some control signals for Flash programming and
verification.
Table 2.1.2:PORT3 of 89s52
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 (ALE) is an 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 of1/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 micro controller is in external execution mode.
7/29/2019 Traffic light control using RFID
12/36
12
PSEN:
Program Store Enable (PSEN) 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. A should be strapped to VCC for internal program executions. This
pin also receives the 12-voltProgramming enables voltage (VPP) during Flash
programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier that can be configured for use as an on-chip oscillator, 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.
Fig 2.1.3: Oscillator Connection
7/29/2019 Traffic light control using RFID
13/36
13
2.2 POWER SUPPLY:
Power supply is a reference to a source of electrical power. A device or system
that supplies electrical or other types of energy to an output load or group of loads is
called a power supply unit or PSU. The term is most commonly applied to electricalenergy supplies, less often to mechanical ones, and rarely to others
This power supply section is required to convert AC signal to DC signal and also
to reduce the amplitude of the signal. The available voltage signal from the mains is
230V/50Hz which is an AC voltage, but the required is DC voltage (no frequency) with
the amplitude of +5V and +12V for various applications.
In this section we have Transformer, Bridge rectifier, are connected serially and
voltage regulators for +5V and +12V (7805 and 7812) via a capacitor (1000F) in
parallel are connected parallel as shown in the circuit diagram below.
Each voltage regulator output is again is connected to the capacitors of values
(100F, 10F, 1 F, 0.1 F) are connected parallel through which the corresponding
output (+5V or +12V) are taken into consideration.
Fig 2.2.1: Power Supply
7/29/2019 Traffic light control using RFID
14/36
14
2.2.1 Circuit Explanation:
Transformer:
A transformer is a device that transfers electrical energy from one circuit to
another through inductively coupled electrical conductors. A changing current in the
first circuit (the primary) creates a changing magnetic field; in turn, this magnetic field
induces a changing voltage in the second circuit (the secondary). By adding a load to
the secondary circuit, one can make current flow in the transformer, thus transferring
energy from one circuit to the other.
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:
Basic principle
The transformer is based on two principles: firstly, that an electric current can
produce a magnetic field (electromagnetism) and secondly that a changing magnetic field
within a coil of wire induces a voltage across the ends of the coil (electromagnetic
induction). By changing the current in the primary coil, it changes the strength of itsmagnetic field; since the changing magnetic field extends into the secondary coil, a
voltage is induced across the secondary.
A simplified transformer design is shown below. A current passing through the
primary coil creates a magnetic field. The primary and secondary coils are wrapped
around a core of very high magnetic permeability, such as iron; this ensures that most of
the magnetic field lines produced by the primary current are within the iron and pass
through the secondary coil as well as the primary coil.
7/29/2019 Traffic light control using RFID
15/36
15
Fig 2.2.2: An ideal step-down transformer showing magnetic flux in the core
Induction law
The voltage induced across the secondary coil may be calculated from Faraday's
law of induction, which states that:
Where VS is the instantaneous voltage, NS is the number of turns in the secondary
coil and equals the magnetic flux through one turn of the coil. If the turns of the coil
are oriented perpendicular to the magnetic field lines, the flux is the product of the
magnetic field strength B and the area A through which it cuts. The area is constant,
being equal to the cross-sectional area of the transformer core, whereas the magnetic field
varies with time according to the excitation of the primary. Since the same magnetic flux
passes through both the primary and secondary coils in an ideal transformer, the
instantaneous voltage across the primary winding equals
Taking the ratio of the two equations forVS and VP gives the basic equationfor
stepping up or stepping down the voltage
7/29/2019 Traffic light control using RFID
16/36
16
Ideal power equation
If the secondary coil is attached to a load that allows current to flow, electrical
power is transmitted from the primary circuit to the secondary circuit. Ideally, the
transformer is perfectly efficient; all the incoming energy is transformed from the
primary circuit to the magnetic field and into the secondary circuit. If this condition is
met, the incoming electric power must equal the outgoing power.
Pincoming = IPVP = Poutgoing = ISVS
giving the ideal transformer equation
Pin-coming = IPVP = Pout-going = ISVS
giving the ideal transformer equation
Bridge Rectifier
A diode bridge or bridge rectifier is an arrangement of four diodes in a bridge
configuration that provides the same polarity of output voltage for any polarity of input
voltage. When used in its most common application, for conversion of alternating current
(AC) input into direct current (DC) output, it is known as a bridge rectifier. A bridge
rectifier provides full-wave rectification from a two-wire AC input, resulting in lower
7/29/2019 Traffic light control using RFID
17/36
17
cost and weight as compared to a center-tapped transformer design, but has two diode
drops rather than one, thus exhibiting reduced efficiency over a center-tapped design for
the same output voltage.
Basic Operation
When the input connected at the left corner of the diamond is positive with
respect to the one connected at the right hand corner, current flows to the right along the
upper colored path to the output, and returns to the input supply via the lower one.
When the right hand corner is positive relative to the left hand corner, current
flows along the upper colored path and returns to the supply via the lower colored path.
In each case, the upper right output remains positive with respect to the lower
right one. Since this is true whether the input is AC or DC, this circuit not only produces
DC power when supplied with AC power: it also can provide what is sometimes called
"reverse polarity protection". That is, it permits normal functioning when batteries are
installed backwards or DC input-power supply wiring "has its wires crossed" (and
7/29/2019 Traffic light control using RFID
18/36
18
protects the circuitry it powers against damage that might occur without this circuit in
place).
Prior to availability of integrated electronics, such a bridge rectifier was always
constructed from discrete components. Since about 1950, a single four-terminal
component containing the four diodes connected in the bridge configuration became a
standard commercial component and is now available with various voltage and current
ratings.
Output smoothing (Using Capacitor)
For many applications, especially with single phase AC where the full-wave
bridge serves to convert an AC input into a DC output, the addition of a capacitor may be
important because the bridge alone supplies an output voltage of fixed polarity but
pulsating magnitude (see diagram above).
7/29/2019 Traffic light control using RFID
19/36
19
The function of this capacitor, known as a reservoir capacitor (aka smoothing
capacitor) is to lessen the variation in (or 'smooth') the rectified AC output voltage
waveform from the bridge. One explanation of 'smoothing' is that the capacitor provides a
low impedance path to the AC component of the output, reducing the AC voltage across,
and AC current through, the resistive load. In less technical terms, any drop in the output
voltage and current of the bridge tends to be cancelled by loss of charge in the capacitor.
This charge flows out as additional current through the load. Thus the change of
load current and voltage is reduced relative to what would occur without the capacitor.
Increases of voltage correspondingly store excess charge in the capacitor, thus
moderating the change in output voltage / current. Also see rectifier output smoothing.
The simplified circuit shown has a well deserved reputation for being dangerous,
because, in some applications, the capacitor can retain a lethalcharge after the AC power
source is removed. If supplying a dangerous voltage, a practical circuit should include a
reliable way to safely discharge the capacitor. If the normal load cannot be guaranteed to
perform this function, perhaps because it can be disconnected, the circuit should include a
bleeder resistor connected as close as practical across the capacitor. This resistor should
consume a current large enough to discharge the capacitor in a reasonable time, but smallenough to avoid unnecessary power waste.
Because a bleeder sets a minimum current drain, the regulation of the circuit,
defined as percentage voltage change from minimum to maximum load, is improved.
designs, a series resistor at the load side of the capacitor is added. The smoothing can
then be improved by adding additional stages of capacitorresistor pairs, often done only
7/29/2019 Traffic light control using RFID
20/36
20
for sub-supplies to critical high-gain circuits that tend to be sensitive to supply voltage
noise.
The idealized waveforms shown above are seen for both voltage and current when
the load on the bridge is resistive. When the load includes a smoothing capacitor, both the
voltage and the current waveforms will be greatly changed. While the voltage is
smoothed, as described above, current will flow through the bridge only during the time
when the input voltage is greater than the capacitor voltage. For example, if the load
draws an average current of n Amps, and the diodes conduct for 10% of the time, the
average diode current during conduction must be 10n Amps. This non-sinusoidal current
leads to harmonic distortion and a poor power factor in the AC supply.
In a practical circuit, when a capacitor is directly connected to the output of a
bridge, the bridge diodes must be sized to withstand the current surge that occurs when
the power is turned on at the peak of the AC voltage and the capacitor is fully discharged.
Sometimes a small series resistor is included before the capacitor to limit this current,
though in most applications the power supply transformer's resistance is already
sufficient.
Output can also be smoothed using a choke and second capacitor. The choke
tends to keep the current (rather than the voltage) more constant. Due to the relatively
high cost of an effective choke compared to a resistor and capacitor this is not employed
in modern equipment.
Some early console radios created the speaker's constant field with the current
from the high voltage ("B +") power supply, which was then routed to the consuming
circuits, (permanent magnets were considered too weak for good performance) to create
the speaker's constant magnetic field. The speaker field coil thus performed 2 jobs in one:
it acted as a choke, filtering the power supply, and it produced the magnetic field to
operate the speaker.
Voltage Regulator
A voltage regulator is an electrical regulator designed to automatically maintain a
constant voltage level.
The 78xx (also sometimes known as LM78xx) series of devices is a family of
self-contained fixed linear voltage regulator integrated circuits. The 78xx family is a very
7/29/2019 Traffic light control using RFID
21/36
21
popular choice for many electronic circuits which require a regulated power supply, due
to their ease of use and relative cheapness. When specifying individual ICs within this
family, the xx is replaced with a two-digit number, which indicates the output voltage the
particular device is designed to provide (for example, the 7805 has a 5 volt output, while
the 7812 produces 12 volts). The 78xx line is positive voltage regulators, meaning that
they are designed to produce a voltage that is positive relative to a common ground.
There is a related line of 79xx devices which are complementary negative voltage
regulators. 78xx and 79xx ICs can be used in combination to provide both positive and
negative supply voltages in the same circuit, if necessary.
Fig 2.2.3: Internal Block Diagram of Voltage Regulator
78xx ICs have three terminals and are most commonly found in the TO220 form
factor, although smaller surface-mount and larger TrO3 packages are also available from
some manufacturers. These devices typically support an input voltage which can be
anywhere from a couple of volts over the intended output voltage, up to a maximum of
35 or 40 volts, and can typically provide up to around 1 or 1.5 amps of current (though
smaller or larger packages may have a lower or higher current rating).
7/29/2019 Traffic light control using RFID
22/36
22
2.3 RF MODULE:
The RF module, as the name suggests, operates at Radio Frequency. The
corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the
digital data is represented as variations in the amplitude of carrier wave. This kind of
modulation is known as Amplitude Shift Keying (ASK). Transmission through RF is
better than IR (infrared) because of many reasons. Firstly, signals through RF can travel
through larger distances making it suitable for long range applications. Also, while IR
mostly operates in line-of-sight mode, RF signals can travel even when there is an
obstruction between transmitter & receiver. Next, RF transmission is more strong and
reliable than IR transmission. RF communication uses a specific frequency unlike IR
signals which are affected by other IR emitting sources. This RF module comprises of anRF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a
frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly
through RF through its antenna connected at pin4. The transmission occurs at the rate of
1Kbps - 10Kbps. The transmitted data is received by an RF receiver operating at the same
frequency as that of the transmitter. The RF module is often used along with a pair of
encoder/decoder. The encoder is used for encoding parallel data for transmission feed
while reception is decoded by a decoder. HT12E-HT12D, HT640-HT648, etc. are some
commonly used encoder/decoder pair ICs.
Fig 2.3.1: HT12E & HT12D Pin Diagram
7/29/2019 Traffic light control using RFID
23/36
23
2.3.1 RF Transmitter:
An RF transmitter generates radio frequency waves in its circuits, and to this
'carrier signal', it adds the information part by modulating the carrier signal. This
composite signal (carrier plus information) is then fed to an antenna (aerial). The aerialinduces a corresponding signal into the atmosphere, by altering the Electric and Magnetic
fields at (obviously) the same frequency. The impedance of 'free space' is few tens of
Ohms to a few hundreds of Ohms. [Impedance may be considered analogous to
resistance, but with reactive properties as well.] The power emitted by the transmitter can
vary from a megawatt or so (for VLF signals) to a few watts for handheld devices.
Fig 2.3.2: RF transmitter image
Fig 2.3.3: Pin Diagram
7/29/2019 Traffic light control using RFID
24/36
24
Pin Description:
Pin
No Function Name1
Ground (0V)
Ground
2 Serial data input pin Data3 Supply voltage; 5V Vcc4 Antenna output pin ANT
Table 2.3.1: Pin Description of RF Transmitter
2.3.2 RF receiver:
An RF receiver receives the signal from the atmosphere, from its own aerial.
The receiver aerial is often quite simple, and the signal level is typically of a few microvolts. This it tunes in (gets rid of unwanted signals and amplifies only the wanted ones).
The receiver circuits then strip the information part of the signal from the carrier part, and
amplify this to a useful level for audio or video. The actual signal into the loudspeaker
will be a few tens of volts. In spite of the inefficiency of loudspeakers, (often only a few
%) the signal eventually appears at a level that may be heard. A background radio will be
a few mill watts of power. Even a very loud sound is only a few watts of radiated (sound)
energy!!
Fig 2.3.4: RF Receiver Image
7/29/2019 Traffic light control using RFID
25/36
25
Fig 2.3.5: Pin Diagram
Pin
No Function Name1 Ground (0V) Ground2 Serial data output pin Data3 Linear output pin; not connected NC4 Supply voltage; 5V Vcc5 Supply voltage; 5V Vcc6 Ground (0V) Ground7 Ground (0V) Ground8 Antenna input pin ANT
Table 2.3.2: Pin Description of RF Receiver
2.4 BUZZER:
A buzzer orbeeper is a signaling device, usually electronic, typically used in
automobiles, household appliances such as a microwave oven, or game shows.
It most commonly consists of a number of switches or sensors connected to a
control unit that determines if and which button was pushed or a preset time has lapsed,
and usually illuminates a light on the appropriate button or control panel, and sounds a
warning in the form of a continuous or intermittent buzzing or beeping sound. Initiallythis device was based on an electromechanical system which was identical to an electric
bell without the metal gong. Often these units were anchored to a wall or ceiling and used
the ceiling or wall as a sounding board. Another implementation with some AC-
connected devices was to implement a circuit to make the AC current into a noise loud
enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker.
7/29/2019 Traffic light control using RFID
26/36
26
Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a Son
alert which makes a high-pitched tone. Usually these were hooked up to "driver" circuits
which varied the pitch of the sound or pulse the sound on and off.
In game shows it is also known as a "lockout system," because when one person
signals ("buzzes in"), all others are locked out from signaling. Several game shows have
large buzzer buttons which are identified as "plungers".
The word "buzzer" comes from the rasping noise that buzzers made when they
were electromechanical devices, operated from stepped-down AC line voltage at 50 or 60
cycles. Other sounds commonly used to indicate that a button has been pressed are a ring
or a beep.
Fig 2.4.1: An Electronic Buzzer
7/29/2019 Traffic light control using RFID
27/36
27
3. PROJECT IMPLEMENTATION:
3.1 BLOCK DIAGRAM:
Ambulance:
Traffic Post:
Fig 3.1.1: Block Diagram
7/29/2019 Traffic light control using RFID
28/36
28
3.2 CIRCUIT DIAGRAM:
Fig 3.2.1: RF Transmitter
Fig 3.2.2: RF Receiver
7/29/2019 Traffic light control using RFID
29/36
29
3.3 PROJECT DESCRIPTION
Traffic jams is one of the major problems most cities around the world face,
especially in developing regions. Everyday many citizens spend hours stuck in traffic in
the city to commute to their work place or school. As a result, this is beginning to become
a complex problem to most countries.
Often the ambulances get stuck at the traffic signals where all other vehicles try to
squeeze in to all the available space so as to move ahead as soon as the signal turns green.
Unlike western countries, Indian cities cannot think of having separate lanes for
emergency purpose because the roads are not broad enough in absence of any specific
guidelines the drivers of ambulance tend to steer the vehicle from whichever side they
find it convenient.
So, here we came up with a project which solves this problem. In our project we
avoid red light in the way of ambulance. Here we use RF technology to transmit an
emergency signal to the traffic post from the ambulance and there by the ambulance can
pass the signals easily without waiting.
We have a RF transmitter in the ambulance, which sends out RF signals at a
frequency of 434 MHz as a sign of emergency. These signals are received by the RF
receiver in the traffic signal post and then the microcontroller analyzes it and thereby
sends signals to glow the respective LED.
7/29/2019 Traffic light control using RFID
30/36
30
3.4 MICROCONTROLLER CODE
#include
#include
sbit rf1=P2^0;
sbit rf2=P2^1;
sbit rf3=P2^2;
sbit rf4=P2^3;
sbit g1=P3^4;
sbit g2=P3^5;
sbit g3=P3^6;
sbit g4=P3^7;
void delay(unsigned int value);
//**********************************************************************
//**************************** MAIN PROGRAM**************************
//**********************************************************************
void main()
{
g1=g2=g3=g4=0;
g1=g2=g3=g4=1;
while(rf1==0 || rf2==0 || rf3==0 || rf4==0);
while(1)
{
if(rf1==0)
{
while(rf1==0 || rf2==0 || rf3==0 || rf4==0);
if(g2==1 && g3==1 && g4==1){
g1=~g1;
}
}
if(rf2==0)
7/29/2019 Traffic light control using RFID
31/36
31
{
while(rf1==0 || rf2==0 || rf3==0 || rf4==0);
if(g3==1 && g1==1 && g4==1)
{
g2=~g2;
}
}
if(rf3==0)
{
while(rf1==0 || rf2==0 || rf3==0 || rf4==0);
if(g2==1 && g1==1 && g4==1)
{
g3=~g3;
}
}
if(rf4==0)
{
while(rf1==0 || rf2==0 || rf3==0 || rf4==0);
if(g2==1 && g3==1 && g1==1)
{
g4=~g4;
}
}
}
}
void delay(unsigned int value)
{
int x,y;
for(x=0;x
7/29/2019 Traffic light control using RFID
32/36
32
3.5 ADVANTAGES:
The major advantage of this project is that it solves the traffic problem faced by the
emergency vehicles.
This is of low cost and can be easily installed. It is very useful in developing countries where separate lane is not provided for
emergency vehicles.
This doesnt require complex circuitry and not many complex changes are to be made
in the traffic system to install as it doesnt disturb the regular run of the system.
3.6 DISADAVNTAGES:
This project uses RF technology and this brings the major limitation.
Most RF modules work with a same frequency and hence only one RF module can
work in a location.
3.7 APPLICATIONS:
This is useful in:
Emergency cases to pass through the traffic.
Where automated traffic signal is used rather than manual signaling. In cities where the traffic is high.
7/29/2019 Traffic light control using RFID
33/36
33
3.8 RESULT:
Intelligent ambulance kit when power supply is not given,
Fig 3.8.1: Intelligent ambulance kit when no power supply is given
When power supply is given the LED in the power supply circuit glows indicatingthe 5V input,
Fig 3.8.2: Intelligent ambulance kit when power supply is provided
7/29/2019 Traffic light control using RFID
34/36
34
The power supply circuit in the kit containing components from transformer to
filter
Fig 3.8.3: Power Supply Circuit
RF remote control containing battery and encoder with an antenna,
Fig 3.8.4: RF Transmitter
7/29/2019 Traffic light control using RFID
35/36
35
RF receiver containing receiver part with HT12D decoder,green LED indicates
availability of RF transmitter in the range of reception,
Fig 3.8.5: RF Receiver
7/29/2019 Traffic light control using RFID
36/36
4. CONCLUSIONThe project Intelligent ambulance for City traffic Police has been
successfully designed and tested. Integrating the features of all the hardware components
we have developed this project. Presence of every module has been reasoned out and
placed carefully thus contributing to the best working of the unit.
Secondly, using highly advanced ICs and with the help of growing technology
the project has been successfully implemented.