Sei sulla pagina 1di 54

CHAPTER ONE: INTRODUCTION

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

imperative if economic sustainability is to be maintained. To solve the major problem of

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

danger, decide on an evasive action (brake) and complete that action.

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

the more distance it takes to stop the vehicle.

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

more significant when the driver is speeding.

Furthermore, higher speed will also reduce the ability of vehicles, safety belts, air bags

and barriers to protect vehicle occupants in a crash. Moreover, higher speeds of

approaching vehicles are more likely to be misjudged by turning drivers and the

consequences of this are more serious.

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

collision can still sometimes be avoided.

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

display ‘OVERSPEED” as a warning to alert the driver to impending speeding violations.

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

consists of a pair of sensors comprising of an IR transmitter and an IR receiver, each of

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

be extended in future by integrating a GPS module to mark the positioning coordinates of

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

valuable in controlling internal traffic in highly populated areas.

1.2 Aim and Objectives

The aim of this project is to develop a vehicle speed monitoring system for use by the

traffic authorities to control speed violation

In order to reach this aim, the following objectives have been established:

i) To design a system capable of measuring a wide range of vehicle speeds

ii) To develop a system capable of comparing the speed of a vehicle to a preset

limit and detecting when this limit has been exceeded

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

Nigerian highways is 100 km/h as per the traffic rule.

1.3 Project Implementation:

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

the Police against such driver.

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,

introduction of a new and innovative speed enforcement technology is necessary.

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.

1.5 The Report Layout

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

covered in this chapter.

Chapter 3 (System Design) features the steps and methodology used to design the system

and the general operation of the system.

Chapter 4 (Implementation, Testing and Result), analyzes the problems encountered. In

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

2.1 Historical Background of the Project

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

moved increasingly to newer technologies such as Global Positioning System (GPS)

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

Administration has well-established that speeding represents a risk to public 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

speed is a high-priority objective and effective speed enforcement is an essential

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

determining the geographic location of a vehicle and transmitting this information to a

point where it can be stored and used with certain software and database applications

(Danny, 2008). A common practice is to stand up a centrally located server that is

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

organizations dispatching procedures. The integration of AVL data into a Geospatial

Information System (GIS) combines the concepts of dynamic geospatial location,

intelligent geographic data and situational awareness. The added information of vehicle

tracking information into an existing GIS provides a comprehensive approach for

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-

time applications. AVL technology provides improved response time, resource

management, schedule adherence and increased productivity on a day to day application.

The use of this technology can support many activities such as fleet management,

garbage truck tracking and mobile workforce management.

The challenge with the existing systems like the radar speed gun is that they work where

traffic officers are and cannot operate without their existence.

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

of people killed or injured on the roads still remained unacceptably high.

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

implementation (for commercial vehicles) in February, 2017. To support this assertion,

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

limit, thereby slowing it down to the acceptable speed.

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

crises since they will be installed outside the vehicles.

2.2 Theories and Models Relevant to the Design

Traditionally, improved vehicle speed monitoring system design, operation and

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

necessary for the overall system efficiency and operation.

2.2.1 Evolution of Speed Sensors

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

electronic sensors to perform that job.

The operation of most speed sensors is similar and might fall into one of three categories:

variable reluctance, hall-effect and magneto resistive (Soloman, S. 1998). As a result of

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

coil and the toothed ring.

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

direction and magnitude of an applied magnetic field. In an inductive sensor an oscillator

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

a Hall Effect sensor, a current is passed through a semiconductor material. When a

magnetic field is applied perpendicularly to the surface of the semiconductor, a voltage is

developed. This Hall voltage is proportional to the applied field intensity, driving the

magnetic speed sensor.

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

in situations requiring portability or remote sensing. The sensor may be placed on a

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

to identify their magnitudes and timing.

2.3 System Components Description

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

functional characteristics of each of these components can be found in Appendix I.

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

components can also be used to amplify signals.

15
2.3.1 Crystal oscillator (4 MHz)

Generally, an oscillator is a circuit, which converts dc energy into ac energy at a very

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:

i) output frequency required

ii) frequency of stability required

iii) allowable waveform distortion

iv) power output required

There exist tuned-circuits or LC feedback oscillators (e.g. Hartley, Colpitts, and Clapp),

RC phase-shift oscillators (e.g. Wien-Bridge Oscillator), Negative-resistance oscillators

