Sunteți pe pagina 1din 44

AUTOMATIC

TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING


TRAFFIC RULES

1. ABSTRACT:
Traffic control is a very difficult task for traffic control department,
especially in metro cities. This project is designed to control a camera,
whenever a vehicle breaks the traffic rules. Using IR sensor, the vehicles are
monitored with reference to the traffic light indicators. Whenever a RED light
is ON, the IR LED transmitter and receiver pair also will be ON. If a vehicle
exceeds the control line on the road, after RED light is on, the microcontroller
switches on a camera, and the images are stored in Windows Media Video
file (wmv) format.
The authority can monitor the video images on any computer for issuing eChelan. A buzzer is provided for audio acknowledgment of camera record ON.
Whenever a vehicle exceeds the control line on RED signal, the system
acknowledges it by a short beep sound. This buzzer is driven by a PNP
transistor.
This project is designed with AT89S52 MCU. A 16 X 2 LCD is provided to
display the camera condition. In this project only one camera is interfaced, for
one route out of four routs of a signal point.
This project uses regulated 5V, 500mA power supply. 7805 three terminal
voltage regulator is used for voltage regulation. Bridge type full wave rectifier
is used to rectify the ac out put of secondary of 230/12V step down
transformer.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

2: INTRODUCTION

Traffic on roads may

consist

of pedestrians,

ridden

or

herded animals, vehicles, streetcars and other conveyances, either singly or


together, while using the public way for purposes of travel .Traffic laws are
the laws which govern traffic and regulate vehicles, while rules of the
road are both the laws and the informal rules that may have developed over
time to facilitate the orderly and timely flow of traffic.

Organized traffic generally has well-established priorities, lanes, right-of-way,


and traffic control at intersections. Traffic is formally organized in many
jurisdictions, with marked lanes, junctions, intersections, interchanges, traffic
signals, or signs. Traffic is often classified by type: heavy motor vehicle (e.g.,
car, truck); other vehicle (e.g., moped, bicycle); and pedestrian. Different
classes may share speed limits and easement, or may be segregated. Some
jurisdictions may have very detailed and complex rules of the road while
others rely more on drivers' common sense and willingness to cooperate.

Organization typically produces a better combination of travel safety and


efficiency. Events which disrupt the flow and may cause traffic to degenerate
into a disorganized mess include: road construction, collisions and debris in
the roadway. On particularly busy freeways, a minor disruption may persist in
a phenomenon known as traffic waves. A complete breakdown of organization
may result in traffic jams and gridlock. Simulations of organized traffic
frequently

involve queuing

theory, stochastic

processes and

equations

of mathematical physics applied to traffic flow.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
Rules of the road are the general practices and procedures that road users
are required to follow. These rules usually apply to all road users, though they
are of special importance to motorists and cyclists. These rules govern
interactions between vehicles and with pedestrians. The basic traffic rules are
defined by an international treaty under the authority of the United Nations,
the 1968 Vienna Convention on Road Traffic. Not all countries are signatory to
the convention and, even among signatories, local variations in practice may
be found. There are also unwritten local rules of the road, which are generally
understood by local drivers.

As a general rule, drivers are expected to avoid a collision with another


vehicle and pedestrians, regardless of whether or not the applicable rules of
the road allow them to be where they happen to be.

In addition to the rules applicable by default, traffic signs and traffic lights must
be obeyed, and instructions may be given by a police officer, either routinely
(on a busy crossing instead of traffic lights) or as road traffic control around a
construction zone, accident, or other road disruption.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

3. Block Diagram
Automatic Traffic Camera Control for Vehicles Breaking Traffic Rules

Traffic
Light
Control
panel

Transistor
Driver
Circuit

40 KHz
IR TX

Buzzer

IR
RX

8051
Micro controller

ULN Driver
Circuit

IR Rays
Crystal
16X2
LCD
Reset
circuit

Camera

Contrast
Control

RFID
BLOCK

Step
down
T/F

Bridge
Rectifier

Filter
Circuit

Regulator
Power supply to all sections

Fig 3.1
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

3.1 REGULATED POWER SUPPLY


The circuit needs two different voltages, +5V & +12V, to work. These dual
voltages are supplied by this specially designed power supply.
The power supply, unsung hero of every electronic circuit, plays very
important role in smooth running of the connected circuit. The main object of
this power supply is, as the name itself implies, to deliver the required
amount of stabilized and pure power to the circuit. Every typical power supply
contains the following sections:
1. Step-down Transformer: The conventional supply, which is generally
available to the user, is 230V AC. It is necessary to step down the mains
supply to the desired level. This is achieved by using suitably rated step-down
transformer. While designing the power supply, it is necessary to go for little
higher rating transformer than the required one. The reason for this is, for
proper working of the regulator IC (say KIA 7805) it needs at least 2.5V more
than the expected output voltage

