0% found this document useful (0 votes)
21 views30 pages

Project 2

The document discusses a drowsiness detection system using eye aspect ratio technique. It describes how drowsiness while driving can cause accidents and proposes using sensors like IR sensors connected to an Arduino board to detect drowsiness based on eye movement and alert the driver. The system would help reduce accidents from drowsy driving.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views30 pages

Project 2

The document discusses a drowsiness detection system using eye aspect ratio technique. It describes how drowsiness while driving can cause accidents and proposes using sensors like IR sensors connected to an Arduino board to detect drowsiness based on eye movement and alert the driver. The system would help reduce accidents from drowsy driving.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

DROWSINESS DETECTION SYSTEM USING EYE ASPECT RATIO TECHNIQUE

1.CHAPTER

1.1 Introduction

Rash driving is the cause of many road accidents all over the world. More than 140,000 people
were killed on India's roads last year, according to figures released by the government, The traffic
population has increased considerably in India as there is no means to control or monitor the speed of
vehicles running on roads. This system proves highly effective in detection of over speed driving. It is not
at all necessary that such accidents are results of driving under the influence of alcohol as even a person
who hasn’t consumed alcohol can drive in a reckless manner . To overcome this problem and decrease
death rate due to accidents, introduction of new and innovative speed enforcement technology is necessary.
First of all, given the huge mileage of driveways, the number of patrol officers is far from enough to observe
and analyze every driver's behavior. Second, the guidelines of rash driving patterns are only descriptive and
visual observations cannot specify the details of driving at night or in poor weather. In the present system,
to detect rash driving police has to use a handheld radar gun and aim at the vehicle to record its speed. If
the speed of the vehicle exceeds the speed limit, the nearest police station is informed to stop the speeding
vehicle. This is an ineffective process as after detecting one must inform the same and a lot of time is
wasted. With the number of vehicles increasing day by day, this method cannot be trusted with the lives of
people. To overcome from this our device will helps to find the over speed of the vehicle and take the action
about the driver or rider mainly it helpful for the parents if their ward crosses the limit our device will
intimate immediately through text like your ward cross the speed
A smart vehicle speed monitoring system is proposed using arduino and speed sensor. Considering
the road safety a new technique is described to identify the speeding vehicle and charge them fine for
breaking the rules or intimating the consulted authority to take action. In past, lot of devices to detect rash
driving on highways has been made. Most of the approaches require human concentration and involve a lot
of effort, which is difficult to implement. In this paper we intend to design a system aimed at early detection
and alert of dangerous vehicle driving patterns it was helpful parents because know days most of accident
was caused by college student by over speed .by installing our device in bike we can get the speed of the
vehicle if the vehicle cross the speed limit ,in our device we are using speed sensor to detect the vehicle
speed and arduino to monitor the speed it will check the vehicle if the vehicle cross speed then it will
intimate gsm board to send speed information to consulted authorities like parents or consulted person
which we are specify by owner of the vehicle

`
Department of ECE CMR Institute Of Technology
1
Vehicle speed monitoring system using Arduino and speed sensor

BLOCK DIAGRAM

power
supply Lcd display

Arduino
IR sensor 1
Buzzer

IR sensor 2

Figure 1.1 Vehicle speed monitoring system using Arduino and speed sensor

1. IR Sensor:
An infrared sensor (IR sensor) is a radiation-sensitive optoelectronic component with a
spectral sensitivity in the infrared wavelength range 780 nm … 50 µm. IR sensors are now
widely used in motion detectors, which are used in building services to switch on lamps or
in alarm systems to detect unwelcome guests.
Arduino Microcontroller:
The Arduino is a popular open-source microcontroller platform widely used for various
electronic projects. It serves as the brain of the drowsiness detection system, processing
input from sensors and controlling output devices. The Arduino board is programmable
using the Arduino IDE (Integrated Development Environment), allowing developers to
write code to interface with sensors, analyse data, and trigger responses based on
predefined conditions.

`
Department of ECE CMR Institute Of Technology
2
Vehicle speed monitoring system using Arduino and speed sensor

