Copmuter Controlled Traffic Light
Copmuter Controlled Traffic Light
CHAPTER ONE
INTRODUCTION
1.1
Introduction
For road and highway systems the safe and efficient flow of traffic through
intersections is paramount. Traffic is controlled at the intersection of roads by
traffic lights and traffic signals to ensure there are no accidents or collisions.
In some traffic signal control systems the period of green signals and red
signals can change depending on the time of day and traffic conditions, as can
the duration that pedestrians can cross roads in front of stationary traffic. To
meet all these requirements of a real time interconnected system, the
Computer Controlled Traffic Light is the ideal embedded platform due to
its robust design, compact design factor, reliable high performance processor
and multitude of interfaces for connection to communications equipment and
redundant communications equipment.
The ruggedized compact design makes this scheme suitable to be mounted in
a roadside outdoor cabinet that is exposed to the most extreme weather
conditions. The ultra reliable processor technology provides the stability and
reliability required for real time traffic signal control and the networking
support to interconnect signals and the traffic control centre.
1.2
Design Considerations
Ruggedized industrial design, wide operating temperature, fanless,
dustproof and suitable for installation in an outdoor roadside cabinet.
Traffic lights, which may also be known as stoplights, traffic lamps, traffic
signals, stop-and-go
lights,
signaling
devices
Usually, the red light contains some orange in its hue, and the green light
contains some blue, to provide some support for people with red-green color
blindness. (And indeed, many "green" traffic lights have blue lenses with a
yellowish bulb behind them, the combination yielding a green color.)
(e.g. incident) or predictable over a future time horizon. The networks output
or performance is measured via suitable indices, such as the total time spent
by all vehicles in the network over a time horizon. The task of the computer is
to enhance and to extend the information provided by suitable sensors (e.g.
inductive loop detectors) as required by the subsequent control strategy and
the human operators. The relevance and efficiency of the control strategy
largely determines the efficiency of the overall control system. Therefore
control strategies should be designed with care, via application of powerful
and systematic methods of optimization and automatic control, rather than
via questionable heuristics.
1.3
Problem Statement
The objective of this project is to develop a compact unit that allows for
optimum utilization of the traffic control system by employing a customizable
traffic control system that will meet the test of time. This system will be a
powerful and flexible tool that will offer this service at any time with the
constraints of the technologies being applied.
The proposed approach for designing this system is to implement a Computer
Controlled Traffic Light control module that receives its instructions and
commands from a host computer serving as the core of the system. The
computer then will carry out the issued commands.
CHAPTER TWO
LITERATURE REVIEW
History
Marshalite traffic signal formerly fitted in various intersections in Melbourne,
Australia, indicating how much time remained before a signal change.
On December 10, 1868, the first traffic lights were installed outside the British
Houses of Parliament in London, by the railway engineer J. P. Knight. They
resembled railway signals of the time, with semaphore arms and red and
green gas lamps for night use. The gas lantern was turned with a lever at its
base so that the appropriate light faced traffic. Unfortunately, it exploded on 2
January 1869, injuring or killing the policeman who was operating it.
Fig 2.0: An LED traffic light (Siemens Helios) in Portsmouth, United Kingdom.
shaped pole unit that featured three hand-cranked positions: Stop, in all directional stop position. This third position halted traffic in all directions to
allow pedestrians to cross streets more safely. Its one "advantage" over
others of its type was the ability to operate it from a distance using a
mechanical linkage.
The color of the traffic lights representing stop and go might be derived from
those used to identify port (red) and starboard (green) in maritime rules
governing right of way, where the vessel on the left must stop for the one
crossing on the right.
CHAPTER THREE
COMPONENTS DESCRIPTION
RESISTOR
Resistors are one of the most common components in an electronic circuit. The
basic operation is to limit the flow of current in the circuit. Many resistor values
were used in this project. Some of them include 1K, 10k, 100 and the 330
used to limit the current that flows to the seven segment display.
How to read Resistor Color Codes
Black Brown Red Orange Yellow Green Blue Violet Grey White
0
First find the tolerance band, it will typically be gold (5%) and sometimes silver
(10%). Starting from the other end, identify the first band - write down the
number associated with that color; in this case Brown is 1. Now 'read' the next
color, here it is Black so write down a '0' next to the six. (You should have '10' so
far.) Now read the third or 'multiplier exponent' band and write down that as the
CAPACITOR
Capacitors store electric charge. They are used with resistors in timing circuits
because it takes time for a capacitor to fill with charge. They are used to smooth
varying DC supplies by acting as a reservoir of charge. They are also used in filter
circuits because capacitors easily pass AC (changing) signals but they block DC
(constant) signals. There are many types of capacitor but they can be split into
two groups, polarized and unpolarised. Each group has its own circuit symbol.
Electrolytic Capacitors
Electrolytic capacitors are polarized and they must be connected the correct way
round, at least one of their leads will be marked + or -. They are not damaged by
heat when soldering.
There are two designs of electrolytic capacitors; axial where the leads are
attached to each end (220F in picture) and radial where both leads are at the
same end (10F in picture). Radial capacitors tend to be a little smaller and they
stand upright on the circuit board. It is easy to find the value of electrolytic
capacitors because they are clearly printed with their capacitance and voltage
rating. The voltage rating can be quite low (6V for example) and it should always
be checked when selecting an electrolytic capacitor.
Non-polarized capacitors
Small value capacitors are non-polarized and may be connected either way round.
They are not damaged by heat when soldering, except for one unusual type
(polystyrene). They have high voltage ratings of at least 50V, usually 250V or so. It
can be difficult to find the values of these small capacitors because there are
many types of them and several different labeling systems!
Many small value capacitors have their value printed but without a multiplier, so
you need to use experience to work out what the multiplier should be.
TRANSISTORS
Transistors are made from semiconductors. These are materials, such as silicon or
germanium, that are doped (have minute amounts of foreign elements added)
so that either an abundance or a lack of free electrons exists. In the former case,
the semiconductor is called n-type, and in the latter case, p-type. By combining ntype and p-type materials, a diode can be produced. When this diode is
connected to a battery so that the p-type material is positive and the n-type
negative, electrons are repelled from the negative battery terminal and pass
unimpeded to the p-region, which lacks electrons. With battery reversed, the
electrons arriving in the p-material can pass only with difficulty to the n-material,
which is already filled with free electrons, and the current is almost zero.
The bipolar transistor was invented in 1948 as a replacement for the triode
vacuum tube. It consists of three layers of doped material, forming two p-n
(bipolar) junctions with configurations of p-n-p or n-p-n. One junction is
connected to a battery so as to allow current flow (forward bias), and the other
junction has a battery connected in the opposite direction (reverse bias). If the
current in the forward-biased junction is varied by the addition of a signal, the
current in the reverse-biased junction of the transistor will vary accordingly. The
principle can be used to construct amplifiers in which a small signal applied to the
DIODE
This is an electronic device that allows the passage of current in only one
direction. The first such devices were vacuum-tube diodes, consisting of an
evacuated glass or steel envelope containing two electrodesa cathode and an
anode. Because electrons can flow in only one direction, from cathode to anode,
the vacuum-tube diode could be used as a rectifier. The diodes most commonly
used in electronic circuits today are semiconductor diodes. The simplest of these,
the germanium point-contact diode, dates from the early days of radio, when the
received radio signal was detected by means of a germanium crystal and a fine,
pointed wire that rested on it. In modern germanium (or silicon) point-contact
diodes, the wire and a tiny crystal plate are mounted inside a small glass tube and
connected to two wires that are fused into the ends of the tube.
(T2) P1.0
(T2 EX) P1.1
P1.2
P1.3
P1.4
(MOSI) P1.5
(MISO) P1.6
(SCK) P1.7
RST
(RXD)P3.0
(TXD) P3.1
(INT0) P3.2
(INT1) P3.3
(T0) P3.4
(T1) P3.5
(WR)
P3.6(RD) P3.7
XTAL2
XTAL1
GND
VCC
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
P0.4 (AD4)
P0.5 (AD5)
P0.6 (AD6)
P0.7 (AD7)
EA/VPP
ALE/PROG
PSEN
P2.7 (A15)
P2.6 (A14)
P2.5 (A13)
P2.4 (A12)
P2.3 (A11)
P2.2 (A10)
P2.1 (A9)
P2.0 (A8)
Microcontroller's Pins
Pins 1-8: Port 1 Each of these pins can be configured as input or output.
Pin 9: RS Logical one on this pin stops microcontrollers operating and erases the
contents of most registers. By applying logical zero to this pin, the program starts
execution from the beginning. In other words, a positive voltage pulse on this pin
resets the microcontroller.
Pins10-17: Port 3 Similar to port 1, each of these pins can serve as universal input
or output. Besides, all of them have alternative functions:
Pin 30: ALE Prior to each reading from external memory, the microcontroller will
set the lower address byte (A0-A7) on P0 and immediately after that activates the
output ALE.
Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and
address transmission with no regard to whether there is internal memory or not.
That means that even there is a program written to the microcontroller, it will not
be executed, the program written to external ROM will be used instead.
Otherwise, by applying logic one to the EA pin, the microcontroller will use both
memories, first internal and afterwards external (if it exists), up to end of address
space.
Pin 32-39: Port 0 Similar to port 2, if external memory is not used, these pins can
be used as universal inputs or outputs.
Pin 40: VCC Power supply +5V
Below is the power supply circuit when running from the utility
Power supply
Reset signal
Clock signal
Obviously, all this is about very simple circuits, but it does not have to be always
like that. If device is used for handling expensive machines or for maintaining vital
functions, everything becomes more and more complicated! This kind of solution
is quite enough for the time being.
cheap voltage stabilisator LM7805 and provides high-quality voltage level and
quite enough current to enable microcontroller and peripheral electronics to
operate (sufficient current in this case amounts to 1A)!
The most commonly used are so called 7-segment displays. They are composed of
8 LEDs, 7 segments are arranged as a rectangle for symbol displaying and there is
additional segment for decimal point displaying. In order to simplify connecting,
anodes and cathodes of all diodes are connected to the common pin so that there
are common cathode displays and common anode displays. Segments are marked
with the litters A to G as shown on the figure on the left. When connecting, each
diode is treated independently, which means that each must have its own
conductor for current limitation.
When connecting displays to the microcontroller, the greatest problem is a great
deal of valuable I/O pins which they occupy, especially if it is needed to display
DC MOTOR
In general, DC motors are similar to DC generators in construction. They may, in
fact, be described as generators run backwards. When current is passed
through the armature of a DC motor, a torque is generated by magnetic reaction,
and the armature revolves. The action of the commutator and the connections of
the field coils of motors are precisely the same as those used for generators. The
revolution of the armature induces a voltage in the armature windings. This
induced voltage is opposite in direction to the outside voltage applied to the
armature, and hence is called back voltage or counter electromotive force (emf).
As the motor rotates more rapidly, the back voltage rises until it is almost equal to
the applied voltage. The current is then small, and the speed of the motor will
remain constant as long as the motor is not under load and is performing no
mechanical work except that required to turn the armature. Under load the
armature turns more slowly, reducing the back voltage and permitting a larger
current to flow in the armature. The motor is thus able to receive more electric
power from the source supplying it and to do more mechanical work.
Because the speed of rotation controls the flow of current in the armature,
special devices must be used for starting DC motors. When the armature is at
rest, it has virtually no resistance, and if the normal working voltage is applied, a
large current will flow, which may damage the commutator or the armature
windings. The usual means of preventing such damage is the use of a starting
resistance in series with the armature to lower the current until the motor begins
to develop an adequate back voltage. As the motor picks up speed, the resistance
is gradually reduced, either manually or automatically.
The speed at which a DC motor operates depends on the strength of the magnetic
field acting on the armature, as well as on the armature current. The stronger the
field, the slower is the rate of rotation needed to generate a back voltage large
enough to counteract the applied voltage. For this reason the speed of DC motors
can be controlled by varying the field current.
CHAPTER FOUR
3. SYSTEM DEVELOPMENT
3.1. Traffic Controller Hardware
The traffic controller hardware is developed using ATmega128 128Kbyte
microcontroller. The microcontroller has 32 pins I/O ports. The ports will be
used to drive 10 phases traffic light system. Since a phase has three lights,
which are green, amber and red light, and each light is driven by a relay
switch, then the I/O ports will be used to drive 30 relay units. The I/O ports
will also be used to drive 1 unit of character LCD, 30 LEDs to control the ports
status,
communicate
with
an
industrial
computer
through
serial
communication and communicate with the Real Time Clock (RTC). In order to
perform all of the tasks, about 40 pins are required; 30 pins used to drive the
relays and the LEDs, 6 pins used to drive the character LCD, 2 pins to
communicate with the industrial computer and 2 pins to perform serial
communication. Hence, several manipulation techniques are needed to save
the use of the microcontrollers ports.
computer. The time slot strategy is the backup strategy when the industrial
computer.
Basically, there are three main tasks that must be handled by the processor,
which are clock and time slot data reading, timing and incoming data
monitoring all these via the industrial computer. The first task is performed at
the beginning of every traffic cycle while the last two tasks must be handled in
real time. In order to handle the real time tasks, the internal timer
interruption of the processor needs to be activated. In the proposed traffic
controller hardware, the timer interruption will be set to 250 ms, it means the
timing and data monitoring process will be executed 4 times per second. It
will allow the tasks to be carried out thoroughly. By using this technique, the
processor will have a very high probability of capturing the serial data from
the computer successfully.
3.1.3 THE SOFTWARE
Flow Chart
interfaces for displaying and changing the time slot timing, adjusting the
internal clock of the traffic controller hardware, sending the green time data
for the next phase and extending the current green time with both + (prolong)
and (shorten) value.
Camera
Todays cameras all derive from the 16th-century camera obscura. The
earliest form of this device was a darkened room with a tiny hole in one wall.
Light entered the room through this hole and projected an upside-down image
of the subject onto the opposite wall. Over the course of three centuries the
camera obscura evolved into a handheld box with a lens replacing the pinhole
and an angled mirror at the back. The mirror reflected an image onto a
ground-glass viewing screen on the top of the box. Long before film was
invented artists used this device to help them draw more accurately. They
placed thin project onto the viewing screen and could easily trace the
reflected image.
Fig 3.1
camera
Analysis of a pin-hole
Fig 3.3
CCTV Camera
PRINCIPLE OF OPERATION
The principle of operation of this traffic control device can well be explained
by the use of the block diagram shown below.
Fig
From the diagram above it can be seen that there are four Cameras, each is
mounted on the four lanes to monitor the movement of cars and pedestrians.
The cameras are all connected to a hub like in computer network. The hub
then sends video signal to the computer which uses it to determine the action
to take based on the pre-written program (software) controlling the
computer.
The solar energy power in diagram powers the whole system while the traffic
massage display displays information such as the maximum speed limit and
road directions. It can also be used to give traffic warning such as Bumps
Ahead , Sharp Bend, Rail Way Crossing etc.
The traffic lights as we all know gives road users information on when to
move or stop in a junction. The traffic light convention is maintained in the
design of this work. This goes like this;
Red ---------------------- Stop
Green ---------------------- Go
Red + Amber ------------- Get ready to stop
Green + Amber ---------- Get ready to go
CHAPTER FIVE
4.1
CONCLUSION
This project shows the development of the smart traffic controller system. The
use of a computer instead of other controllers is far preferred to the use of
Programmable Logic Controller (PLC). This design makes the smart traffic
controller hardware a low cost system. The proposed manipulations
techniques are to save enhance system implemented. A program downloaded
into the microcontroller enables it to establish a high accuracy timing, high
consistently in performing data interchange with the industrial computer. The
developed software also works well as the interface between the traffic
controller hardware with the traffic sensors and the traffic expert. The
software can be used to perform traffic data interchange and it enables the
proposed system to realize several traffic flow optimization strategies at a
single or network junctions.
4.2
RECONMENDATION
REFERENCES
[1] Bingham, E. 2001. Reinforcement learning in neurofuzzy traffic signal
control. European Journal of Operational Research. 131, pp. 232-241.
[2] Chang, T.H. and Sun, G.Y. 2004. Modeling and optimization of an
oversaturated signalized network. Transportation Research Part B. 38, pp.
687-707.
[3] Chiou, S.W. 2007. An optimization model for area traffic control with link
tolls. Applied Mathematics and Computation. 192, pp. 520-532.
[4] Hernandez, J.Z., Ossowski, S. and Garcia-Serrano, A. 2002. Multiagent
architectures for intelligent traffic management systems. Transportation
Research Part C. 10, pp. 473-506.
[5] Jinyuan, L., Xin, P. and Xiqin, W. 2007. State-space equations and the firstphase algorithm for signal control of single intersections. Tsinghua Science and
Technology. 2, pp. 231-235.
[6] Kosonen, I. 2003. Multi-agent fuzzy signal control based on real-time
simulation. Transportation Research Part C. 11, pp. 389-403.
[7] Li, F., Gao, Z.Y. and Jia, B. 2007. Traffic behavior in the on-ramp system
with signal controlling. Physica A. 385, pp. 333-342.
[8] McShane, W.R., Roess, R.P. and Prassas, E.S. 1998. Traffic engineering. New
Jersey: Prentice Hall Inc.
[9] Murat, Y.S. and Gedizlioglu, E. 2005. A fuzzy logic multi-phased signal
control model for isolated junctions. Transportation Research Part C. 13, pp.
19-36.
[10] Nagatani, T. 2008. Effect of irregularity on vehicular traffic through a
sequence of traffic lights. Physica A. 387, pp.1637-1647.
[11] Oda, T., Otokita, T., Iwaoka, K. and Kurata, K. 2003. Meta-heuristic
optimization of signal control and sub-area decomposition in traffic control
systems. Proceedings of 10th World Congress and Exhibition on Intelligent
Transport Systems and Services. CD-ROM. Madrid. Development of a Low Cost
Smart Traffic Controller System 499
[12] Taale. H. 2000. Optimising traffic signal control with evolutionary
algorithms. Proceedings of 7th World Congress on Intelligent Transport
Systems. CD-ROM. Turin.