2. Rectifier stage: Then the step-downed Alternating Current is converted


into Direct Current. This rectification is achieved by using passive components
such as diodes. If the power supply is designed for low voltage/current
drawing loads/circuits (say +5V), it is sufficient to employ full-wave rectifier
with centre-tap transformer as a power source. While choosing the diodes the
PIV rating is taken into consideration.

3. Filter stage: But this rectified output contains some percentage of


superimposed a.c. ripples. So to filter these a.c. components filter stage is
built around the rectifier stage. The cheap, reliable, simple and effective
filtering for low current drawing loads (say upto 50 mA) is done by using shunt
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
capacitors. This electrolytic capacitor has polarities, take care while
connecting the circuit.

KIA 78xx
Series

1 2

4. Voltage Regulation: The filtered d.c. output is not stable. It varies in


accordance with the fluctuations in mains supply or varying load current. This
variation of load current is observed due to voltage drop in transformer
windings, rectifier and filter circuit. These variations in d.c. output voltage may
cause inaccurate or erratic operation or even malfunctioning of many
electronic circuits. For example, the circuit boards which are implanted by
CMOS or TTL ICs.
THE

STABILIZATION OF D.C. OUTPUT IS ACHIEVED BY USING THE THREE TERMINAL

VOLTAGE REGULATOR

IC. THIS

REGULATOR

POSITIVE VOLTAGE OUTPUT AND


EXAMPLE

THESE

7805

GIVES

REGULATOR

+5V

ICS

79XX

IC

COMES IN TWO FLAVORS:

78XX

FOR NEGATIVE VOLTAGE OUTPUT.

OUTPUT AND

7905

GIVES

-5V

FOR

FOR

STABILIZED OUTPUT.

HAVE IN-BUILT SHORT-CIRCUIT PROTECTION AND AUTO-

THERMAL CUTOUT PROVISIONS. IF THE LOAD CURRENT IS VERY HIGH THE

IC NEEDS

HEAT SINK TO DISSIPATE THE INTERNALLY GENERATED POWER.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Circuit Description:
A d.c. power supply which maintains the output voltage constant irrespective
of a.c. mains fluctuations or load variations is known as regulated d.c. power
supply. It is also referred as full-wave regulated power supply as it uses four
diodes in bridge fashion with the transformer. This laboratory power supply
offers excellent line and load regulation and output voltages of +5V & +12 V at
output currents up to one amp.
3.1.1 Step-down Transformer: The transformer rating is 230V AC at Primary
and 12-0-12V, 1Ampers across secondary winding. This transformer has a
capability to deliver a current of 1Ampere, which is more than enough to drive
any electronic circuit or varying load. The 12VAC appearing across the
secondary is the RMS value of the waveform and the peak value would be 12
x 1.414 = 16.8 volts. This value limits our choice of rectifier diode as 1N4007,
which is having PIV rating more than 16Volts.
3.1.2 Rectifier Stage: The two diodes D1 & D2 are connected across the
secondary winding of the transformer as a full-wave rectifier. During the
positive half-cycle of secondary voltage, the end A of the secondary winding
becomes positive and end B negative. This makes the diode D1 forward
biased and diode D2 reverse biased. Therefore diode D1 conducts while
diode D2 does not. During the negative half-cycle, end A of the secondary
winding becomes negative and end B positive. Therefore diode D2 conducts
while diode D1 does not. Note that current across the centre tap terminal is in
the same direction for both half-cycles of input a.c. voltage. Therefore,
pulsating d.c. is obtained at point C with respect to Ground.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

CIRCUIT DIAGRAM OF +5V & +12V FULL WAVE REGULATED POWER


Fig 3.1.2
IC1
7812

D
1
1

230
AC

C
1

C
2

IC
1
78
059
V

C
3

+12V

+5
V

C
4

D
2
1

SUPPLY

X
1

Parts List:
SEMICONDUCTO
RS
IC1

7812 REGULATOR IC

IC2

7805 REGULATOR IC

D1& D2

1N4007 RECTIFIER DIODES

C1

1000 F/25V ELECTROLYTIC

C2 TO C4

0.1F CERAMIC DISC TYPE

CAPACITORS

MISCELLANEOUS

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
X1

230V AC PRI,14-0-14 1AMP SEC