2. Buzzer:
The buzzer is an audible alarm device that emits a loud sound when activated. In the
context of the drowsiness detection system, the buzzer serves as an alert mechanism to
notify the driver when signs of drowsiness are detected. The buzzer can be driven by the
microcontroller, which triggers it based on input from the sensors indicating drowsiness.
The intensity and duration of the buzzer alarm can be adjusted to suit the severity of the
detected drowsiness.
3. LCD Display:
An LCD (Liquid Crystal Display) provides a visual interface for displaying information to
the driver. In the drowsiness detection system, an LCD display can show alerts, messages,
and real-time data, such as the driver's heart rate, environmental conditions, and
suggestions for staying alert. This visual feedback enhances the driver's awareness and
understanding of their condition, facilitating appropriate responses to detected drowsiness.

1.2 PROBLEM STATEMENT

Over-speeding is one of the major factors of all fatal motor vehicle crashes and accident, and
this led government to setup rules for speeding. There are definite rules laid out by authorities
about driving cars on roads. The most common rule in any country is speed limit in certain roads
i.e. you will be in violation of the law if your car speed exceeds this limit.

In developed countries, in order to detect the speed of a moving car, the patrolling officers
usually depend on a handheld gun that works on Radar Technology or Lidar Technology. This is
a tedious process as the officer has to manually check for over speeding for each vehicle.

What if the Car Speed Detection is made automatic? A simple automatic detection of speed
of a vehicle is designed in Arduino Car Speed Detector project, where you can place the system in
one place and view the results instantly without any human intervention.

`
Department of ECE CMR Institute Of Technology
3
Vehicle speed monitoring system using Arduino and speed sensor

2. CHAPTER
ARDUINO

2.1 Arduino
The Arduino is a family of microcontroller boards to simplify electronic design,
prototyping and experimenting for artists, hackers, hobbyists, but also many professionals.
People use it as brains for their robots, to build new digital music instruments, or to build
a system that lets your house plants tweet you when they’re dry. Arduinos (we use the
standard Arduino Uno) are built around an ATmega328Pmicrocontroller — essentially a
complete computer with CPU, RAM, Flash memory, and input/output pins, all on a single
chip. Unlike, say, a Raspberry Pi, it’s designed to attach all kinds of sensors, LEDs, small
motors and speakers, servos, etc. directly to these pins, which can read in or output digital
or analog voltages between 0 and 5 volts.
The Arduino connects to your computer via USB, where you program it in a simple
language (C/C++, similar to Java) from inside the free Arduino IDE by uploading your
compiled code to the board.

Fig. 2.1 Structure of Arduino Board

`
Department of ECE CMR Institute Of Technology
4
Vehicle speed monitoring system using Arduino and speed sensor

Looking at the board from the top down, this is an outline of what you will see (parts of
the board you might interact with in the course of normal use are highlighted)

Fig. 2.2 Arduino Board


 Analog Reference pin (orange)
 Digital Ground (light green)
 Digital Pins 2-13 (green)
 Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used
