Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1.1 Overview
Globally road accident is considered to be an important issue. Speeding has been
implicated as a major contributing factor in all fatal motor-vehicle crashes. Accidents due
to rash driving on highways are on the rise and millions of lives are being lost as a result.
In Nigeria today, for instance, the incidence of fatal road accidents is phenomenal as
hardly a day goes by without the occurrence of a road traffic accident leading to generally
increasing incidence of morbidity and mortality rates as well as financial cost to both
society and the individual involved (Oluseyi and Gbadamosi, 2017). Trend analysis of
fatal road accidents between June 2006 and May 2014 using the Federal Road Safety
Corps database showed that 15,090 lives were lost to fatal road accidents in 3,075 events
(FRSC, 2014). Mitigation of loss of lives due to these avoidable mistakes is therefore
over speeding, several methods have been adopted but most of them are largely
ineffective or manually operated and depend on the user’s ability to be alert when using
them. As such, an automatic speed alert and reporting system is needed which can inform
a driver the speed limit as well as also alert him/her if he/she exceeds the limit.
Notably, a small increase in traveling speed before braking begins can result in large
increases in impact speed and the risk of fatal injury. Even small differences in impact
speed will make a large difference to the probability of serious injury. When a driver is
speeding, there is less time for both that driver and any other road user to recognize
1
When a vehicle is over-speeding, the reaction and braking distances required are also
longer. The reaction distance is referred to the distance that a vehicle travels from the
time a driver recognizes an emergency until the driver can react, whereas the braking
distance is referred to the distance it takes to stop the vehicle. The faster a vehicle travels
Besides, speeding can lead to higher impacts, which as well as the crash energy is
associated with high risk of losing control of the vehicle. The crash severity increases
based on the vehicle speed at the time a crash happens. When a crash does occurs, people
are killed or seriously injured only when the impact speed and hence the energy absorbed
by the human exceeds the human tolerance to violent forces. The greater the vehicle
speed, the greater the chance of death or serious injury. Vehicles and their occupants in
motion have kinetic energy that is dissipated in a crash. The greater the energy that must
be dissipated during the crash, the greater the chances of severe injury or death. In a
collision, the vehicle speed decreases abruptly, while its occupants continue on toward
the point of impact. The kinetic energy released equals the weight of the vehicle
multiplied by the square of its speed and the energy released will result in injuries.
Therefore, the seriousness of a crash depends on the weight of the vehicle but especially
on the speed.
Besides that, speeding will reduce driver’s ability to steer safely around curves on the
roadway. It is also known that vehicle traveling around a curve or around an object is
subject to centrifugal force. Every curve has a critical curve speed and should be taken at
the recommended speed or below depending on the conditions. If a vehicle travels faster
than the curve is designed for, the driver will break the centrifugal force and the vehicle
2
will start to slide out of the curve sideways, which can lead to a rollover. This becomes
Furthermore, higher speed will also reduce the ability of vehicles, safety belts, air bags
approaching vehicles are more likely to be misjudged by turning drivers and the
These factors clearly show that it is important for a vehicle to travel at lower speed and
even if a vehicle can not be stopped in the available distance during an emergency, the
With this objective in mind, the Vehicle Speed Monitoring System is designed and
developed in this project to monitor a vehicle speed and to determine if the vehicle has
exceeded the preset speed limit, where the speed limit indicates the maximum speed at
which the driver should drive under good road and traffic conditions. The system,
hereinafter referred to as the “unit” will be installed on the highway, with a screen to
The driver is expected then to reduce the speed of his/her vehicle and this will drastically
reduce the probability of road accident. The unit also has provision to record the violation
by taking a snapshot of an over-speeding vehicle (with the license plate number) and this
data can be readily available to the law enforcement officers for necessary action.
The advantage of this system is in its ability to come handy for the highway traffic police
as it will not only provide a digital display in accordance with a vehicle’s speed but will
also in an attempt to erase any possible deniability, capture an image of a vehicle (with
3
the associated plate number) if the vehicle exceeds the permissible speed for the highway.
The proposed system will check on rash driving by calculating the speed of a vehicle
using the time taken to travel between the two set points at a fixed distance. A set point
which are installed on either sides of the road. The speed limit is set by the police who
use the system depending upon the traffic at the very location. The time taken by a
vehicle to travel from one set point to the other is calculated by a control circuit. Based
on that time, it then calculates the speed and displays that on an LCD. This concept can
the vehicle in violation and a GSM module to transmit same, along with the captured
image to the traffic authorities. The system through careful adjustment can also be very
The aim of this project is to develop a vehicle speed monitoring system for use by the
In order to reach this aim, the following objectives have been established:
iii) To develop a system with the ability to capture the image and identity (license
plate number) of a vehicle that has exceeded the preset limit, display
‘OVERSPEED’ warning alert and record these data for future use
4
The system has been designed assuming that the maximum permissible speed for
The entire implementation requires two sets of IR transmitter (LEDs), and IR detector
(receiver), a control circuit and a camera module. The two pairs of IR transmitter and
detector pairs are installed on the highway 100 meters apart, with the transmitter and the
detector sensor of each pair on the opposite sides of the road. The system is designed to
detect an intrusion, (vehicle movement) intercepting the first LED. This intrusion is
detected by the first infrared sensor. The time taken by the vehicle to travel from this set
point to the other is calculated by the control circuit. To achieve this, the control circuit
activates a timer after the first intrusion was received in order to know how long it takes
before it received a new intrusion. Thereafter, it uses this ‘time’ and the distance between
of the two transmitters and the receivers (100m) to calculate the speed (distance/time)
and displays the value on an LCD. For each vehicle, the control circuit compares this
speed value with a preset maximum (allowable) speed, usually set by the police who use
the system depending upon the traffic at the very location. If this computed speed is
greater than or equal to the set speed limit, “OVERSPEED” is displayed on the LCD
alongside the over-speed value. Moreover, a camera is instantly activated to capture the
image of the vehicle with such details as the license plate number, the vehicle make and
colour and where possible, the driver behind the wheel for use eventually as evidence by
5
1.4 Significance of the Project
Although most Nigerian highways have signboards indicating maximum speed limit
which the motorists are not permitted to exceed for the sake of the driver’s safety and that
of the general public, a good number of road users do not obey the highway speed limit.
Consequently, accidents keep occurring due to speed violations since the drivers tend to
ignore their speedometers. This was even compounded by the fast growing traffic
population in Nigeria, with no means to control or monitor the speed of vehicles plying
the highways. To overcome this problem and decrease death rate due to accidents,
This speed monitoring system as a home grown solution will come handy for the
highway traffic police as it will not only provide a digital display in accordance with a
vehicle’s speed but also capture and record the image of any vehicle that exceeds the
permissible speed for the highway. This system is highly effective in detection of over-
speed driving.
Again, the system is considered economical compared to the (speed limiter device)
solution currently used in the country since the road users are not required to pay for its
installation.
This work is presented in five chapters to properly detail the steps involved in its
implementation.
Chapter 1 (Introduction) gives a brief overview of the general idea behind the project.
Design objectives, and the overall significance of the project are also explained in this
chapter.
6
Chapter 2 (Literature Review) provides a more specific documentation of the concepts,
theories and issues most fundamental to the project. History, definitions, features as well
as applications of the system as articulated by earlier researchers on the subject matter are
Chapter 3 (System Design) features the steps and methodology used to design the system
this chapter, processes involved in the implementation, testing and results are also
discussed extensively.
Chapter 5 (Cost Analysis, Conclusion and Recommendation) presents the analysis of the
cost involved in the project implementation and the succinct summary of the whole work.
Apart from that, suggestions for future improvement of this project were discussed.
7
CHAPTER TWO: LITERATURE REVIEW
A number of vehicle speed monitoring and tracking systems exist in the market, most
notably the Light Amplification by Simulated Emission of Radiation (LASER) speed gun,
Radio Detection and Ranging (RADAR) speed gun, speed camera system and fleet
monitoring system. In the developed world, law enforcement in the last decade has
based vehicle tracking system to catch speeding motorists and improve road safety as
well as for fleet management applications. These newer technologies are likely to
supplement rather than replace traditional speed monitoring and tracking systems.
A radar speed gun is a device used to measure the speed of moving objects. A radar
speed gun is a Doppler radar unit that may be hand-held, vehicle-mounted or static. It is
used in law enforcement to measure the speed of moving vehicles and is often used in
professional spectator sport, for speed measurement of pitched baseballs, runners and
tennis serves (Marshall, 2000). In the USA, the National Highway Traffic Safety
Excessive speed increases the likelihood of crashing and the risk of severe injury in a
crash.
In 2005, more than 13, 000 lives in USA were lost in speeding-related crashes, reducing
countermeasure to reduce speed and lower crash risk (Boos, 2009). Therefore the radar
speed gun has been employed to curb the over speeding problem.
8
On the other hand, Automatic Vehicle Location (AVL) using GPS is a means for
point where it can be stored and used with certain software and database applications
connected to a network and the server acts as the gathering point where data is received
and stored in a database. Most commonly, vehicle location is determined by using a GPS
device, and the transmission mechanism of the data is a satellite, terrestrial radio or
cellular connection from the vehicle to a receiving satellite, radio receiver, or nearby cell
tower. Originally designed for fleet management, AVL systems have been in use for over
20 years to increase the accountability of field personnel and boost the efficiency of
intelligent geographic data and situational awareness. The added information of vehicle
decision making and asset management. The aggregated information makes the system
extremely useful since the data is updated on a minute by minute basis to provide real-
The use of this technology can support many activities such as fleet management,
The challenge with the existing systems like the radar speed gun is that they work where
9
In Nigeria, this was never used as it is not affordable and it is also expensive to deploy
traffic officers on every road and later on avail each one with a speed gun. However, as
one of the countries topping the global chart for the highest rate of road accidents,
Nigeria through the efforts of successive governments had adopted some of these
technologies in the past aimed at increasing the road safety on the highways.
For instance, GPS based vehicle speed tracking has been in use in the country since early
19th century. Based on the findings in the literature, this vehicle speed tracking and
reporting system (GPS) was more efficient than the radar speed gun because it could be
used at every point to report over speeding using GPS enabled systems having the right
application installed. The problem with the GPS speed tracking though is that it was not
centrally controlled by the government, but mainly private sector driven in which only
those interested subscribed for it. Consequently, it did not solve the problem as numbers
But in a more determined effort to further curb the menace, the present administration
introduced the current speed limiter solution in 2016. The solution was adopted because
of its perceived success in other leading countries in Asia and Europe. Although the
concept of SLD (Speed Limiter Devices) was largely criticized because of its high cost of
installation on commercial vehicles owners’, it was said to have successfully reduced the
number of road accidents and consequently, deaths and loss of properties since its full
the Corps Marshal of the Federal Road Safety Corp, Dr. Boboye Oyeyemi, in a Vanguard
publication of 22nd January, 2018 disclosed that the corps recorded fewer road accidents
in 2017 compared to 2016. According to the FRSC boss, 161 fatal accidents occurred in
10
2017 against 196 recorded in 2016, a reduction by 18 percent. In the same vein,
reductions of 33 percent and 43 percent respectively were recorded in serious and minor
accident cases during the periods, representing 31 percent reduction. According to him,
5,993 people were involved in various road traffic accidents in 2016, but reduced to
4,418 in 2017. The difference of 1,575 in reduction in the periods under review which he
said, represents 28 percent can be attributed largely to the use of speed limiting devices
which by design, closes the fuel supply to the engine of any vehicle that exceeded the
On the other hand, a number of issues had also been raised against the use of SLDs which
ranges from economic to technical compatibility problems with the electrical wiring and
engines of the vehicles in which they are installed. Those issues necessitated the need to
try the current solution covered in this work, which not only removes the burden of
payment for installations from the vehicle owners, but also eradicates the compatibility
maintenance, will result from a better understanding of some basic theories and concepts.
One of such theories to be considered here briefly is the ‘vehicle speed measurement’
which is achieved through the speed sensors and the speedometer. Such consideration is
Since the early years of the automobile, a need to monitor vehicle speed has evolved. As
vehicle speed increased and roads improved, the main objectives of a speedometer were
11
to allow the driver to accurately view the vehicle speed, possibly to avoid a speeding
ticket, and to be able to read the odometer to verify how many miles were on the vehicle.
Most speedometers operated off the rear driveline but some used a front wheel as its
input (Jurgen, R. 1994). This method was calculated by gear ratio, tire circumference and
somewhat averaged how fast the vehicle was traveling. Later, when a vehicle had a
different rear axle ratio installed or when different profile tires were used, the process of
matching the plastic "speedo" gears was used to ensure accurate speed. This system of
measuring speed did not have the capability of comparing individual wheel speed
differences between two wheels like found between the inside and outside wheels during
a turn. This technology is still with us today, but modern vehicles mostly rely on
The operation of most speed sensors is similar and might fall into one of three categories:
the use of modern speed sensors, today's vehicles utilize this technology not only to
monitor vehicle speed, but also to monitor component position or rate of speed change on
virtually any moving part of the automobile. They can be mounted on the vehicle in a
variety of locations to perform different tasks. The variable reluctance wheel speed
sensor is basically a permanent magnet with wire wrapped around it. It is usually a simple
circuit of only two wires where in most cases polarity is not important. The physics
behind the operation include magnetic induction. A toothed ring on the wheel passes by
the speed sensor and disrupts this magnetic field. The disruption in the field causes the
wheel speed sensor to produce a sinusoidal voltage signal. The frequency and amplitude
of the voltage signal are proportional to the speed of the wheel. The amplitude of the
12
wheel speed signal is also directly related to the distance between the wheel speed sensor
Magnetic speed sensors rely on a magnet as the sensing element to capture rotational or
linear speed (Silva, C. 1989). They are typically used as gear tooth speed sensors or
incorporated into stroboscopes or tachometers. The technology types for magnetic speed
sensors include magneto resistive, inductive, variable reluctance and Hall Effect. In a
magneto resistive sensor the resistance of the sensing element is a function of the
circuit generates a radio frequency electromotive force that radiates from a ferrite core
and coil assembly. The field is directed at the sensor face. When a metal target enters the
field, eddy currents are induced into the surfaces of the target. This causes a reduction in
the amplitude of the oscillator circuit and change in inductance. Variable reluctance
speed sensors are typically self-generating and require no external power. When a
magnetic surface is passed in close proximity to the sensor, a small voltage is induced. In
developed. This Hall voltage is proportional to the applied field intensity, driving the
Analog variable reluctance speed sensor is a passive sensor and requires no outside
power source (Webb, J. and Greshock, K. 1993). The sensor generates a sinusoidal output
voltage proportional to target speed and air gap. Analog signal is generated in response to
fluctuation in magnetic field resulting from interruption by ferrous targets. This sensor
can be configured for use in very high temperatures and high speed. The output voltage,
13
depending on air gap and the target surface speed, ranges from a few milli-volts at the
slowest target surface speed to several volts at the highest target speed.
The Delta speed sensor is an inexpensive, non-contact Doppler radar speed sensor
suitable for a wide variety of speed measurement applications (GMH Engineering, 2003).
Small size and lightweight as well as requires only a small power source, making it useful
moving vehicle to measure vehicle ground speed. It also may be fixed in a stationary
mounting to measure the speed of a moving object, which can be anything from a wire
passing under the sensor to a vehicle a thousand feet away. The output of the sensor is a
pulse with frequency proportional to measured speed. The cumulative number of pulses
may be used to determine distance traveled or the length of a moving surface. Besides, it
can be used with many different types of electronic hardware, such as timer, counters or
digital tachometers, and can be integrated into electronic control or data acquisition
systems.
2.2.2 Speedometer
Regular car speedometers can never know the exact speed of a vehicle without knowing
how quickly the wheels rotate combined with the precise circumference of the tyres.
Optical speedometer system is installed on the underside of the car, seeing the surface of
the road move beneath it and determines the speed of the car as well as the mileage
(Clausage, 2002). But using this system to calculate mileage might be easily foiled by a
mounted sheet, to fool the system into thinking the road is not moving, thus stopping
mileage increment.
14
Vehicle navigation using the Global Positioning System (GPS) has been of increasing
interest over the past decade and GPS navigation is frequently installed in today's high-
end luxury cars and in many commercial vehicles. Deductive reckoning is one method
widely used in vehicle navigation (Analog Devices, Inc., 1995). It utilizes three distinct
inputs to predict position: a set of starting coordinates, the direction of travel, and the
speed of travel. The ADXL202 dual-axis accelerometer can be used to develop accurate
speed estimates for this navigation system. The method for determining velocity uses an
accelerometer to sense the time interval for both front and back wheels to encounter a
bump in the road while moving straight ahead. Whether one is driving on a local road or
a highway, there will always be imperfections in the road. These imperfections translate
into bumps and jolts sensed immediately by the car's wheels, and ultimately by its
passengers. In order to track the speed by sensing these bumps, an accelerometer is used
This project was designed using both active and passive devices such as resistors, diodes,
transistors, ICs, capacitors, inductors, transformer, oscillator and hosts of others. The
Passive devices have been described as those electronic components, which do not
require power to be supplied in order to make them work. Examples as used in this
design are resistors, inductors, diodes and capacitors. Active components on the other
hand, are those that are required to be powered in some ways to make them work. Such
components as used in this design include transistors and integrated circuits (ICs). Active
15
2.3.1 Crystal oscillator (4 MHz)
high frequency or that, which generates an ac output signal without requiring any
externally applied input signal. A number of different forms of sinusoidal oscillators are
available for use in electronic circuits, the choice of which is dependent on:
There exist tuned-circuits or LC feedback oscillators (e.g. Hartley, Colpitts, and Clapp),
(e.g. tunnel Diode Oscillator), Crystal oscillators (e.g. Pierce oscillator) and Heterodyne
For this design, a 4 MHz piezoelectric crystal oscillator was selected because of the high
desire for frequency stability of the system coupled with other economic factors (e.g. low
cost and compact size). Its main function here is to provide a clock input to the control
circuit. Like in this speed monitoring system, crystal oscillators (shown in figure 2.1) are
receivers.
16
R
L Cm
An LCD display, which is connected to the control board through the LCD display port,
is used to display time, speed information and over-speed warning. For this design, a
16x2 LCD model was used (16 columns and 2 rows) which means it can display up to 32
characters with 16 characters in each row (i.e. 16 characters per line and there are 2 such
lines). This was enough to accommodate the characters contained in the display warning
alert ‘OVERSPEED’ which is made up of 9 characters and the only two display
The following reasons favored the choice of LCD as a preferred display option for this
iii) LCD displays output in a much brighter image than CRT displays
17
iv) They are very compact, thin, and lighter than CRT displays
ii) Power consumption: LEDs though have better view, are not suitable for
usage with batteries because of their high power consumption. The control
character generator and as such, is the best option for circuits that operates
on battery (has the ability to generate character for display with battery
power). Consequently, LCDs consume less power and has definitely best
microcontroller has less output pins available for driving multiple LEDs)
iv) Character display capability: LCD modules are able to display more
complex characters than is available with the LEDs. As the latter has on 7
digits and above, LCD modules are used. The ability to display text and
custom characters is pretty useful as some LCD modules even allow for
18
2.3.3 PIC16F876A Microcontroller
microcomputer with CPU, memory and peripherals all in a single chip is to save time and
space needed for construction of other devices. Since using this dedicated controller, no
other external components are needed for its application (all necessary peripherals having
already being built into it) the system complexity is reduced by limiting the large number
Some of the commonly used microcontrollers are Intel MCS-51, MCS-96, Atmel 89CXX,
The 16F876A from the PIC’s family has been chosen as the microcontroller for this
development platform (see diagram in Appendix III). This 8-bit microcontroller which
uses CMOS technology was selected over members of other families of microcontrollers
iv) Has a total number of 40 pins and up to 15 output pins for external connection
vi) Can be write-erase as many times as possible because it uses FLASH memory
technology
19
viii) 8 channels of 10-bit Analog-to-Digital (A/D) converter
ix) Very flexible to use even in areas where micro-controllers have never been
All of these features make it ideal for more advanced level A/D applications in
Monitoring System.
Infrared sensors are also capable of measuring the heat being emitted by an object and
detecting motion of the object. In this design, the sensor which consists of a pair of IR
LED and IR Diode (or detector) functions as an emitter and detector of infrared radiation.
The basic concept of an Infrared Sensor which is used as Obstacle detector is to transmit
an infrared signal, this infrared signal bounces from the surface of an object and the
signal is received at the infrared receiver. Vehicles movements in this design will be
detected as obstructions when they intercept the continuously glowing Infrared waves
Although other alternatives abound for achieving this arrangement such as the use of
Laser Diode as transmitter and Light Dependent Resistor (LDR) as the receiver, the
choice of IR LED - IR Diode detector pair in this case was influence by the fact that:
20
ii) Laser beams are rather highly coherent (straight and parallel) rather than
divergent (incoherent) which makes it non ideal for this application (requires
iii) LED consumes moderate amount of power over time than diode lasers, which
iv) LED has higher output pattern and easier to use than Lasers
vii) The LED is generally a more reliable and robust device than a semiconductor
laser (uses far lower current densities and lower optical power densities that
is a light emitting diode (LED) that is used in order to transmit infrared signals from a
remote control. In general, the more they are in quantity and the better the emitters are,
the stronger and wider the resulting signal is. An IR emitter generates infrared light that
On the other hand, an infrared detector is a pyro-electric sensor that detects the light
spectrum’s infrared wavelength. It is used in this application to detect the radiation which
is focused from the IR LED and was so chosen (instead of the more commonly applied
is required unlike the case with TSOP1739 which must operate at the same frequency as
21
+5V
IR LED IR Diode
Tx Rx
R1 R2
Output
The abbreviation LM358 indicates an 8-pin integrated circuit, comprising two operational
amplifiers at low power. Therefore, LM-358 consists of two independent high gain
they are specially designed to operate from a single supply or split supplies over a wide
range of voltages. Features include wide supply ranges, low supply current drain,
independent of supply voltage, wide unity gain bandwidth, ground includes I common
mode input voltage range, low input bias, open loop differential voltage gain, internally
frequency compensation etc. LM 358 has a lot real life applications e.g. Operational
available in a small size chip. It is most commonly used device due to its cost efficiency.
22
+VCC
R1
VIN +
A
VREF -
VOut
R2
0V
-
Fig.2.3 Circuit Representation of a typical differential comparator
input and an analogue output, such that if operated in its open-loop configuration its
In this design, the LM358 operates as a comparator (electronic decision making circuit),
i.e. functions only on its open-loop state (without a feedback mechanism). In this way, it
will compare voltage levels at its two terminals (in which one terminal is fed with the
reference input voltage and the other is fed with the actual input voltage) in order to
generate the required output voltage signal as either 0 (low) or 1 (high) based on the
23
Although there are many more recent op-amps with considerably good performance, such
as LM741 and LM311, the choice for the LM358 in this application is based on the fact
that:
A voltage regulator is an integrated circuit (IC) that provides a constant fixed output
voltage regardless of a change in the load or input voltage. A linear voltage regulator
works by automatically adjusting the resistance via a feedback loop, accounting for
changes in both load and input, all while keeping the output voltage constant.
There are a number of types of voltage regulators that range from very affordable to very
efficient. The linear voltage regulator is considered ideal for the purpose of this project
being the most affordable and often the easiest type of voltage regulator to use.
LM7805 is a three-terminal positive regulator with a 5V fixed output voltage. The name
7805 signifies two things, “78” means that it is a positive voltage regulator and “05”
means that it provides 5V as output. Because the present design is based on 9V battery
source, this fixed regulator was used to provide a local regulation to the desired 5V,
internal current limiting, thermal shut-down control, and safe area protection for other
24
components (in the project) using that voltage. Like any other voltage regulators, the
LM7805 can output a max current of 1.5A and is available in TO-220 and KTE package
The NPN transistor is one of the Bipolar Junction Transistor (BJT) types designed to pass
electrons from the emitter to the collector (so conventional current flows from collector
to emitter). The emitter “emits” electrons into the base, which controls the number of
electrons the emitter emits. The NPN transistor is mostly used for amplifying and
switching the signals. To be used as switch (which is the case in this application),
the transistor conducts current across the collector-emitter path only when a voltage is
applied to the base. When no base voltage is present, the switch is off. In this design
therefore, the C828 (NPN) transistor (available in a three terminal chip) was used
to control the high-power LED from the IR sensor and switch ON the microcontroller
(for time counting) during an intrusion. When no intrusion occurred, the transistor
switching function is deactivated (since there’s no voltage input) and consequently, the
microcontroller turned OFF. In other words, the control input flows into the base, the
output is tied to the collector, and the emitter is kept at a fixed voltage.
2.3.8 Relay
Relays are switches that open and close circuits electromechanically or electronically.
They control one electrical circuit by opening and closing contacts in another
circuit. Relays exist in two common configurations: Normally closed (NC) and normally
open (NO). Relays are used in this design to switch ON the camera, enable it for image
25
2.4 Distinction between Old Design Approach and the New Ones
Early speed monitoring systems used analog auxiliary devices to detect a vehicle moving
on the road. However, with improvement in technology, the modern system is digital and
microcontroller based. The approach employed in the design of these early systems is
quite different from that employed in the design of today’s enhanced systems. This is
because; the former is characterized by large complex circuitry, resulting from use of
large number of analog components. Implementation was also tedious, costly and
bulky and inefficient as it is prone to issues and requires steady maintenance. Most
components used in the design of the modern systems are normally on chip; consequently
a more simplified design approach is required. The approach in the design of these new
systems is more simplified than that used in the old design. In other words, the presence
of microcontroller (and other digital components) makes for digital processing of data
In addition to this, the microcontroller helps to regulate (control) the rate at which the
data is processed before they are displayed, stored or even transmitted to the remote
destination. This digital implementation increases the reliability of data received as well
as minimizes errors in the operation of the whole system. It is also cost effective.
Also with the modern system such as the current project, it is easy to use a camera
module to capture the speed and identity of over-speeding vehicles. Such information can
also be transmitted for further processing through a TCP/IP wireless (radio) link to a
remote destination unlike the old design approach, which was completely analog.
26
CHAPTER THREE: SYSTEM DESIGN
For this system to achieve the objective for which it is designed (stated earlier), the
v) The distance of separation of the two pairs of IR transmitter and detector must
be at least 100m
vi) The maximum permissible speed for the highways must be 100 km/h
viii) Pins 9 and 10 of the microcontroller must be hooked to the crystal oscillator of
ix) The differential op-amp must be LM358 linear comparator IC for the sake of
precision.
viii) The power supply unit must obtain a dc output of +5V from IC linear voltage
regulator (7805)
The vehicle speed monitoring system comprise of the following five independent but
27
Logical
Control Module Display
Sensor
Module Module
Camera
Module
Power
Supply
transmitter (LED) and an IR detector (Diode). According to this project, two IR sensors
are placed apart with a fixed known distance. Whenever IR rays are interrupted by a
vehicle during first sensor the count up timer is started. When the other IR sensor senses
the presence of vehicle, the count up timer is stopped. And the distance and time the IR
receiver receives the IR signals is noted by microcontroller from where the speed is
As will be seen later, the IR sensing will be implemented further through a combination
responsible for generating the required voltage input to drive the control circuit and
28
IR Sensor Comparator Transistor
Figure 3.2 is a modified block diagram representing the system, with the sensor unit
separated into two IR transmitters and detectors. Although not shown, between the IR
detectors lay the comparator (Fig. 2.3) and the transistor that help to actualize the
implementation.
16x2
LCD
IR-TX IR-RX
1 1
MICRO
CONTROLLER
(PIC16F876A)
IR-TX IR-RX
2 2
+5V DC
Power
Supply
Camera
Module
29
3.2.2 Control Unit
This block consists of a microcontroller whose function is to control the activities of the
vehicle speed sensor and indeed that of the whole system. The output current from the
sensor block (through the NPN transistor acting as a switch) is usually fed to the
microcontroller via its special ports 21 & 22 (see Appendix IV). It contains real time
software embedded in it to enable the timer counter, speed calculation and release of the
output signal in the form of pulses via its output ports to the display or camera blocks for
further processing. For outputs to the LCD, the microcontroller reverses pin 23 to 28
whereas pins 18, 16 and 17 are dedicated to activating the camera for image capture, save
In this design, C programming language was adopted with MikroC as the compiler. C
language was chosen because of the following inherent advantages over other related
iii) Due to low-level language support, it was possible to write directly to memory
vi) It was easy to manipulate data types by using ‘change declaration’ function
vii) Local libraries helped to save memory, and hide (vital) information
Similarly, MikroC (Appendix V) was also selected as the compiler over (MPLAB)
because it has proven to be the best for LED and LCD interfacing with the PIC16F876A
30
microcontroller which is desired in this design. This is largely due to the presence
of built-in libraries of MikroC. Besides, it is user friendly and provides lots of useful pre-
This module represents the visual display unit, where the speed value and over-speed
warning text are displayed a liquid crystal display (LCD). Depending on the logic state of
the input signal to the microcontroller, this module is driven by the output of the control
block. As a vehicle approaches, the control circuit measures the speed and consequently
feeds it to the LCD to be displayed numerically. It further compares this speed value with
The block consists of a digital camera with secondary storage medium (such as SD card)
embedded. The module, which was lifted from a mobile telephone handset and integrated
unto the system will be responsible for taking a snapshot of any over-speeding vehicle
(with the license plate number) as classified and directed by the control block. Three sets
capture an image, save the image and reset for a new task. To achieve this (that is,
perform these functions automatically), activation currents were drawn from the
respective function keys (from a telephone key pad). The three relays were then each
attached to the three keys, so that by opening or closing of the relays (depending on the
logic state of the input signal) the functions of the keys are automatically performed as it
31
would have been the case with normal human operation of the camera on the phone (see
Appendix VI)
This block is responsible for power supply to the individual components of the system.
site with no wall socket, a mobile power supply is most suitable. Besides, in this design
and indeed most (if not all) electronic equipments, there is need for conversion from the
A.C to D.C. Use of battery power eliminates the need for such conversion. Since the
relays are 6V and +5V is needed for each of other components, a 9V battery was
considered ideal for this design. However, to bring the 9V to these desired lower levels of
voltage, a linear voltage regulator was used with the battery (see fig. 3.4). Also, since
higher currents are needed to power every component of the system, two of the 9V
batteries were connected in parallel for this purpose. This has little or no side effect on
7805
+5V
+9V +9V
C1
GND
32
3.3 System Design Development
For most of the blocks in this design, integrated circuits were used. References to the pin
configurations and their functions for these ICs can be made in Appendix VII. These ICs
design since they are already on-chip. This helps to simplify the system as not much of
The infrared sensor part of this design is only responsible for transmitting and detecting a
steady infrared radiation. The circuit was achieved with the help of the following
components:
v) Variable resistors
The IR LED (Light Emitting Diode) is simply the emitter of infrared radiation whereas
the IR photodiode is the detector which is sensitive to IR light of the same wavelength as
The comparator and the transistor are needed because the detected IR radiation cannot be
passed directly to the microcontroller based control circuit. The comparator is needed to
produce the right level of voltage signal required to bias the transistor correctly, which in
turn switches ON/OFF the control circuit in order to activate the desired functions.
33
+5V
1 mΩ 1K
IR
Diode 1
+ 8
3 …To NPN
1 Transistor
LM358
1 mΩ 2
- 4
1K
+5V
1 mΩ 1K
IR
Diode 2
+ 8
5 …To NPN
Transistor
7
LM358
1 mΩ 6
- 4
1K
34
Fig. 3.5 shows the pair of IR sensor circuit. As will be seen later in the description of
operation, IR light falling from the emitter on to the first IR diode is constantly detected
by the photodiode until it is intercepted by a vehicle movement. Until this first intrusion
the diode as a result of the falling IR. However, as soon as there’s an intrusion, resistance
begins to vary in proportion to the magnitude of the IR light bouncing off the surface of
the photodiode (1K) and this leads to a corresponding variation in the output voltage. It is
this output (Vout) which is available at the PIN1 of the first comparator that sets in motion,
switching of the microcontroller by the NPN transistor to begin counting of the time
elapsed before the next intrusion is received. The process is also the same for the second
intrusion which occurs when the IR light falling on the second photodiode is intercepted
by the vehicle in question. However, the only difference is that output voltage this time is
As with comparators, the output is a digital signal, having only two states (1 and 0 or
HIGH or LOW). It is a HIGH (or a 1) if the analog (varying) input voltage (V in) at the
non-inverting input terminal (+) is greater than a specified reference threshold (Vref) at
the inverting input terminal (-).Conversely, if the varying input voltage (being measured)
is less than the specified threshold, the output will be a LOW (or a 0). The comparator
simply uses the difference between Vin and Vref to determine the Vout, whose digital state
35
Without intrusion, the reference voltage (Vref) = 0V
So that using voltage divider rule, the analog input voltage to the non-inverting terminal
With Vcc = 5V, R1 = R2 = 1mΩ = 10-3Ω and substituting in the above gives:
= 2.5V
Now, since Vin is greater than Vref (2.5V> 0V) or put in another way V(+) is greater than
V(-), the output voltage (Vout) swings to the voltage supply at the positive rail (+Vcc). That
is, Vout = V(+). This output represents digital output bit 1 (or HIGH).
With intrusion, similar procedure is followed to determine the state of the digital output
of the comparator. However, the negative voltage supply rail is used in this case.
In other words,
= - 2.5V
Since Vin is less than Vref (- 2.5V< 0V) or put in another way V(+) is less than V(-), the
output voltage (Vout) of the comparator swings fully to its negative supply rail (-Vcc ).That
is, Vout = V(-) which represents digital output bit 0 (or LOW). This output was adopted as
the choice input voltage to bias NPN transistor in the switching circuit.
36
(B) Design of the Switching Circuit
In this design, the BJT transistor (C828) was configured to operate on the switching
mode. In this mode, switching operation is performed based on the voltage applied at the
+5V
K
10K 21
c RBO
10K
Vin NPN
b K 10K
e
+5V
K
PIC16F876A
+5V Microcontroller
+5V
K 10K
10K
22
RB1
c
10K
Vin
NPN
b C1
K 9
e
10
C2
37
The idea is to prevent current from flowing from the collector terminal to the emitter
when the LOW (or 0 bit) voltage output (signifying intrusion) from the differential
comparator is applied to the base-emitter input of the transistor. Consequently, the emitter
is completely switched off (open circuit) as no current flows through it (0V). The
available current flows through the base-collector terminal (negative) where it is used to
energize or activate the microcontroller (through the specified interrupt port RB0/RB1)
for the time counter. Two LEDs are each attached to both transistors to show when the
circuit is ON or OFF. Resistors are also placed to limit the currents through the base and
the LED so that it becomes possible to vary the intensity of LED by varying the
When VCE = 0, current through the collector terminal of the transistor was determined
from:
Ic = 5V/10kΩ
= 0.0005A or 0.5mA
where β = transistor current gain (between 20 and 200 for most general purpose
38
From the above calculations, the maximum or peak value of the collector current in the
circuit is 0.5mA when Vce is equal to zero. And the corresponding base current to which
collector current flows is 4 µA. So, it is clear that when the base current is increased
beyond the 4 micro amperes, the transistor comes into the saturation mode in which the
collector base junctions are forward biased and current flows freely from collector to
On the other hand, when zero volts is applied at the input, this causes the base current to
be zero and as the emitter is grounded, emitter base junction is not forward biased.
Therefore, the transistor is in OFF condition (cutoff) and the collector output voltage is
equal to 5V.
= 5V – 0
= 5V
Thus, this way, the transistor keep switching ON and OFF the control circuit to take the
necessary action as intrusions enter and leave the Infrared radiation zone
39
(C) Design of the Camera Circuit
The camera block was implemented using (three) electromechanical relays and a mobile
cell phone equipped with a camera and a Secure Digital (SD) card. The camera activation
button, images capture button and the reset (go- back) button of the phone keypad were
mapped respectively (by wire connection) to the first, second and third relays as shown in
10K Set
18 NPN P
b K
e N/c
+9V
PIC16F876A
Microcontroller
N/o
10K Capture
17 NPN P
b K
e N/c
+9V
N/o
10K Reset
16 NPN P
b K
e N/c
20
+9V
+5V
40
Thus, as intrusions for over-speeding vehicles are received, these functions are
automatically performed as though the system was guided by human operator. This was
made possible through careful programming of the microcontroller, which causes these
specified phone keys become activated and pressed on receiving appropriate signals. The
relays help to isolate the microcontroller and phone circuits from electrical signals.
The general operation of this system is represented logically on a flow chart as shown.
Start
Counter 1 starts
Counter 1 stops
Measurement of speed
Speed ≥ Limit?
Limit Yes
End
41
The infrared radiation generated by the two IR transmitters (LED) is continually detected
by the two IR receivers (IR sensors). Resistance remains LOW and consequently, the
voltage at the non-inverting terminal of the op-amp remains less compared to the voltage
When a speeding vehicle approaches the first LED, the IR is blocked from reaching the
first receiver. This causes variation in the resistance, which now becomes HIGH. This
consequently increases the voltage at the inverting terminal of the op-amp with respect to
the non-inverting terminal. This negative output of the comparator is fed to the base of
the BJT transistor (C828) in order to forward bias it, thus producing 5V output voltage at
which sees this interruption as an intrusion, immediately activates (or starts) the counter
When the vehicle intercepts the LED of the second IR transmitter, the same process is
repeated, but the microcontroller will understand the interruption (received via
Next, the microcontroller calculates the time between when it received the first and the
second intrusions and uses it to measure the speed (over the distance passed). It then
compares the measured speed of the vehicle to a preset limit (100Km/h) in order to take a
decision. If the speed is higher or the same as the set limit, the microcontroller sends the
measured speed value through its output pins (23-28), to the LCD display with an
attached text that reads ‘OVER SPEED’. This warns the driver of the vehicle that he or
she is in violation of speed limit. The microcontroller almost at the same time engages the
42
relays to get the camera set, press the image capture button and reset to normal for
another round.
On the other hand, if the measured speed value is less than the set limit, only the speed
value is displayed on the LCD. Because the speed is not exceeded, ‘Over speed’ text is
43
CHAPTER FIVE: IMPLEMENTATION, TESTING AND RESULT
4.1 Implementation
The components of universal transistor tester were tested one after the other. After testing
of the components, they were mounted on the breadboard. The system’s unit or sections
were then tested on the breadboard using logic placement of transistor and other
components polarities. After the correction of these encountered problems, the system’s
units or sections were then transferred to the Vero-board for a permanent connection. The
integrated circuit clips were mounted on IC socket for easy accessibility and protected
against thermal runaway during soldering. The LCD display common anode type was
connected with 16 pins IC socket to enhance easy mounting on the project casing.
After the test of various functional units, it was packaged. In packaging, many options
were available two of which stood out: packaging with laminated plywood or packaging
with plastic. For this project, packaging with a plastic box was considered suitable
because of the following: durability, portability, polished finishing and insulator material.
The size of the tester was dependent on some factors such as the size of the circuit board
used. The package eventually has to be reasonably larger than the circuit board in order to
This first stage of testing was conducted at the component level to help avoid soldering
bad components into the circuits. This also helps in determining the actual pin assignment
of any of the components. For example, if a transistor is to be soldered, the emitter, base
and collector must be noted to avoid making mistakes. The emitter, base and collector of
a transistor can easily be determined by checking the respective resistance of each pin. A
44
digital multimeter was used to carry out the testing. So, at that stage the components were
tested with respect to their respective features and they all gave positive results.
After the components testing, the system was tested module by module as specified in the
circuit diagram. During this time, various tests on the project were carefully carried out
without the power supply. Firstly, was to check through the system to ensure that the
wired circuit connection was properly done before powering it (continuity test). However,
as a result of careful attention paid during the design and implementation stages, few
errors were discovered present, which were subsequently corrected and changes effected
immediately.
Secondly, after the visual inspection and testing without the power supply, all the ICs
were then mounted on their respective bases, module after module. The circuit was then
activated by connecting it to the 9V dc (battery) power supply which was then regulated
to +5V by the linear voltage regulator (LM 7805) needed for the appropriate functioning
of the basic design components and relay units. A digital multi-meter was connected
between the positive and negative terminals of the battery to ensure that the expected
At the modular testing level, the IR sensor was first to be tested. By passing a hand
swiftly across the sensor and having the LED automatically turned off when the receiver
was shielded from the IR, it was confirmed (as expected) that the transmitter was
continuously emitting infrared radiation and that the detector is sensitive to the rays.
After testing of the IR sensor, the logical control module was tested. To do so, the LCD
was connected to the microcontroller and the intrusion test repeated. Display of data on
the LCD provided an evidence of serial data output from the logical control module as
45
expected. The camera module was tested last. It was observed that passing a hand at a
high speed, energized the relays which made several ‘clicking’ sound while activating the
camera to get set, take shots and reset for a new task. . The camera was disconnected and
the SD card contents checked. Photos were found in the SD card, indicating that the
A final test was performed on the system as a whole and better results were obtained
which convinces even the on-lookers that a better work was done. System integration
involved the connection of the different modules as designed in a circuit. After the
respective test of the individual modules, the whole circuits were integrated form the
system as drawn in the circuit diagram in Appendix IX. The integration was done with
the help of soldering equipment. At this stage I conducted a final stage test (real test) to
see if it will give the actual result (expected) as specified in the design objective. So, at
this point real time control software was burnt into the microcontroller before this test
Furthermore, during demonstration, a toy vehicle was used at different time intervals.
The corresponding speed values obtained (on the LCD) were as recorded in Table 4.1.
Time (Secs) 45 41 22 19 13 12 11 10 8 7 6
Thus, as evident from the table, a much higher speed was obtained when the vehicle was
made to cross the system at the least possible time. This describes a typical inverse
46
vehicle will take relatively short time to cross the system than it is the case with a vehicle
50
45
40
Speed (Km/h)
35
30
25 Series1
20
15
10
5
0
0 20 40 60 80
Time (Secs)
To simulate the behavior of the circuit and to verify these results, simulation software
was needed. Many of such programs exist such as CircuitLogix, XSPICE, Proteus,
TinaCloud, 123D Circuits etc. However, for this unique design, Proteus was preferred.
Proteus is simulation software for most electric circuits provided by Labcenter electronics.
It provides the type of platforms for simulation and designing of electric circuits, the
main platform being the intelligent schematic input system (ISIS). ISIS is used for
Proteus was preferred because its latest version which was used in this design, contain
built-in compiler to write codes for the PIC16F876A microcontroller. It also has built-in
libraries for the microcontroller. In addition to this, it is a graph based simulation and
47
works perfectly well with the LCD display and many other peripheral modules like LED,
Keypad, RS232 terminal, switches, push buttons, motors, LEDs, and lamps etc. To
implement this, two logic toggles were used with 0 and 1 representing normal and
intrusion levels respectively (Appendix X). Thus, the first intrusion was said to occur
when the first toggle was changed from 0 to 1. Almost instantly, the LCD displayed an
upward count of the time elapsed before the second toggle will change state (next
intrusion). If this next change occurs in one or two seconds after the first intrusion, an
invariably high speed is computed and displayed as ‘over-speed’. But if this change of
state is delayed like say for five seconds or more, normal speed will be computed and
In this project, much time was taken to research especially because of the integrated
camera function. I equally met people with much experience about hardware incorporated
with software and that made me not to float. Having been exposed on the aim of the
project by the supervisor, I set off for the design but along the line there were setbacks.
Indeed, I encountered many challenges. First, designing a speed monitoring system with
camera capability requires much expensive, especially as regards how correctly the
camera will pick up a vehicle with a very high speed if it resides within the same system
that processes the over-speed function. There were also the problem of how the system
could handle multi-lane highways and the routes in the built-up areas. But with the
permission of my supervisor, I was able to scale up these possible scenarios and moved
48
In addition, components availability was to some extent a challenge. Some of the most
essential ones were very scarce in the market and where often available, they are very
Moreover, after all the components were purchased and while implementing on the Vero-
board, some components got burnt due to wrong connections and other inevitable
There was also problems of component specification in the design calculation for which I
settled for the nearest available components specification. Much more, during testing and
results, there was problem with sensor sensitivity. The sensitivity of one of the IR
detectors was too high that ambient light affected its performance. Consequently, the
LED was going ON and OFF with respect to the brightness of the surrounding
environment. This challenge was handled by retuning the variable resistor attached to that
One of the two 9V batteries that provided the dc supply also developed issues during
testing and presentation. This caused a small malfunctioning of the system as not all
components were powered. But the problem was discovered by retesting both batteries
during which one was found to have dropped to the voltage of 5.6V. Replacing the faulty
battery solved the problem. When all these issues had been resolved, the system was
49
CHAPTER FIVE: COST, SUMMARY AND RECOMMENDATION
In actualizing the objectives of this design, both mental and physical energy were
realization of the project. The breakdown of costs incurred from the inception to the
11 Gift, demo and other items N 7,500 Including demo toy car
TOTAL N 73,500
Thus, analysis of above breakdown shows that largest amount was spent on material
expenses while the least was spent on less critical tasks. Though it was tough to raise
50
such amount, but the determination to make this project a success has being my
5.2 Conclusion
The purpose of this project from the beginning was to design an alternative system to
monitor speed violation in the Nigerian highway and hitherto, assist the traffic authorities
The principal objectives designed to achieve this aim included the design of a system
capable of measuring a wide range of vehicle speeds, has the ability to compare the speed
of a vehicle to a preset limit and capture and record the image and identity of a vehicle
that has exceeded this limit, after it has warned the driver of such a vehicle by displaying
‘OVERSPEED’.
To achieve this system, two sets of Infrared transmitters and receivers were each
designed and positioned at a distance apart of each other. A control circuit was then used
to measure the time taken by a vehicle to travel from one set of the IR
transmitter/receiver point to the other as it traversed the path. Based on this time, and the
constant distance of separation between the two points, the circuit was able to calculate
the speed of the vehicle and outputs the value on liquid crystal display attached to the
system. The system was designed to be able to successfully determine when a vehicle has
exceeded the allowed limit by employing the control circuit to compare the measured
vehicle speed value to the preset limit. This way, it can warn the driver by displaying
‘OVER-SPEED’ on the LCD and goes further to capture and store the image and identity
51
The result of the simulation and testing of the model showed that the above design
objectives were joyfully realized as the system was able to successfully monitor speed,
determine when over-speed had occurred, issue a warning alert, and capture and save on
While not ignoring the fact that the design of such a system has been thought provoking
and unavoidably challenging, it is pertinent to state herein that it greatly afforded me the
opportunity to put into real practice some of what I had learnt as a student Engineer in
5.3 Limitations
It should be noted that only a very short distance of 100m between the set points were
used as a test case in this work. Whether the system will still realize those objectives over
Moreover, the design applies to a single-lane highway. How this can apply in a multi-lane
scenario was not covered in this work. But the author believes that a suitable upward
scaling can give results that are acceptably close, if not the same as the current design.
It is also worth mentioning that the control circuit may experience delay in capturing the
image and identify of a vehicle on a very high speed due to the short distance of
5.4 Recommendation
It is always difficult to determine a perfect system to control any social problem without
Nigeria is a unique country with its own uncommon problems. One of those problems is
the poor state of the roads especially the highways which has contributed to the
52
increasing rate of fatal accidents. So, any system designed to be used on Nigerian roads
must take into account the conditions of the roads. Another very important factor is
poverty. A solution may be perfect for the Nigerian situation, but unacceptable if it is
uneconomical. In fact, it was widely believed many Nigerians were left more
impunity and corruption inherent in most drivers will certainly contribute to the failure of
any system that fails to address it. It was gathered that about 10% of the speed limiter
installations done till date has either been deliberately tampered with or completely
In the light of the above factors, I recommend this design to the Nigerian Federal Road
Safety Corps (FRSC) as the best alternative to controlling speed and reducing the
constantly increasing rates of fatal accidents on the Nigerian highways. The fact that the
system is not installed in the vehicles plying the highway but hidden in a bush near the
road, the issue of tampering will not arise. Also, the question of economy will not arise
since the burden of installation will be wholly born by the government, and not the road
users.
The system can also be modified and deployed to monitor speed in busy street roads.
To consolidate on this effort, I hereby suggest that further work should be done to
improve on the performance of the current system. Such work may include transmitting
in real time the image and identity of any over-speeding vehicle captured, to a remote
traffic control office using GSM/GPRS network. That way, the offender can immediately
53
It will also be a good thing if the future design will take care of all the limitations the
designer of the current system has encountered in the course of this work, including
54