TRANSFORMER
3.1.3 Filter Stage: Here Capacitor C1 is used for filtering purpose and
connected across the rectifier output. It filters the a.c. components present in
the rectified d.c. and gives steady d.c. voltage. As the rectifier voltage
increases, it charges the capacitor and also supplies current to the load.
When capacitor is charged to the peak value of the rectifier voltage, rectifier
voltage starts to decrease. As the next voltage peak immediately recharges
the capacitor, the discharge period is of very small duration. Due to this
continuous charge-discharge-recharge cycle very little ripple is observed in
the filtered output. Moreover, output voltage is higher as it remains
substantially near the peak value of rectifier output voltage. This phenomenon
is also explained in other form as: the shunt capacitor offers a low reactance
path to the a.c. components of current and open circuit to d.c. component.
During positive half cycle the capacitor stores energy in the form of
electrostatic field. During negative half cycle, the filter capacitor releases
stored energy to the load.
3.1.4 Voltage Regulation Stage: Across the point D and Ground there is
rectified and filtered d.c. In the present circuit KIA 7812 three terminal voltage
regulator IC is used to get +12V and KIA 7805 voltage regulator IC is used to
get +5V regulated d.c. output. In the three terminals, pin 1 is input i.e.,
rectified & filtered d.c. is connected to this pin. Pin 2 is common pin and is
grounded. The pin 3 gives the stabilized d.c. output to the load. The circuit
shows two more decoupling capacitors C2 & C3, which provides ground path
to the high frequency noise signals. Across the point E and F with respect to
ground +5V & +12V stabilized or regulated d.c output is measured, which can
be connected to the required circuit.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Voltage Regulator 7805:


Features of 3-Terminal 1A Positive Voltage Regulator

Output Current up to 1A.

Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.

Thermal Overload Protection.

Short Circuit Protection.

Output Transistor Safe Operating Area Protection.

Voltage Regulators:-

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

10

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Circuit Diagram
COMPLETE CIRCUIT DIAGRAM [MOTHER BOARD]

30 pF 19

12
MHz

XTAL1

4
0

P0.7

AD7

32

AD6

P0.6

AD5

33

AD4

+V
cc 230
AC

P0.5

AD2

34

AD1

+VCC

89S52

30

10
MFD/63V

ALE

17
9

P3.7
RST

T1

16

T0

P3.6

P1.3
P0.1
P2.7
4
38
28

IN
T1
IN 3
PORT
T0
TX
D
RX
D

15
P3.5
14
P3.4
13
P3.3
12
P3.2
11

P0.4
P1.7
35
8

6
P0.2
P1.4
37
5

EA

RD
SWITCH
W

+VC
C

R1
C1
C2

C3

PORT 08 x 2.2
K

P1.6
P0.3
7
36
P1.5

31
20K
RESET

IC1

AD0

29
XTAL2
PSEN

D1 &
D2

D
3

AD3
30 pF 18

X1

VSS
20

Fig 3.2

P2.6
P1.2
P0.0
27
3
39
P2.5
P1.1
26
2
P2.4
P1.0
25
1
P2.3
1
24

PORT 1
A15
A14
A13
A12
A11
A10
A9
A8

PORT 2

P2.2
23
P2.1
22Department

Of
Electronics &P2.0
Communication Engineering,
XYX College
Of Engineering, ABC
21
1

11

P3.1
10

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

P3.0

3.2 MICROCONTROLLER 89S52

3.2.1 Features:

8 Bit microcontroller

8K Bytes of In-System Programmable (ISP) Flash Memory


o Endurance: 1000 Write/Erase Cycles

Compatible with MCS-51 Products

4.0V to 5.5V Operating Range

Fully Static Operation: 0 Hz to 33 MHz

Three-level Program Memory Lock

256 x 8-bit Internal RAM

32 Programmable I/O Lines

Three 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

3.2.2 Description:
The AT89S52 is a low-power, high-performance CMOS

8-bit

microcontroller with 8K bytes 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 instruction set
and pin out. The on-chip Flash allows the program memory to be
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

12

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
reprogrammed

in-system

or

by

conventional

nonvolatile

memory

programmer.
By combining a versatile 8-bit CPU with in-system programmable Flash
on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which
provides a highly-flexible and cost-effective solution to many embedded
control applications. 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, a six-vector two-level interrupt
architecture, a 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.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

13

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

3.2.3 Pin Configuration:

Fig. 3.2.2 Pin Description of 89S52


3.2.4 Pin Description:VCC
Supply voltage.
GND
Ground.
Port 0
Port 0 is an 8-bit open drain bidirectional 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 as high 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
14
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
receives the code bytes during Flash programming and outputs the code
bytes during program verification. External pull-ups are required during
program verification.
Port 1
Port 1 is an 8-bit bidirectional 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.
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 the
following table. Port 1 also receives the low-order address bytes during Flash
programming and verification.