for digital i/o (DigitalRead and DigitalWrite) if you are also using serial
communication (e.g.Serial.begin).
 Reset Button - S1 (dark blue)
 In-circuit Serial Programmer (blue-green)
 Analog In Pins 0-5 (light blue)
 Power and Ground Pins (power: orange, grounds: light orange)
 External Power Supply In (9-12VDC) - X1 (pink)
 Toggles External Power and USB Power (place jumper on two pins closest to

`
Department of ECE CMR Institute Of Technology
5
Vehicle speed monitoring system using Arduino and speed sensor

desired supply) - SV1 (purple)


 USB (used for uploading sketches to the board and for serial communication
between the board and the computer; can be used to power the board) (yellow)

Digital Pins
In addition to the specific functions listed below, the digital pins on an Arduino board
can be used for general purpose input and output via the pinMode(), DigitalRead(), and
DigitalWrite() commands. Each pin has an internal pull-up resistor which can be turned on
and off using digitalWrite() (w/ a value of HIGH or LOW, respectively) when the pin is
configured as an input. The maximum current per pin is 40mA.
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. On the Arduino Diecimila, these pins are connected to the corresponding
pins of the FTDI USB-to-TTL Serial chip. On the Arduino BT, they are connected
to the corresponding pins of the WT11Bluetooth module. On the Arduino Mini
and LilyPad Arduino, they are intended for use with an external TTL serial
module (e.g. the Mini-USB Adapter).
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt
on a low value, a rising or falling edge, or a change in value. See the attach
Interrupt() function for details.
 PWM: 3, 5, 6, 9, 10, and 11 Provide 8-bit PWM output with the analogWrite()
function. On boards with an ATmega8, PWM output is available only on pins 9,
10, and 11.
 BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth
module.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not
currently included in the Arduino language.
 LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to
digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW,
it's off.

`
Department of ECE CMR Institute Of Technology
6
Vehicle speed monitoring system using Arduino and speed sensor

Analog Pins
In addition to the specific functions listed below, the analog input pins support 10-bit
analog-to-digital conversion (ADC) using the analogRead() function. Most of the analog
inputs can also be used as digital pins: analog input 0 as digital pin 14 through analog input
5 as digital pin 19. Analog inputs 6 and 7 (present on the Mini and BT) cannot be used as
digital pins.
 I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library (documentation on the Wiring website).
Power Pins
 VIN (sometimes labeled "9V"): The input voltage to the Arduino board when it's
using an external power source (as opposed to 5 volts from the USB connection
or other regulated power source). You can supply voltage through this pin, or, if
supplying voltage via the power jack, access it through this pin. Also note that the
LilyPad has no VIN pin and accepts only a regulated input.
 5V: The regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board
regulator, or be supplied by USB or another regulated 5V supply.
 3V3(Diecimila-only) :A 3.3 volt supply generated by the on-board FTDI chip.
 GND: Ground pins.

`
Department of ECE CMR Institute Of Technology
7
Vehicle speed monitoring system using Arduino and speed sensor

3 .CHAPTER

HARDWARE COMPONENTS

3.1 LCD (Liquid Cristal Display)


Introduction:
A liquid crystal display (LCD) is a thin, flat display device made up of any number
of colour or monochrome pixels arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspended between two transparent
electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to
each other. Without the liquid crystals between them, light passing through one would be
blocked by the other. The liquid crystal twists the polarization of light entering one filter
to allow it to pass through the other.
Many microcontroller devices use 'smart LCD' displays to output visual
information. LCD displays designed around LCD NT-C1611 module, are inexpensive,
easy to use, and it is even possible to produce a readout using the 5X7 dots plus cursor of
the display. They have a standard ASCII set of characters and mathematical symbols. For
an 8-bit data bus, the display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5
D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra
lines(RS RW D7 D6 D5 D4).
Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:

Fig.3.1 : Address locations for a 1x16 line LCD Shapes and sizes

`
Department of ECE CMR Institute Of Technology
8
Vehicle speed monitoring system using Arduino and speed sensor

Fig3.2 LCD (DISPLAY)


Even limited to character based modules, there is still a wide variety of shapes and sizes
available. Line lengths of 8,16,20,24,32 and 40 characters are all standard, in one or two
and four line versions.
Several different LC technologies exists. “supertwist” types, for example, offer
Improved contrast and viewing angle over the older “twisted nematic” types.
Pin Description:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins
are extra in both for back-light LED connections).

Fig.3.3 : pin diagram of 1x16 lines lcd

Control Lines:
Pin Symbol
1 VSS Power Supply(GND)
2 VDD Power Supply(+5v)
3 VO Contrast Adjust
Instruction/Data Register
4 RS
Select
5 R/W Data Buses Line
6 E Enable Signal
7-14 DB0-DB7 Data Bus Line

`
Department of ECE CMR Institute Of Technology
9
Vehicle speed monitoring system using Arduino and speed sensor

15 A Power Supply for LED B/L(+)


16 K Power Supply for LED B/L(-)
Table. 3.4 control line table

EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.
RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is
high (1), the data being sent is text data which sold be displayed on the screen. For example,
to display the letter "T" on the screen you would set RS high.
RW:
Line is the "Read/Write" control line. When RW is low (0), the information on the data bus
is being written to the LCD. When RW is high (1), the program is effectively querying (or
reading) the LCD.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected
by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2,
DB3, DB4, DB5, DB6, and DB7.
Read Data from Data Lines (If it is Reading) on LCD:
 Set R/W bit to high
 Set RS bit to logic 0 or 1 (instruction or character)
 Set data to data lines (if it is writing)
 Set E line to high
 Set E line to low

`
Department of ECE CMR Institute Of Technology
10
Vehicle speed monitoring system using Arduino and speed sensor