(e.g. tunnel Diode Oscillator), Crystal oscillators (e.g. Pierce oscillator) and Heterodyne

or beat-frequency oscillator (e.g. BFO)

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

used whenever greater stability is required, such as in communication transmitters and

receivers.

16
R

L Cm

Fig. 2.1 Electrical equivalent circuit of a crystal

2.3.2 Liquid Crystal Display (LCD)

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

parameters of interest (time & speed) in both lines (Appendix II).

The following reasons favored the choice of LCD as a preferred display option for this

design over CRT and the LED (7 segment display):

Advantages over traditional CRT:

i) LCD displays take up much less space than the CRTs

ii) They consume less power than CRT monitors

iii) LCD displays output in a much brighter image than CRT displays

17
iv) They are very compact, thin, and lighter than CRT displays

v) Due to low power consumption, small heat emitted during operation

vi) It has no geometric distortion.

Advantages over LED:

i) Cost: They are relatively cheaper compared to the LEDs

ii) Power consumption: LEDs though have better view, are not suitable for

usage with batteries because of their high power consumption. The control

circuit is required to supply the processing power to generate characters

for display. LCD modules has built in processing power including a

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

contrast (black on white)

iii) Interfacing with microcontroller: It is easier to interface LCD than LED

segment to microcontrollers (commands for sending characters to LCD is

straightforward whereas a multiplexing circuit or IC may be needed if the

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

LED’s in a 7 segment display, it is limited only to that number. But for 8

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

customization of characters or graphics

18
2.3.3 PIC16F876A Microcontroller

The purpose of using a microcontroller in this design which is an embedded

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

of components count otherwise needed to implement the design.

There are many of different architecture of microcontrollers available in the market.

Some of the commonly used microcontrollers are Intel MCS-51, MCS-96, Atmel 89CXX,

89CXX51, Motorola 68HC12 family, Microchip’s Peripheral Interface Controller (PIC)

16CXX, 17CXX, etc.

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

due to the following unique features specific to this application:

i) Very convenient to use

ii) Easier to code or program (has only 35 single word instructions)

iii) High performance, low cost and small size

iv) Has a total number of 40 pins and up to 15 output pins for external connection

v) Ability to manage interrupts

vi) Can be write-erase as many times as possible because it uses FLASH memory

technology

vii) Has EEPROM data memory for permanently storage of information

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

used before such as in co-processor applications and timer functions etc

All of these features make it ideal for more advanced level A/D applications in

automotive and battery-driven applications, such as the Commercial Vehicle Speed

Monitoring System.

2.3.4 Infrared Sensor

An Infrared (IR) sensor is an electronic instrument which is used to sense certain

characteristics of its surroundings by either emitting and/or detecting infrared radiation.

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

from the IR torches (IR LEDs).

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:

i) LEDs are very cheap and convenient source of radiation

20
ii) Laser beams are rather highly coherent (straight and parallel) rather than

divergent (incoherent) which makes it non ideal for this application (requires

distribution of power in all directions)

iii) LED consumes moderate amount of power over time than diode lasers, which

use increasing amounts of power with diminishing efficiency

iv) LED has higher output pattern and easier to use than Lasers

v) LED has longer lifetime generally considered eye-safe

vi) LED costs are relatively low compared to the 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

are far from the stress limits of the materials)

An infrared emitter, or IR emitter, is a source of light energy in the infrared spectrum. It

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

transmits information and commands from one device to another.

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

Infrared receiver TSOP1739) in order to constantly detect the IR (without pulsing)

needed specifically in this design. Consequently, no oscillation (switching ON and OFF)

is required unlike the case with TSOP1739 which must operate at the same frequency as

the oscillating frequency of the IR emitter (38 KHz).

21
+5V

IR LED IR Diode
Tx Rx

R1 R2
Output

Fig.2.2 Infrared (LED and Detector) Sensor Pair

2.3.5 Differential Op-Amp Comparator (LM358)

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

frequency compensated operational amplifier. More commonly used in detector circuits,

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

Amplifier (Op-amp) circuits, transducer amplifiers, DC gain blocks etc. LM-358 is

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

Generally, an operational amplifier is an analogue device with a differential analogue

input and an analogue output, such that if operated in its open-loop configuration its

output acts like a comparator output.

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

difference between these two inputs.

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:

i) It eliminates need for dual supplies

ii) It is compatible with all forms of logic