Port 2
Port 2 is an 8-bit bidirectional 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, Port 2 uses strong internal pull-ups when emitting 1s. During
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

15

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
accesses to external data memories that 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 bidirectional 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, hey 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.

RST
Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device. This pin drives High for 96 oscillator
periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address
8EH) can be used to disable this feature. In the default state of bit DISRTO,
the RESET HIGH out feature is enabled.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

16

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

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 of 1/6 the oscillator frequency and may be
used for external programming 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 (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 kipped 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.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

17

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

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, as
shown in Figure 11. 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, as shown in Figure 12. 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.
OSCILLATOR CONNECTIONS

Oscillator Connections
NOTE: C1, C2 = 30 PF 10 PF FOR CRYSTALS
40 PF 10 PF FOR CERAMIC RESONATORS
C2, XTAL2, GND, XTAL1, C1

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

18

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Vital role of Micro controller-AT89C52 in Vehicle Position Tracking


Using GPS and GSM Receiver with License
The microcontroller will receive the SMS, which has sent from the
office and compare the password and the command. If everything matches
then it will perform the request required by the office.
BUZZER:
EARLY

DEVICES WERE BASED ON AN ELECTROMECHANICAL SYSTEM IDENTICAL TO

AN ELECTRIC BELL WITHOUT THE METAL GONG.

SIMILARLY

A RELAY MAY BE

CONNECTED TO AN INTERRUPT ITS OWN ACTUATING CURRENT, CAUSING THE


CONTACTS TO BUZZ.

OFTEN THESE

AS A SOUND BOARD.The

UNITS WERE ANCHORED TO CEILINGS TO USE IT

word "buzzer" comes from the rasping noise that

electromechanical buzzers made.


PIEZOELECTRIC:
A piezoelectric element may be driven by an oscillating electronic circuit or
other audio signal source, driven with a piezoelectric audio amplifier. Sounds
commonly used to indicate that a button has been pressed are a click, a ring
or a beep.
Uses

Annunciate panels

Electronic metronomes

Game shows

Microwave ovens and other household appliances

Sporting events such as basketball games

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

19

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

UTC UlN2803 LINEAR INEGRATED CIRCUIT:


Description:
The UTCLN2803 to high voltage, high current darlington drivers comprised of
eight NPN darlington pairs.
FEATURES:
1: Output current max 500ma.
2: High sustaining output voltage 50 V MIN
3: Output clamp diodes.
4: Inputs compatible with various type of logic
APPLICATIONS:
1: Relay
2: Hammer
3: Lamp and display LED drivers.

3.3 LCD
LCD interfacing with MICROCONTROLLER (89c51)
3.3.1Basics of LCD
DDRAM

Display

Data

RAM

Display data RAM (DDRAM) stores display data represented in 8-bit


character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

20

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
area in display data RAM (DDRAM) that is not used for display can be used
as general data RAM. So whatever you send on the DDRAM is actually
displayed on the LCD. For LCDs like 1x16, only 16 characters are visible, so
whatever you write after 16 chars is written in DDRAM but is not visible to the
user.
Figures below will show you the DDRAM addresses of 1 Line, 2 Line and 4
Line

LCDs.

Figure : DDRAM Address for 1 Line LCD

Figure : DDRAM Address for 2 Line LCD

Figure : DDRAM Address for 4 Line LCD

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

21

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

CGROM Character Generator ROM


Now you might be thinking that when you send an ascii value to DDRAM, how
the character is displayed on LCD? so the answer is CGROM. The character
generator ROM generates 5 x 8 dot or 5 x 10 dot character patterns from 8-bit
character codes (see Figure 5 and Figure 6 for more details). It can generate
208 5 x 8 dot character patterns and 32 5 x 10 dot character patterns. User
defined character patterns are also available by mask-programmed ROM.

Figure : LCD characters code map for 5x8 dots


Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

22

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Figure : LCD characters code map for 5x10 dots


1) As you can see in both the code maps, the character code from 0x00 to
0x07 is occupied by the CGRAM characters or the user defined haracters.
If user wants to display the fourth custom character then the code to isplay
it is 0x03 i.e. when users send 0x03 code to the LCD DDRAM then the
fourth user created character or pattern will be displayed on the LCD.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

23

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

CGRAM - Character Generator RAM