3.2 REGULATED POWER SUPPLY:


Introduction:
Power supply is a supply of electrical power. A device or system that supplies electrical
or other types of energy to an output load or group of loads is called a power supply unit
or PSU.
A power supply may include a power distribution system as well as primary or secondary
sources of energy such as
• Conversion of one form of electrical power to another desired form and voltage,
typically involving converting AC line voltage to a well-regulated lower-voltage DC for
electronic devices. Low voltage, low power DC power supply units are commonly
integrated with the devices they supply, such as computers and household electronics.
• Batteries.
• Chemical fuel cells and other forms of energy storage systems.
• Solar power.
• Generators or alternators.
Block Diagram:

Fig.3.5: Regulated Power Supply


Battery Power Supply:
A battery is a type of linear power supply that offers benefits that traditional line operated
power supplies lack: mobility, portability and reliability. A battery consists of multiple
electrochemical cells connected to provide the voltage desired. Fig: 3.3.4 shows Hi-Watt
9V battery

`
Department of ECE CMR Institute Of Technology
11
Vehicle speed monitoring system using Arduino and speed sensor

Fig. 3.6 Hi-Watt 9V Battery

The most commonly used dry-cell battery is the carbon-zinc dry cell battery. Drycell
batteries are made by stacking a carbon plate, a layer of electrolyte paste, and a zinc plate
alternately until the desired total voltage is achieved. The most common dry-cell batteries
have one of the following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90.
When the battery is charging, the lead sulfate is converted back to lead and lead dioxide A
nickel cadmium battery has become more popular in recent years. This battery cell is
completely sealed and rechargeable. The electrolyte is not involved in the electrode
reaction, making the voltage constant over the span of the batteries long service life. During
the charging process, nickel oxide is oxidized to its higher oxidation state and cadmium
oxide is reduced. The nickel-cadmium batteries have many benefits. They have a long
service life, high current availabilities, constant voltage, and the ability to be recharged.
Fig: 3.3.5 shows pencil battery of 1.5V.

Fig. 3.7 Pencil Battery of 1.5V


Step 2: Rectification
The process of converting an alternating current to a pulsating direct current is
called as rectification. For rectification purpose we use rectifiers.
Introduction to Capacitors:
The Capacitor or sometimes referred to as a Condenser is a passive device, and
one which stores energy in the form of an electrostatic field which produces a potential

`
Department of ECE CMR Institute Of Technology
12
Vehicle speed monitoring system using Arduino and speed sensor

(static voltage) across its plates. In its basic form a capacitor consists of two parallel
conductive plates that are not connected but are electrically separated either by air or by an
insulating material called the Dielectric. When a voltage is applied to these plates, a current
flows charging up the plates with electrons giving one plate a positive charge and the other
plate an equal and opposite negative charge.

Fig. 3.8 Construction of a Capacitor Fig. 3.9 Electrolytic Capacitor


Step 4: Regulation
The process of converting a varying voltage to a constant regulated voltage is called
as regulation. For the process of regulation we use voltage regulators.
Voltage Regulator:
A voltage regulator (also called a ‘regulator’) with only three terminals appears to
be a simple device, but it is in fact a very complex integrated circuit. It converts a varying
input voltage into a constant ‘regulated’ output voltage. Voltage Regulators are available
in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage
regulators are designed for positive input.
In both cases, the regulator will cut off before any damage occurs. The only way to
destroy a regulator is to apply reverse voltage to its input. Reverse polarity destroys the
regulator almost instantly.

Fig.3.10 shows voltage regulator.

`
Department of ECE CMR Institute Of Technology
13
Vehicle speed monitoring system using Arduino and speed sensor

Theory of operation:
Ohm's law:
The behaviour of an ideal resistor is dictated by the relationship specified in Ohm's
law:
V = IR
Ohm's law states that the voltage (V) across a resistor is proportional to the
current (I) through it where the constant of proportionality is the resistance (R).
Power dissipation:

Fig.3.11 Resistor Fig 3.12 Colour Bands In Resistor


3.3 IR SENSOR
General Description: IR sensor is an electronic device, that emits the light in order to sense some
object of the surroundings. An Ir sensor can measure the heat of an object as well as detects the
motion. Usually, in the infrared spectrum, all the objects radiate some form of thermal radiation.
These types of radiations are invisible to our eyes, but infrared sensor can detect these radiations..
Working Principle:The photo-diode's resistance and output voltage change in proportion to the
IR light received. This is the underlying working principle of the IR sensor. When the IR
transmitter emits radiation, it reaches the object and some of the radiation reflects back to the IR
receiver.

`
Department of ECE CMR Institute Of Technology
14
Vehicle speed monitoring system using Arduino and speed sensor