iii) It contains two Op-amps, compensated internally

iv) It is suitable for battery operation due to power drain

v) It permits direct sensing near ground

vi) It is readily available and affordable

vii) Wide power supply range (3V to 32V)

2.3.6 Linear Voltage Regulator (LM 7805)

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

2.3.7 NPN Transistor (C828)

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

capturing and returns (resets) it for a new task.

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

sometimes requires continuous routine maintenance. As a result, the system is always

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

and therefore, reduces the circuitry of the overall system.

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

3.1 System Specifications

For this system to achieve the objective for which it is designed (stated earlier), the

following parameter/variable specifications must be accomplished:

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

vii) The microcontroller chip must be provided with a reset facility

viii) Pins 9 and 10 of the microcontroller must be hooked to the crystal oscillator of

4 MHz to avoid the frequency drift of the internal clock

ix) The differential op-amp must be LM358 linear comparator IC for the sake of

precision.

x) A liquid crystal display must be provided for the readout section

viii) The power supply unit must obtain a dc output of +5V from IC linear voltage

regulator (7805)

3.2 Block Diagram Representation

The vehicle speed monitoring system comprise of the following five independent but

interconnected units or modules:

i) Infrared sensor unit,

ii) Control unit

iii) Display unit

iv) Camera unit

v) Power supply unit

27
Logical
Control Module Display
Sensor
Module Module

Camera
Module

Power
Supply

Fig. 3.1 Simplified Block Diagram Representation of the System

3.2.1 Infrared Sensor Block

The IR sensor unit is used to detect the presence of a vehicle. It is made up of an IR

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

calculated from the well known formula of speed (distance/time).

As will be seen later, the IR sensing will be implemented further through a combination

of a differential operational amplifier (comparator) and a transistor (NPN), which will be

responsible for generating the required voltage input to drive the control circuit and

switching (ON/OFF) the microcontroller based on this input signal.

28
IR Sensor Comparator Transistor

Fig. 3.2 Infrared Sensor Block

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

Fig. 3.3 Modified Block Diagram of the System

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

and reset respectively.

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

programming languages (such as assembler)

i) Coding was easy, fast and simple to understand

ii) Debugging, testing and maintenance was easy with C

iii) Due to low-level language support, it was possible to write directly to memory

iv) Assignment of memory for variables was much easier in C

v) Interrupts were better handled

vi) It was easy to manipulate data types by using ‘change declaration’ function

vii) Local libraries helped to save memory, and hide (vital) information

viii) Type checking is stronger in C than in the other languages

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-

cooked functions to get one going without much pre-work.

3.2.3 Display Block

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

a preset limit in order to determine if the vehicle is over-speeding. If so, an over-speed

text is displayed on the LCD with the speed value measured.

3.2.4 Camera Block

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

of electromechanical relays were used to provide switching assistance to the camera to

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)

3.2.5 Power Supply Unit

This block is responsible for power supply to the individual components of the system.

Considering that in actual implementation, the project is likely to be installed in a remote

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

the operation of the system.

7805

+5V

+9V +9V
C1

GND

Fig. 3.4 Linear Voltage Regulator Schematic

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

such as LM358, LM7805, PIC16F876A microcontroller, and others requires no physical

design since they are already on-chip. This helps to simplify the system as not much of

actual hardwired design was carried out in the implementation.

(A) Design of the IR Sensor Circuits

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:

i) Transmitter (IR LED)

ii) IR Detector (Photodiode)

iii) Comparator IC (LM358)

iv) Resistors of the range of milli-ohms

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

that emitted by the IR LED.

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

Fig. 3.5 Infrared sensor circuit

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

occurs, an infinitesimal resistance (1 mΩ) is offered to the flow of current generated by

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

available to the transistor via PIN7 of the second comparator.

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

in turn is used to drive the switching function of the transistor.

35
Without intrusion, the reference voltage (Vref) = 0V

So that using voltage divider rule, the analog input voltage to the non-inverting terminal

of the comparator is obtained as:

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,

So that, with R1 = R2 = 1K = 103Ω and substituting appropriately gives:

= - 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

base terminal of the transistor as shown in figure 3.6.

+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

Fig. 3.6 Switching circuit

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

resistance in the base current path.

When VCE = 0, current through the collector terminal of the transistor was determined

from:

For Vcc = 5V and Rc = 10KΩ,