As clear from the name, CGRAM area is used to create custom characters in
LCD. In the character generator RAM, the user can rewrite character patterns
by program. For 5 x 8 dots, eight character patterns can be written, and for 5 x
10 dots, four character patterns can be written. Later in this tutorial I will
explain how to use CGRAM area to make custom character and also making
animations to give nice effects to your application.
Busy Flag
Busy Flag is an status indicator flag for LCD. When we send a command or
data to the LCD for processing, this flag is set (i.e. BF =1) and as soon as the
instruction is executed successfully this flag is cleared (BF = 0). This is helpful
in producing and exact amount of delay. for the LCD processing.
To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The
MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is
busy and will not accept next command or data and BF = 0 means LCD is
ready for the next command or data to process.
Instruction Register (IR) and Data Register (DR)
There are two 8-bit registers in HD44780 controller Instruction and Data
register. Instruction register corresponds to the register where you send
commands to LCD e.g. LCD shift command, LCD clear, LCD address etc. and
Data register is used for storing data which is to be displayed on LCD. When
send the enable signal of the LCD is asserted, the data on the pins is latched
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

24

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
in to the data register and data is then moved automatically to the DDRAM
and hence is displayed on the LCD.
Data Register is not only used for sending data to DDRAM but also for
CGRAM, the address where you want to send the data, is decided by the
instruction you send to LCD. We will discuss more on LCD instruction set
further in this tutorial.
3.3.2 Pin Discription
The most commonly used LCDs found in the market today are 1 Line, 2 Line
or 4 Line LCDs which have only 1 controller and support at most of 80
characters, whereas LCDs supporting more than 80 characters make use of 2
HD44780 controllers.
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16
Pins (two pins are extra in both for back-light LED connections). Pin
description is shown in the table below.

Figure 3.3.2: Character LCD type HD44780 Pin diagram

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

25

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Pin No.
Pin no. 1
Pin no. 2
Pin no. 3

Name
VSS
VCC
VEE

Pin no. 4

RS

Pin no. 5

R/W

1 = Read from LCD

EN
D0
D1
D2
D3
D4
D5
D6
D7

module
Enable signal
Data bus line 0 (LSB)
Data bus line 1
Data bus line 2
Data bus line 3
Data bus line 4
Data bus line 5
Data bus line 6
Data bus line 7 (MSB)

Pin no. 6
Pin no. 7
Pin no. 8
Pin no. 9
Pin no. 10
Pin no. 11
Pin no. 12
Pin no. 13
Pin no. 14

Description
Power supply (GND)
Power supply (+5V)
Contrast adjust
0 = Instruction input
1 = Data input
0 = Write to LCD module

Table 1: Character LCD pins with 1 Controller

3.3.3 LCD Initialization


before using the LCD for display purpose, LCD has to be initialized either by
the internal reset circuit or sending set of commands to initialize the LCD. It is
the user who has to decide whether an LCD has to be initialized by
instructions or by internal reset circuit. we will dicuss both ways of initialization
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

26

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
one by one.
Initialization by internal Reset Circuit
An internal reset circuit automatically initializes the HD44780U when the
power is turned on. The following instructions are executed during the
initialization. The busy flag (BF) is kept in the busy state until the initialization
ends (BF = 1). The busy state lasts for 10 ms after VCC rises to 4.5 V.

Display clear

Function set:
DL = 1; 8-bit interface data
N = 0; 1-line display
F = 0; 5 x 8 dot character font

Display on/off control:


D = 0; Display off
C = 0; Cursor off
B = 0; Blinking off

Entry mode set:


I/D = 1; Increment by 1
S = 0; No shift

3.4 SENSOR CIRCUIT (COMPARATORS)


THE

LM139/LM239/LM339/LM324 FAMILY OF DEVICES IS A MONOLITHIC

QUAD OF INDEPENDENTLY FUNCTIONING COMPARATORS DESIGNED TO MEET THE


NEEDS FOR A MEDIUM SPEED, TTL COMPATIBLE COMPARATOR.

FOR

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

INDUSTRIAL

27

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
APPLICATIONS.

SINCE

NO ANTI-SATURATION CLAMPS ARE USED ON THE OUTPUT

SUCH AS A BAKER CLAMP OR OTHER ACTIVE CIRCUITRY, THE OUTPUT LEAKAGE


CURRENT IN THE OFF STATE IS TYPICALLY

0.5NA. THIS

MAKES THE DEVICE IDEAL

FOR SYSTEM APPLICATIONS WHERE IT IS DESIRED TO SWITCH A NODE TO GROUND


WHILE LEAVING IT TOTALLY UNAFFECTED IN THE OFF STATE.

OTHER

FEATURES

INCLUDE SINGLE SUPPLY, LOW VOLTAGE OPERATION WITH AN INPUT COMMON MODE
RANGE FROM GROUND UP TO APPROXIMATELY ONE VOLT BELOW VCC.