Fig 3.13: IR sensor

FEATURES
 Access to data collection and analysis methods and clear presentation to allow
replication.
 Concepts and propositions should be logically consistent, clearly defined, and, in general,
lead to empirically verifiable hypotheses.
 Compact Size.
 Working Voltage: 3.3 to 5V DC
 Operating voltage 3.3V: ~23 mA, to 5V: ~43 mA

`
Department of ECE CMR Institute Of Technology
15
Vehicle speed monitoring system using Arduino and speed sensor

Detection range 2cm–30cm

frequency 300GHz to 400THz

Minimum voltage to work 3.3 to 5v

Table 3.2 IR specifications

4.4 Buzzer

Buzzer meaning electronic component that generates sound through the transmission
of electrical signals. Its primary function is to provide an audible alert or notification and typically
operates within a voltage range of 5V to 12V. It's simple, tone(buzzer, 1000) sends a 1KHz sound
signal to pin 9, delay(1000) pause the program for one second and noTone(buzzer) stops the signal
sound. The loop() routine will make this run again and again making a short beeping sound. Buzzer
or beeper is an acoustic signaling device. It can be mechanical, electromechanical or piezoelectric.
An example of the mechanical one is a “joy buzzer” which is used in the old alarm clocks,
electromechanical is the one connected to the door bell, and you will find out more about piezo
buzzers in this tutorial.

Working principle

When a voltage is applied across the two electrodes, the piezoelectric material mechanically
deforms due to the applied voltage. This movement of the piezo disk within the buzzer creates
sound in a similar manner as the movement of the ferromagnetic disk in a magnetic buzzer or the
speaker cone mentioned above.

`
Department of ECE CMR Institute Of Technology
16
Vehicle speed monitoring system using Arduino and speed sensor

Features of Buzzer

 Colour is black.
 The frequency range is 3,300Hz.
 Operating Temperature ranges from – 20° C to +60°C.
 Operating voltage ranges from 3V to 24V DC.
 The sound pressure level is 85dBA or 10cm.
 The supply current is below 15mA.

Fig : Buzzer

Jumper wires:

A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of a breadboard or other
prototype or test circuit, internally or with other equipment or components, without soldering. [1]

Individual jump wires are fitted by inserting their "end connectors" into the slots provided in a
breadboard, the header connector of a circuit board, or a piece of test equipment.

`
Department of ECE CMR Institute Of Technology
17
Vehicle speed monitoring system using Arduino and speed sensor

Types of Jumper Wires:

There are different types of jumper wires. Some have the same type of electrical
connecter at both ends, while others have different connectors. Some common connectors are:
• Solid tips – are used to connect on/with a breadboard or female header connector. The
arrangement of the elements and ease of insertion on a breadboard allows increasing the
mounting density of both components and jump wires without fear of short-circuits. The jump
wires vary in size and colour to distinguish the different working signals.
• Crocodile clips – are used, among other applications, to temporarily bridge sensors,
buttons and other elements of prototypes with components or equipment that have arbitrary
connectors, wires, screw terminals, etc.
• Banana connectors – are commonly used on test equipment for DC and low-frequency
AC signals.
• Registered jack (RJnn) – are commonly used in telephone (RJ11) and computer
networking (RJ45).
• RCA connectors – are often used for audio, low-resolution composite video signals, or
other low-frequency applications requiring a shielded cable.
• RF connectors – are used to carry radio frequency signals between circuits, test
equipment, and antennas.
• RF jumper cables - Jumper cables is a smaller and more bendable corrugated cable which
is used to connect antennas and other components to network cabling. Jumpers are also used in
base stations to connect antennas to radio units. Usually the most bendable jumper cable
diameter is 1/2".

Fig; Jumper wires

`
Department of ECE CMR Institute Of Technology
18
Vehicle speed monitoring system using Arduino and speed sensor