Ic = 5V/10kΩ

= 0.0005A or 0.5mA

Similarly, Base current of the transistor was obtained using:

where β = transistor current gain (between 20 and 200 for most general purpose

transistors). For this design β = 125,

Thus, Ib = 0.5 mA/125 = 4µA

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

emitter. In this mode, the device is fully switched ON.

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.

When Vi = 0V, Ib = 0 and Ic =0,

= 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

figure 3.7 (Appendix VIII)


N/o

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

Fig.3.7 Camera circuit

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.

3.5 Overall System Operation

The general operation of this system is represented logically on a flow chart as shown.

Start

Vehicle crosses the 1st LED

Counter 1 starts

Vehicle crosses the 2nd LED

Counter 1 stops

Calculation of time between


1st and 2nd LED

Measurement of speed

Speed ≥ Limit?

Limit Yes

Capture image of vehicle

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

at the inverting terminal as determined by the differential comparator (LM358).

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

the collector required to interrupt the microcontroller (PIN21/RB0). The microcontroller

which sees this interruption as an intrusion, immediately activates (or starts) the counter

while waiting to receive the next intrusions.

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

PIN22/RB1) as another intrusion and quickly stops the time counting.

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

not required and camera is deactivated.

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

allow for proper insulation.

4.2 Testing and Result

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

voltage level is supplied.

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

camera was fully functional.

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

was carried out.

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.

Table 4.1: Vehicles speed recorded at different time intervals


Speed (Km/h) 7 8 16 18 27 29 32 35 44 51 59

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

relationship as depicted graphically in fig.4.1 below. In other words, an over-speeding

46
vehicle will take relatively short time to cross the system than it is the case with a vehicle

moving below the set speed limit.

Vehicle Speed-Time Graph

50
45
40
Speed (Km/h)

35
30
25 Series1
20
15
10
5
0
0 20 40 60 80
Time (Secs)

Fig. 4.1.: Graph of vehicle speed against time

4.3 Software Simulation

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

simulation of electrical, electronics, embedded system and microcontrollers based circuits.

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

displayed on the LCD. In other words, no over-speed is said to have occurred.

4.4 Problems Encountered

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

forwarded with some assumptions.

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

costly; but thank God, I finally made it.

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

mistakes. These mistakes were corrected during testing.

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

particular detector. When retested, it was found working perfectly.

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

working very well

49
CHAPTER FIVE: COST, SUMMARY AND RECOMMENDATION

5.1 Cost Analysis

In actualizing the objectives of this design, both mental and physical energy were

sacrificed. In addition, financial commitment was also made towards successful

realization of the project. The breakdown of costs incurred from the inception to the

completion stage is provided in the table:

S/N Item Description Cost Remark

1 Procurement of components N7, 050 At current market price

2 Sourcing for materials N9, 240 Library, Internet etc.

3 Transportation N 9,100 To and from locations

4 Phone calls N 8,700 Including texts, data

5 Typesetting and printing N 5,800 Word processing

6 Slide development & animations N 2,450 PPT presentation

7 Technical consultations N 4,400 From experts/other inst.

8 Binding N 4,200 Final packaging

9 Software development and burn-into N 5,500 Including simulator


chip
10 Writing materials, drawing sheets etc. N 1,060 Drafts, designs, drawings

11 Gift, demo and other items N 7,500 Including demo toy car

12 Miscellaneous expenses N 8,500 Hidden/running costs

TOTAL N 73,500

Thus, analysis of above breakdown shows that largest amount was spent on material

sourcing, phone calls, transportation, procurement of components and miscellaneous

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

overwhelming courage. To God be the glory.

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

to control high rate of fatal accidents occurring on theses highways.

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

of such a vehicle for latter use by the highway traffic authorities.

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

an external card the image and identity of the offending vehicle.

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

achieving such a functional and reliable project.

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

an extended distance of separation remains unknown to the designer.

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

separation between the two reference points.

5.4 Recommendation

It is always difficult to determine a perfect system to control any social problem without

adequate understanding of the society in which the problem is prevalent.

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

impoverished by the introduction and enforcement of speed limiter devices. Thirdly,

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

removed by the drivers in an attempt to sabotage the system.

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.

5.5 Area for Further Work

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

be tracked and disciplined by the traffic authorities.

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

extended coverage and multi-lane routes.

54

Potrebbero piacerti anche