THE

OUTPUT

IS AN UNCOMMITTED COLLECTOR SO IT MAY BE USED WITH A PULL -UP RESISTOR


AND A SEPARATE OUTPUT SUPPLY TO GIVE SWITCHING LEVELS FROM ANY VOLTAGE
UP TO

36V

DOWN TO A VCC SAT ABOVE GROUND

CURRENTS UP TO

15

(APPROX. 100

MV), SINKING

MA. IN ADDITION IT MAY BE USED AS A SINGLE POLE SWITCH

TO GROUND, LEAVING THE SWITCHED NODE UNAFFECTED WHILE IN THE OFF STATE.

POWER DISSIPATION WITH ALL FOUR COMPARATORS

IN THE OFF STATE IS TYPICALLY

4 MW FROM A SINGLE 5V SUPPLY (1 MW/COMPARATOR).

FIG 3.4
COMPARATOR

CIRCUITS

FIGURE 1

SHOWS A BASIC COMPARATOR CIRCUIT FOR CONVERTING LOW

LEVEL ANALOG SIGNALS TO A HIGH LEVEL DIGITAL OUTPUT.

THE

OUTPUT PULL-UP

RESISTOR SHOULD BE CHOSEN HIGH ENOUGH SO AS TO AVOID EXCESSIVE POWER


DISSIPATION YET LOW ENOUGH TO SUPPLY ENOUGH DRIVE TO SWITCH WHATEVER

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

28

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
LOAD CIRCUITRY IS USED ON THE COMPARATOR OUTPUT .

RESISTORS R1

ARE USED TO SET THE INPUT THRESHOLD TRIP VOLTAGE

(VREF)

AND R2

AT ANY VALUE

DESIRED WITHIN THE INPUT COMMON MODE RANGE OF THE COMPARATOR.

COMPARATORS
THE

WITH HYSTERICS

CIRCUIT SHOWN IN FIGURE

SUFFERS FROM ONE BASIC DRAWBACK

IN THAT IF THE INPUT SIGNAL IS A SLOWLY VARYING LOW LEVEL

SIGNAL,

THE

COMPARATOR MAY BE FORCED TO STAY WITHIN ITS LINEAR REGION BETWEEN THE
OUTPUTS HIGH AND LOW STATES FOR AN UNDESIRABLE LENGTH OF TIME. IF THIS
HAPPENS, IT RUNS THE RISK OF OSCILLATING SINCE IT IS BASICALLY AN
UNCOMPENSATED, HIGH GAIN OP AMP.

TO

PREVENT THIS, A SMALL AMOUNT OF

POSITIVE FEEDBACK OR HYSTERICS IS ADDED AROUND THE COMPARATOR.

FIGURE

6 SHOWS A COMPARATOR WITH A SMALL AMOUNT OF POSITIVE FEEDBACK.


IN

ORDER TO INSURE PROPER COMPARATOR ACTION, THE COMPONENTS SHOULD

BE CHOSEN AS FOLLOWS:

RPULL-UP < RLOAD

AND

R1 > RPULL-UP THIS

WILL INSURE THAT THE

+VCC

AND NOT BE PULLED DOWN

COMPARATOR WILL ALWAYS SWITCH FULLY UP TO


BY THE LOAD OR FEEDBACK.

THE

AMOUNT OF FEEDBACK IS CHOSEN ARBITRARILY

TO INSURE PROPER SWITCHING WITH THE PARTICULAR TYPE OF INPUT SIGNAL


USED.

IF

FEEDBACK

THE OUTPUT SWING IS

5 V,

1%

100 R2. TO

OR

50

MV, THEN R1

FOR EXAMPLE, AND IT IS DESIRED TO


DESCRIBE CIRCUIT OPERATION,

ASSUME THAT THE INVERTING INPUT GOES ABOVE THE REFERENCE INPUT (VIN
VREF).

THIS

>

WILL DRIVE THE OUTPUT, VO, TOWARDS GROUND WHICH IN TURN

PULLS VREF DOWN THROUGH R1.

SINCE

VREF IS ACTUALLY THE NON-INVERTING

INPUT TO THE COMPARATOR, IT TOO WILL DRIVE THE OUTPUT TOWARDS GROUND
INSURING THE FASTEST POSSIBLE SWITCHING TIME REGARDLESS OF HOW SLOW
THE INPUT MOVES.

IF

THE INPUT THEN TRAVELS DOWN TO VREF, THE SAME

PROCEDURE WILL OCCUR ONLY IN THE OPPOSITE DIRECTION INSURING THAT THE
OUTPUT WILL BE DRIVEN HARD TOWARDS