5. CHAPTER

SOFTWARE DESCRIPTION

5.1 ARDUINO SOFTWARE:


The Arduino is a family of microcontroller boards to simplify electronic design, prototyping and
experimenting for artists, hackers, hobbyists, but also many professionals. People use it as brains
for their robots, to build new digital music instruments, or to build a system that lets y
Fig 5.1: software installation

our house plants tweet you when they’re dry. Arduinos (we use the standard Arduino Uno) are
built around an ATmega microcontroller — essentially a complete computer with CPU, RAM,
Flash memory, and input/output

What you will need:


 A computer (Windows, Mac, or Linux)
 An Arduino-compatible microcontroller (anything from this guide should work)
 A USB A-to-B cable, or another appropriate way to connect your Arduino-compatible
microcontroller to your computer (check out this USB buying guide if you’re not sure
which cable to get).
 An Arduino Uno
 Windows 7, Vista, and XP
 Installing the Drivers for the Arduino Uno (from Arduino.cc)
 Plug in your board and wait for Windows to begin it’s driver installation process After a
few moments, the process will fail, despite its best efforts

 Click on the Start Menu, and open up the Control Panel


 While in the Control Panel, navigate to System and Security. Next, click on System Once
the System window is up, open the Device Manager
 Look under Ports (COM & LPT). You should see an open port named “Arduino UNO
(COM xx)”.
 If there is no COM & LPT section, look under ‘Other Devices’ for ‘Unknown Device’
 Right click on the “Arduino UNO (COM xx)” or “Unknown Device” port and
choose the “Update Driver Software” opt next, choose the “Browse my computer
for Driver software” option

`
Department of ECE CMR Institute Of Technology
19
Vehicle speed monitoring system using Arduino and speed sensor

Fig 5.2: software installation(part -2)

Finally, navigate to and select the Uno’s driver file, named “ArduinoUNO.inf”,
located in the “Drivers” folder of the Arduino Software download (not the “FTDI
USB Drivers” sub-directory). If you cannot see the .inf file, it is probably just
hidden. You can select the ‘drivers’ folder with the ‘search sub-folders’ option
selected instead. Windows will finish up the driver installation

`
Department of ECE CMR Institute Of Technology
20
Vehicle speed monitoring system using Arduino and speed sensor

Fig 5.3: libraries installation

 Select the type of Arduino board you’re using: Tools > Board > your board typ

`
Department of ECE CMR Institute Of Technology
21
Vehicle speed monitoring system using Arduino and speed sensor

Fig 5.4: selecting board

 Select the serial/COM port that your Arduino is attached to: Tools > Port > COM
x

Fig 5.5: launching

`
Department of ECE CMR Institute Of Technology
22
Vehicle speed monitoring system using Arduino and speed sensor

Fig 5.6: main page

If you’re not sure which serial device is your Arduino, take a look at the available ports, then
unplug your Arduino and look again. The one that disappeared is your Arduino.
With your Arduino board connected, and the Blink sketch open, press the ‘Upload’ button
After a second, you should see some LEDs flashing on your Arduino, followed by the message
‘Done Uploading’ in the status bar of the Blink sketch.
If everything worked, the onboard LED on your Arduino should now be blinking! You just
programmed your first Arduino!
Precautions
 First, make sure that the transistor is connected in the right way. The flat side of the
transistor should face the Arduino board as shown in the arrangement.
 Second, the striped end of the diode should be towards the +5V power line according to the
arrangement shown in the image.

Fig 5.8 Vehicle speed checker To Ardiuno Uno

`
Department of ECE CMR Institute Of Technology
23
Vehicle speed monitoring system using Arduino and speed sensor

Arduino Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(7,6,5,4,3,2);
float Time;
int flag1 = 0;
int flag2 = 0;
int timer1 = 0;
int timer2 = 0;
float distance = 5.0;
float speed;
int ir_s1 = A0;
int ir_s2 = A1;
int buzzer = 13;
void setup(){
pinMode(ir_s1, INPUT);
pinMode(ir_s2, INPUT);
pinMode(buzzer, OUTPUT);
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Welcome to CMRIT ");
lcd.setCursor(0,1);
lcd.print(" RTRP LAB");
delay(2000);
}
void loop() {
if(digitalRead (ir_s1) == LOW && flag1==0){timer1 = millis(); flag1=1;}
if(digitalRead (ir_s2) == LOW && flag2==0){timer2 = millis(); flag2=1;}

`
Department of ECE CMR Institute Of Technology
24
Vehicle speed monitoring system using Arduino and speed sensor