+VCC.

LOW POWER QUAD OPERATIONAL AMPLIFIERS


Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

29

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

General Description
The LM124 series consists of four independent, high gain, internally
frequency

compensated

operational

amplifiers

which

were

designed

specifically to operate from a single power supply over a wide range of


voltages. Operation from split power supplies is also possible and the low
power supply current drain is independent of the magnitude of the power
supply voltage. Application areas include transducer amplifiers, DC gain
blocks and all the conventional op amp circuits which now can be more easily
implemented in single power supply systems. For example, the LM124 series
can be directly operated off of the standard +5V power supply voltage which is
used in digital systems and will easily provide the required interface
electronics without requiring the additional 15V

4. RFID
4.1RFID BASIC IDEA:

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

30

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
RFID (radiofrequency identification) technology offers the ability to provide
many new services and conveniences in the retail environment. Shoppers can
be guided electronically to find desired products that are tagged with RFID
chips and whose locations are tracked by RFID readers in the store (e.g.,
smart shelves or other reader systems). Smart shopping carts with electronic
displays, in communication with a retail computer system, can display a map
associated with a shopping list downloaded by a shopper to identify a route to
obtain the desired items. The smart cart, also equipped with RFID tags, can
also verify the purchase of the items as they are placed in the cart and, if
desired, communicate with a billing system to automatically bill the shopper
for the purchases.
4.2 INTRODUCTION TO RFID
Radio-frequency identification (RFID) is an automatic identification method,
relying on storing and remotely retrieving data using devices called RFID tags
or transponders. The technology requires some extent of cooperation of an
RFID reader and an RFID tag.
An RFID tag is an object that can be applied to or incorporated into a product,
animal, or person for the purpose of identification and tracking using radio
waves. Some tags can be read from several meters away and beyond the line
of sight of the reader.
An RFID tag is an object that can be applied to or incorporated into a product,
animal, or person for the purpose of identification and tracking using radio
waves. Some tags can be read from several meters away and beyond the line
of sight of the reader.

4.3 What is RFID?


A basic RFID system consists of three components:

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

31

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
a) An antenna or coil
b) A transceiver (with decoder)
c) A transponder (RF tag)
Electronically programmed with unique information. There are many different
types of RFID systems out in the market. They are categorized according to
there frequency ranges. Some of the most commonly used RFID kits are as
follows:
1) Low-frequency (30 KHz to 500 KHz)
2) Mid-Frequency (900KHz to 1500MHz)
3) High Frequency (2.4GHz to 2.5GHz)
These frequency ranges mostly tell the RF ranges of the tags from low
frequency tag ranging from 3m to 5m, mid-frequency ranging from 5m to 17m
and high frequency ranging from 5ft to 90ft. The cost of the system is based
according to there ranges with low-frequency system ranging from a few
hundred dollars to a high-frequency system ranging somewhere near 5000
dollars.
How RFID Is Changing the Business Environment today
Radio frequency identification (RFID) technology has been in use for several
decades to track and identify goods, assets and even living things. Recently,
however, RFID has generated widespread corporate interest as a means to
improve supply chain performance. Market activity has been exploding since
Wal-Mart's June 2003 announcement that its top 100 suppliers must be RFIDcompliant by January 2005. Mandates from Wal-Mart and the Department of
Defense (DoD) are making many companies scramble to evaluate, select and
implement solutions that will make them compliant with their customers' RFID
requirements and additional retailers and other large supply chain channel
masters are likely to follow suit.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

32

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
4.4 COMPONENTS OF RFID

A basic RFID system consist of three components:

An antenna or coil

A transceiver (with decoder)

A transponder (RF tag) electronically programmed with unique


information

4.5 RFID Features

1. RFID requires neither direct contact nor line of sight


2. RFID identifies and reads data very fast
3. RFID requires virtually no maintenance.
4. RFID achieves almost 100% precision.
5. RFID

works

even

in

dust/paint/vapor/mud/water/plastic/wood/glass/grease.
6. If recycled, RF tags cost less than bar-coding.
7. RF tags are semi-permanent because they are contact free and
therefore free from failure caused by a malfunctioning reader.
8. RF tags can perform intelligently (like a smart card)
9. RF tags can send or receive a large volume of data.
10. RF tags can store or read data.
11. RF tags can be used in an extremely hostile environment.
12. RF tags can be used in flexible positions of an object.
Data in RF tags cannot be forged or modified, ensuring perfect security.
Making counterfeit RF tags is difficult.
4.5.1 MAX 232
RS 232 CONVERTER (MAX 232N) Serial Port:

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