if (flag1==1 && flag2==1){


if(timer1 > timer2){Time = timer1 - timer2;}
else if(timer2 > timer1){Time = timer2 - timer1;}
Time=Time/1000;//convert millisecond to second
speed=(distance/Time);//v=d/t
speed=speed*3600;//multiply by seconds per hr
speed=speed/1000;//division by meters per Km
}
if(speed==0){
lcd.setCursor(0, 1);
if(flag1==0 && flag2==0){lcd.print("No car detected");}
else{lcd.print("Searching... ");}
}
else{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Speed:");
lcd.print(speed,1);
lcd.print("Km/Hr ");
lcd.setCursor(0, 1);
if(speed > 50){lcd.print(" Over Speeding "); digitalWrite(buzzer, HIGH);}
else{lcd.print(" Normal Speed "); }
delay(3000);
digitalWrite(buzzer, LOW);
speed = 0;
flag1 = 0;
flag2 = 0;
}
}

`
Department of ECE CMR Institute Of Technology
25
Vehicle speed monitoring system using Arduino and speed sensor

Result

Components Required

You will need the following components −

 2× IR sensor
 1 × Buzzer
 1 × Arduino UNO
 1 × breadboard
 10 × jumper wires

`
Department of ECE CMR Institute Of Technology
26
Vehicle speed monitoring system using Arduino and speed sensor

Procedure

The Car Speed Detector project’s complex Arduino code makes effective use of a
buzzer, two infrared sensors, and a 16 x 2 LCD display. The code first loads the LCD’s Liquid
Crystal library. It then initializes the pins (2, 3, 4, 5, 6, 7) and a number of other variables, including
timers, flags, distance, and speed. The code initializes components and configures pins in the void
setup() section. The first welcome message appears on the LCD after it is configured. The void
loop() portion computes the speed, the time it takes an automobile to drive between two sensors,
and the state of the IR sensors continually. In addition to “No car detected,” “Searching,” and the
computed speed and status (normal or over speeding) are shown live on the LCD. In the event of
exceeding the speed limit, the buzzer sounds. In order to provide real-time information regarding
vehicle speed and status on the LCD, the code presents an effective approach for capturing and
processing sensor data. The uploading procedure to the Arduino board is described in the last
portion of the code.

Connection Steps
 Connect 5V and the ground of the IC to 5V and the ground of Arduino, respectively.
 Connect the Buzzer to pins 13 and gnd of the Arduino.
 Connect IR1 to pin A0 and reset of Arduino.
 Connect IR2 to pin A1 and reset of Arduino.
 Connect LCD to pin 2 ,3,4,5,6,7of Arduino.
 Connect Arduino using Arduino USB cable and upload the program to Arduino using
Arduino IDE software.
 Provide power to Arduino board using power supply, battery, or USB cable.

Applications

 Helps in capturing speed of vehicles without any human involvement.


 This project can also be used as traffic logger, traffic counter and few other traffic related
application

`
Department of ECE CMR Institute Of Technology
27
Vehicle speed monitoring system using Arduino and speed sensor

Mathematical Calculations :

Now Arduino measures the speed of vehicle which is measured by distance and time relationship

s=d/t

Where s = speed of the moving object,


d = distance between the two sensors and t = the time measured by Arduino.

RESULTS AND ANALYSIS

From the above figures show the result The clear representation of the speed detector and the LCD
display which gives the accurate results are shown And this is more useful than any other equipment’s. The
main concept of this project is to find the location of the underground cable fault from the base station in
kms using an Arduino technology. The underground cable fault is a common problem in many urban areas.
When a fault occurs in the underground cable, at that time the repairing of that cable is very difficult due
to not knowing the location of the cable. This project is built with a set of resistors to represent the cable
length in kilometers and fault creation is designed with a set of switches at every known kilometer to cross
check the exactness of the same. When a fault occurs at a particular distance and the particular phase is
displayed on an LCD which is interfaced to the Arduino board

`
Department of ECE CMR Institute Of Technology
28
Vehicle speed monitoring system using Arduino and speed sensor

CONCLUSION
As the number of accidents on highways increases day by day, so it is necessary to check speed of
the vehicles on highways so as to remove accident cases and to provide a safe journey by controlling high
speed of the vehicle. It also minimizes the difficulties of traffic police department and make ease to control
the rash driving on highways. The police can perform their duties while sitting in control room and can
provide their service with more ease and accuracy. This concept can be extended in future by integrating a
camera with the system which could capture the image of the number plate of the vehicle to sends that to
the traffic authorities.
In this paper, we can easily detect the speed of vehicles/human by utilizing Arduino and IR sensors
so that it alerts the over speed of vehicles/human. This paper is mainly used as sport check, to control over
speed near prohibited areas. The system accumulates information of vehicle/human speed(moving objects)
by displaying on LCD display and if over speed occurs it alerts by giving buzzer. The designed detection
system continuously monitors the speed of the approaching vehicle.
In conclusion, constructing a car speed detector using an Arduino board and infrared
sensors offers a practical introduction to integrating hardware and software. This project provides
an introduction to sensor technology and microcontroller programming, which may be used for
educational, hobbyist, or traffic management applications. The adaptability of Arduino in coming
up with creative solutions for problems encountered in the real world is demonstrated by its ability
to detect and monitor vehicle speed utilizing easily accessible components. Overall, the proposed
drowsiness detection system lays the foundation for a proactive approach to address the risks
associated with drowsy driving. Continued research and development efforts will lead to further
advancements, ultimately contributing to the safety and well-being of drivers and passengers on
the road future, this system can be extended by integrating a camera which could capture the image of the
number plate of the vehicle and sends to the traffic authorities or the corresponding vehicle owner.

`
Department of ECE CMR Institute Of Technology
29
Vehicle speed monitoring system using Arduino and speed sensor

REFERENCES

[1] Vishal Pande, Malhar Malhar Mohite, Supriya Mhatre, Siddhesh Desai, Anjali kumari, “Autonomous
Speed Control of Over Speeding Vechicles Using Radio Frequency”, International Journal of advanced
Research in Electronics, Electronics and Instrumentation Engineering Vol.4,Issue 4, April 2015.
[2] Monika Jain, Praveen Kumar, Priya Singh, Chhavi Narayan Arora, Ankita Sharma, International Journal
of Computer Science and Mobile Computing a Monthly Journal of Computer Science and Information
Technology, Vol. 4, Issue. 4, April 2015. “A system Detection of over Speeding Vehicles on Highways”.
[3] Design And Implementation of Pc Based Over Speed Violation Management For Vechicles On
Highway” by Ni Hlain, Zaw Min Htun, Hla Myo Tun International Journal Of Scientific & Technology
Research Volume 4, Issue 07, July 2015 .
[4] Amarnarayan, Challa Saikumar, Chandra Mohan, Ajaykumar, Sridhar IJCRD (International Journal of
Combined Research and Development) May 2016 Automatic Over Speed Controlling of Vechicle”.
[5] Nehal Kassem, Ahmed E. Kosba and Moustafa Youssef, IEEE 75th VTC (Vechicular Teechnology
Conference). RF-based vechicle detection and speed estimation”.
[6] Rajesh Kannan Megalingam, Vineeth Mohan, Paul Leons, Rizwin Shooja and Ajay M, IEEE (GHTC)
Global Humanitarian Techology Conference , pp. 528- 533, 2011. “Smart traffic controller using wireless
sensor network for dynamic traffic routing and over speed detection
[7] Automatic number plate recongnition system for vehicle identification using optical character
recognition,” International Conference on Education Technology and Computer, pp. 335-338, April 2009
by Muhammad Tahir Qadri and Muhammad Asif.
[8] Shyr-Long Jeng, Wei-Hua Chieng and Hsiang-PinLu Estimating Speed Using a Side-Looking Single-
Radar Vehicle Detector, IEEE Transactions on Intelligent Transportation Systems.
[9] “Vehicle Speed Measurement using camera as sensor” by A. Nurhadiyatna , B. Hardjono

`
Department of ECE CMR Institute Of Technology
30

You might also like