33

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
This is the device, which is used to convert TTL/RS232 vice versa.
RS-232Protocol

In telecommunications, RS-232 is a standard for serial binary data


interconnection between a DTE (Data terminal equipment) and a DCE (Data
Circuit-terminating Equipment). It is commonly used in computer serial ports.
The RS-232 standard defines the voltage levels that correspond to logical one
and logical zero levels. Valid signals are plus or minus 3 to 15 volts. The
range near zero volts is not a valid RS-232 level; logic one is defined as a
negative voltage, the signal condition is called marking, and has the functional
significance of OFF.
RS-232 was created for one purpose, to interface between Data
Terminal Equipment (DTE) and Data Communications Equipment (DCE)
employing serial binary data interchange. So as stated the DTE is the
terminal or computer and the DCE is the modem or other communications
device.
RS-232 pin-outs for IBM compatible computers are shown below.
There are two configurations that are typically used: one for a 9-pin connector
and the other for a 25-pin connector.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

34

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Fig. 4.5.1 Pin Description of MAX 232

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

35

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
Logic Diagram (Positive Logic)

Logic Diagram of MAX232

Operating Characteristics
Vital role of MAX232 is to convert RS232 logic to TTL logic and vice
versa.
Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

36

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

37

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
ULN 2803:

IC ULN 2803
1

16

15

14

13

12

11

10

VCC

Since the digital outputs of the some circuits cannot sink much current, they
are not capable of driving relays directly. So, high-voltage high-current
Darlington arrays are designed for interfacing low-level logic circuitry and
multiple peripheral power loads. The series ULN2000A/L ICs drive seven
relays with continuous load current ratings to 600mA for each input. At an
appropriate duty cycle depending on ambient temperature and number of
drivers turned ON simultaneously, typical power loads totaling over 260W
[400mA x 7, 95V] can be controlled. Typical loads include relays, solenoids,
stepping motors, magnetic print hammers, multiplexed LED and incandescent
displays, and heaters. These Darlington arrays are furnished in 16-pin dual inDepartment Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

38

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
line plastic packages (suffix A) and 16-lead surface-mountable SOICs (suffix
L). All devices are pinned with outputs opposite inputs to facilitate ease of
circuit board layout.
The input of ULN 2004 is TTL-compatible open-collector outputs. As each of
these outputs can sink a maximum collector current of 500 mA, miniature
PCB relays can be easily driven. No additional free-wheeling clamp diode is
required to be connected across the relay since each of the outputs has inbuilt
free-wheeling diodes. The Series ULN20x4A/L features series input resistors
for operation directly from 6 to 15V CMOS or PMOS logic outputs.
1N4148 signal diode:
Signal diodes are used to process information (electrical signals) in circuits,
so they are only required to pass small currents of up to 100mA.
General purpose signal diodes such as the 1N4148 are made from
silicon and have a forward voltage drop of 0.7V.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

39

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

5. PCB LAYOUT

6. ADVANTAGES AND DISADVANTAGES


6.1 Advantages

Size: Size can be reduced as the functionality can be implemented on


single board.

Cost: Its a medium cost project .But when manufactured on large


scale, cost can still be reduced.

Real Time : Our project can be implemented in Real time.

6.2 Disadvantages

Complexity: The circuit is bit complex.

Non-Secure:

Sometimes if someone comes to know about the

password or command the security of the system is lost.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

40

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

7. APPLICATION:
1: Traffic management
2: Vehicle theft identification
3: Reduced human effort
4: Accident identification
5: Identifying the culprit by use of camera.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

41

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

8. CONCLUSION
Every vehicle is assigned a code which is transmitted to the
microcontroller through HT 12E 433 MHz transmitter. On receiving side this
code is decoded by HT 12 D 433 MHz receiver. If the code matches image
and license checking parameters are displayed on the screen at the check
post. This project can be implemented in real time.

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

42

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES
REFERENCES

BOOKS

1. ELECTRONICS FOR YOU


2. 8051 MICRO CONTROLLER (MAZIDI AND MAZIDI)
3. 8051 MICRO CONTROLLER(GOPAL SING)
4. FAIR CHILD SEM CONDUCATIOR CO-OPERATION
5. OPERATIONAL AMPLIFIERS

WEBSITES

1. www.epanaroma.com
2. www.nationalsemiconductor. com

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

43

AUTOMATIC
TRAFFIC CAMERA CONTROL FOR VEHICLES BREAKING
TRAFFIC RULES

DATA SHEETS

Department Of
Electronics & Communication Engineering,
XYX College Of Engineering, ABC

44

S-ar putea să vă placă și