Automatic Speed Control and Accident Avoidance of Vehicle Using

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

ABSTRACT

As the number of vehicles increasing day by-day, accidents are also increasing rapidly.
These accidents can be due to false estimation of nearby vehicles, disturbances in mind
of driver or any reasons due to which driver can’t keep focus on driving. The project is
based on the accident. This system can measure the distance between the driving car
and front object and can calculate the safety distance of driving car based on its current
speed. If driver doesn’t keep the minimum safety with front object, it will warn the
driver to slow down the speed of car to avoid collision. And if the driver doesn’t slow
down the car, this system will automatically slows down and stop the car before the
collision could occur.

Page 1
CHAPTER-1

INTRODUCTION

The project presented here is aimed at automatically sensing the areas / zones like
“School Zone”, “Work zone” or “Curve Zone”. We are developing a system which will
sense such traffic signs automatically and accordingly inform the driver and also assist
him in controlling the vehicle. As the design of this system goes, the project proposed
here consists of a set of units: Zone / Area Unit and Vehicle Unit. In convention, these
special zones or areas are indicated at the roadside on a pillar or road sign poles. As an
example, near school zone, the sign board displays “School Zone Ahead, Drive
Slowly”, or “Curve Zone Area-Do not go fast”. Drivers go at very high speed as usual
near school zone, or operate the harsh driving causing accident in the curve zone. As a
result, making the whole concept of displaying warning sign and messages on the
roadside boards does not help.

To provide a better alternative, one can develop a system which will automatically
sense such traffic signs automatically and accordingly inform the drives and also assist
him in controlling the vehicle voluntarily or forcibly. All in all resulting in a very
effective and fail proof system to provide traffic regulation, safety and convenience of
the people. As the whole project not just limited for these few functions, this project
can be made mandatory. That way one can provide a more reliable security device and
streamline traffic flow. Few additional features which can be integrated with this system
are, “Anti-collision”, “Auto breaking with curve detection” and “Auto Speed limit
Sensor”.

Page 2
PROBLEM STATEMENT

The main concern of the modern automotive industry is passenger safety and accidents
due to drivers' negligence are one of the problems for the roadside people. This problem
is being partly solved with the use of this vehicle speed control system. Hence a system
that does ensure safety is in huge demand. Such a system is called the Automatic vehicle
speed control system.

Page 3
PROPOSED SYSTEM

The Objective of this project is to develop a system to keep the vehicle secure and
protect it by the occupation of the intruders. The main aim of the project to develop a
system automatic speed control of vehicle and accident avoidance using ultrasonic
sensor .whenever any obstacle is detected in running vehicle depends on distance
automatically control the speed of vehicle.

The ultrasonic sensor system continuously sends signals and monitors any car or other
obstacles are in front of car. The distance up to which ultrasonic sensor can work may
be up to 4 meter. When any obstacle or vehicle detected by ultrasonic sensor system it
will send signal to the embedded board. After receiving this signal embedded board
sends a signal to the motor to reduce the car speed automatically which can control car
speed immediately. Vehicle is controlled automatically without any manual operation
when the vehicle is at 4 meter distance away from the front vehicle. Also give alarm to
alert to the driver. Many accidents at High-ways are taking place due to the close
running of vehicles, all of sudden, if the in front vehicle driver reduces the speed or
applied breaks, then it is quite difficult to the following vehicle driver to control his
vehicle, resulting accident. To avoid this kind of accident, the warning system, which
contains alarm and display system can arrange at rear side of each and every vehicle. If
any short circuit occurs in engine part smoke sensor detecting and give alert to driver
and stop the vehicle.

Page 4
CHAPTER-2

HARDWARE ASPECTS

BLOCK DIAGRAM

LCD
POWER SUPPLY

L293D DC
ULTRASONIC MOTOR
SENSOR ARDUINO

SMOKE SENSOR BUZZER

2.1 POWER SUPPLY

The input to the circuit is applied from the regulated power supply. The a.c.
input i.e., 230V from the mains supply is step down by the transformer to 12V and is
fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in
order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to
remove any a.c components present even after rectification. Now, this voltage is given
to a voltage regulator to obtain a pure constant dc voltage.

230V AC D.C
Output
50Hz

Page 5
Step down Bridge
transformer Rectifier
Regulator
Filter

Fig: 2.3 Block diagram of power supply

2.1.1 TRANSFORMER

Fig 2.4 Transformer

A transformer consists of two coils also called as “WINDINGS” namely


PRIMARY & SECONDARY.
They are linked together through inductively coupled electrical conductors also
called as CORE. A changing current in the primary causes a change in the Magnetic
Field in the core & this in turn induces an alternating voltage in the secondary coil. If
load is applied to the secondary then an alternating current will flow through the load.
If we consider an ideal condition then all the energy from the primary circuit will be
transferred to the secondary circuit through the magnetic field.

So

Page 6
2.1.2 Rectifier
A rectifier is a device that converts an AC signal into DC signal. For
rectification purpose we use a diode, a diode is a device that allows current to pass only
in one direction i.e. when the anode of the diode is positive with respect to the cathode
also called as forward biased condition & blocks current in the reversed biased
condition.

Rectifier can be classified as follows:


1) Half Wave rectifier

Fig.2.5 Half Wave Rectifier


This is the simplest type of rectifier as you can see in the diagram a half wave
rectifier consists of only one diode. When an AC signal is applied to it during the
positive half cycle the diode is forward biased & current flows through it. But during
the negative half cycle diode is reverse biased & no current flows through it. Since only
one half of the input reaches the output, it is very inefficient to be used in power
supplies.

2) Full wave rectifier

Page 7
Fig.2.6 Full Wave Rectifier
Half wave rectifier is quite simple but it is very inefficient, for greater efficiency
we would like to use both the half cycles of the AC signal. This can be achieved by
using a center tapped transformer i.e. we would have to double the size of secondary
winding & provide connection to the center. So during the positive half cycle diode D1
conducts & D2 is in reverse biased condition. During the negative half cycle diode D2
conducts & D1 is reverse biased. Thus we get both the half cycles across the load.
One of the disadvantages of Full Wave Rectifier design is the necessity of using
a center tapped transformer, thus increasing the size & cost of the circuit. This can be
avoided by using the Full Wave Bridge Rectifier.

2.1.3 FILTER CAPACITOR

Even though half wave & full wave rectifier give DC output, none of them
provides a constant output voltage. For this we require to smoothen the waveform
received from the rectifier. This can be done by using a capacitor at the output of the
rectifier this capacitor is also called as “FILTER CAPACITOR” or “SMOOTHING
CAPACITOR” or “RESERVOIR CAPACITOR”. Even after using this capacitor a
small amount of ripple will remain.
We place the Filter Capacitor at the output of the rectifier the capacitor will
charge to the peak voltage during each half cycle then will discharge its stored energy

Page 8
slowly through the load while the rectified voltage drops to zero, thus trying to keep the
voltage as constant as possible.

Fig 2.7 Waveforms of Filter Capacitor


If we go on increasing the value of the filter capacitor then the Ripple will
decrease. But then the costing will increase. The value of the Filter capacitor depends
on the current consumed by the circuit, the frequency of the waveform & the accepted
ripple.

Where,
Vr= accepted ripple voltage.( should not be more than 10% of the voltage)
I= current consumed by the circuit in Amperes.
F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so
F=25hz
Whereas a full wave rectifier has Two peaks in one cycle so F=100 Hz.
2.1.4 VOLTAGE REGULATOR
A Voltage regulator is a device which converts varying input voltage into a
constant regulated output voltage. Voltage regulator can be of two types
1) Linear Voltage Regulator
Also called as Resistive Voltage regulator because they dissipate the excessive
voltage resistively as heat.

Page 9
2) Switching Regulators.
They regulate the output voltage by switching the Current ON/OFF very
rapidly. Since their output is either ON or OFF it dissipates very low power thus
achieving higher efficiency as compared to linear voltage regulators. But they are more
complex & generate high noise due to their switching action. For low level of output
power switching regulators tend to be costly but for higher output wattage they are
much cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the 78XX series
where the XX indicates the output voltage. And 79XX series is for Negative Voltage
Regulators.

Fig.2.8 pin diagram of voltage regulator


After filtering the rectifier output the signal is given to a voltage regulator. The
maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3
Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher
than the output voltage. If the input voltage gets below the Vmin of the regulator due
to the ripple voltage or due to any other reason the voltage regulator will not be able to
produce the correct regulated voltage.

Circuit diagram

Fig 2.9 Circuit Diagram of power supply

Page 10
➢ IC 7805
7805 is an integrated three-terminal positive fixed linear voltage regulator. It
supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a
current rating of 1 amp although lower current models are available. Its output voltage
is fixed at 5.0V. The 7805 also has a built-in current limiter as a safety feature. 7805 is
manufactured by many companies, including National Semiconductors and Fairchild
Semiconductors.

The 7805 will automatically reduce output current if it gets too hot. The last two
digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series
of regulators is designed to work in complement with the 79xx series of negative
voltage regulators in systems that provide both positive and negative regulated voltages,
since the 78xx series can't regulate negative voltages in such a system.

The 7805 & 78 is one of the most common and well-known of the 78xx series
regulators, as it's small component count and medium-power regulated 5V make it
useful for powering TTL devices.

SPECIFICATIONS IC 7805

Vout 5V

Vein - Vout Difference 5V - 20V

Table. 2.1. Operation Ambient Temp 0 - 125°C Specifications of


IC7805
Output Imax 1A

Page 11
Fig 2.9 Pin diagram of 7805

➢ IC7812

Here is a 7812 voltage regulator circuit, but this is not a power supply with a
12V output voltage and load current 1A. IC LM7812 only serves as the input voltage
of an LM723 regulator IC. So these power supply circuits with a larger load current
capability with a variable voltage at the maximum voltage of 6V.
Output voltage range of the 7812 voltage regulator circuit is 2.5V-6V with 6A-
8A load current. Increasing load current through the transistor BD139 and TIP142 are
sourced from the DC voltage of a transformer 10A.

Fig 2.107812 Pin Connection

MICROCONTROLLER

ARDUINO

Page 12
The Arduino Uno R3 is a microcontroller board based on the ATmega328 (datasheet).
It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header,
and a reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter.

Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground, making
it easier to put into DFU mode.

Revision 3 of the board has the following new features:

• 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields
to adapt to the voltage provided from the board. In future, shields will be
compatible both with the board that use the AVR, which operate with 5V and
with the Arduino Due that operate with 3.3V. The second one is a not connected
pin, that is reserved for future purposes.
• Stronger RESET circuit.
• Atmega 16U2 replace the 8U2.

"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0.
The Uno and version 1.0 will be the reference versions of Arduino, moving forward.
The Uno is the latest in a series of USB Arduino boards, and the reference model for
the Arduino platform; for a comparison with previous versions, see the index of
Arduino boards.

Summary

Microcontroller ATmega328

Page 13
Operating Voltage 5V

InputVoltage
7-12V
(recommended)

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MHz

Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models
use an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin
configuration is identical on all three processors.

Power

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into
the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin
headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable.
If using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.

Page 14
The power pins are as follows:

• VIN. 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.
• 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. A 3.3 volt supply generated by the on-board regulator. Maximum current
draw is 50 mA.
• GND. Ground pins.

Memory

The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of
SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).

Input and Output

Each of the 14 digital pins on the Uno can be used as an input or output, using pin Mode
(), digital Write(), and digital Read()functions. They operate at 5 volts. Each pin can
provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 k Ohms. In addition, some pins have specialized
functions:

• Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of
the ATmega8U2 USB-to-TTL Serial chip.
• 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 analog
Write() function.

Page 15
• SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
• LED: 13. 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.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and
the analog Reference() function. Additionally, some pins have specialized
functionality:

• TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using
the Wire library.

There are a couple of other pins on the board:

• AREF. Reference voltage for the analog inputs. Used with analog Reference().
• Reset. Bring this line LOW to reset the microcontroller. Typically used to add
a reset button to shields which block the one on the board.

See also the mapping between Arduino pins and ATmega328 ports. The mapping for
the Atmega8, 168, and 328 is identical.

Communication

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL
(5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX).
An ATmega16U2 on the board channels this serial communication over USB and
appears as a virtual com port to software on the computer. The '16U2 firmware uses the
standard USB COM drivers, and no external driver is needed. However, on Windows,
a .inf file is required. The Arduino software includes a serial monitor which allows
simple textual data to be sent to and from the Arduino board. The RX and TX LEDs on
the board will flash when data is being transmitted via the USB-to-serial chip and USB
connection to the computer (but not for serial communication on pins 0 and 1).

Page 16
A Software Serial library allows for serial communication on any of the Uno's digital
pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see
the documentation for details. For SPI communication, use the SPI library.

Programming

The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials.

The ATmega328 on the Arduino Uno comes preburned with a boot loader that allows
you to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).

You can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header; see these instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available. The ATmega16U2/8U2 is loaded with a DFU boot loader, which can be
activated by:

• On Rev1 boards: connecting the solder jumper on the back of the board (near
the map of Italy) and then resetting the 8U2.
• On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line
to ground, making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS
X and Linux) to load a new firmware. Or you can use the ISP header with an external
programmer (overwriting the DFU boot loader). See this user-contributed tutorial for
more information.

Automatic (Software) Reset

Rather than requiring a physical press of the reset button before an upload, the Arduino
Uno is designed in a way that allows it to be reset by software running on a connected
computer. One of the hardware flow control lines (DTR) of theATmega8U2/16U2 is

Page 17
connected to the reset line of the ATmega328 via a 100 nanofarade capacitor. When
this line is asserted (taken low), the reset line drops long enough to reset the chip. The
Arduino software uses this capability to allow you to upload code by simply pressing
the upload button in the Arduino environment. This means that the boot loader can have
a shorter timeout, as the lowering of DTR can be well-coordinated with the start of the
upload.

This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software
(via USB). For the following half-second or so, the boot loader is running on the Uno.
While it is programmed to ignore malformed data (i.e. anything besides an upload of
new code), it will intercept the first few bytes of data sent to the board after a connection
is opened. If a sketch running on the board receives one-time configuration or other
data when it first starts, make sure that the software with which it communicates waits
a second after opening the connection and before sending this data.

The Uno contains a trace that can be cut to disable the auto-reset. The pads on either
side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You
may also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to
the reset line; see this forum thread for details.

USB over current Protection

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and over current. Although most computers provide their own internal
protection, the fuse provides an extra layer of protection. If more than 500 mA is applied
to the USB port, the fuse will automatically break the connection until the short or
overload is removed.

ULTRASONIC SENSOR:

HC-SR04 Ultrasonic Sensor

Page 18
Ultrasonic Sensor HC SR04

Ultrasonic Sensor Pin Configuration

Pin Pin Description


Number Name

1 Vcc The Vcc pin powers the sensor, typically with +5V

2 Trigger Trigger pin is an Input pin. This pin has to be kept high for 10us to
initialize measurement by sending US wave.

3 Echo Echo pin is an Output pin. This pin goes high for a period of time which
will be equal to the time taken for the US wave to return back to the
sensor.

4 Ground This pin is connected to the Ground of the system.

HC-SR04 Sensor Features

• Operating voltage: +5V


• Theoretical Measuring Distance: 2cm to 450cm
• Practical Measuring Distance: 2cm to 80cm
• Accuracy: 3mm
• Measuring angle covered: <15°
• Operating Current: <15mA
Page 19
• Operating Frequency: 40Hz

Equivalent distance measuring Sensors

US transmitter Receiver pair, IR sensor module, IR sensor pair, IR Analog distance


sensor,

HC-SR04 Ultrasonic Sensor - Working

As shown above the HC-SR04 Ultrasonic (US) sensor is a 4 pin module, whose pin
names are Vcc, Trigger, Echo and Ground respectively. This sensor is a very popular
sensor used in many applications where measuring distance or sensing objects are
required. The module has two eyes like projects in the front which forms the Ultrasonic
transmitter and Receiver. The sensor works with the simple high school formula that

Distance = Speed × Time

The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and
when it gets objected by any material it gets reflected back toward the sensor this
reflected wave is observed by the Ultrasonic receiver module as shown in the picture
below

Now, to calculate the distance using the above formulae, we should know the Speed
and time. Since we are using the Ultrasonic wave we know the universal speed of US
wave at room conditions which is 330m/s. The circuitry inbuilt on the module will
calculate the time taken for the US wave to come back and turns on the echo pin high

Page 20
for that same particular amount of time, this way we can also know the time taken. Now
simply calculate the distance using a microcontroller or microprocessor.

How to use the HC-SR04 Ultrasonic Sensor

HC-SR04 distance sensor is commonly used with both microcontroller and


microprocessor platforms like Arduino, ARM, PIC, Raspberry Pie etc. The following
guide is universally since it has to be followed irrespective of the type of computational
device used.

Power the Sensor using a regulated +5V through the Vcc ad Ground pins of the sensor.
The current consumed by the sensor is less than 15mA and hence can be directly
powered by the on board 5V pins (If available). The Trigger and the Echo pins are both
I/O pins and hence they can be connected to I/O pins of the microcontroller. To start
the measurement, the trigger pin has to be made high for 10uS and then turned off. This
action will trigger an ultrasonic wave at frequency of 40Hz from the transmitter and the
receiver will wait for the wave to return. Once the wave is returned after it getting
reflected by any object the Echo pin goes high for a particular amount of time which
will be equal to the time taken for the wave to return back to the sensor.

The amount of time during which the Echo pin stays high is measured by the
MCU/MPU as it gives the information about the time taken for the wave to return back
to the Sensor. Using this information the distance is measured as explained in the above
heading.

Applications

• Used to avoid and detect obstacles with robots like biped robot, obstacle avoider
robot, path finding robot etc.
• Used to measure the distance within a wide range of 2cm to 400cm
• Can be used to map the objects surrounding the sensor by rotating it
• Depth of certain places like wells, pits etc can be measured since the waves can
penetrate through water

Page 21
L293D DRIVER IC
L293D is a dual H-Bridge motor driver, so with one IC we can interface two DC motors
which can be controlled in both clockwise and counter clockwise direction and if you
have motor with fix direction of motion the you can make use of all the four I/Os to
connect up to four DC motors. L293D has output current of 600mA and peak output
current of 1.2A per channel. More over for protection of circuit from back EMF output
diodes are included within the IC. The output supply (VCC2) has a wide range from
4.5V to 36V, which has made L293D a best choice.

A simple schematic for interfacing a DC motor using L293D is shown below.

As you can see in the circuit, three pins are needed for interfacing a DC motor (A, B,
Enable). If you want the o/p to be enabled completely then you can connect Enable to
VCC and only 2 pins needed from controller to make the motor work.As per the truth
Page 22
mentioned in the image above its fairly simple to program the microcontroller. Its also
clear from the truth table of BJT circuit and L293D the programming will be same for
both of them, just keeping in mind the allowed combinations of A and B.

L293D IC:

PIN DESCRIPTION:

Pin No Function Name


1 Enable pin for Motor 1; active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground (0V) Ground
5 Ground (0V) Ground
6 Output 2 for Motor 1 Output 2
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Output 3
12 Ground (0V) Ground
13 Ground (0V) Ground

Page 23
14 Output 2 for Motor 1 Output 4
15 Input2 for Motor 1 Input 4
16 Supply voltage; 5V (up to 36V) Vcc 1

FEATURES:

• L293D is a dual H-Bridge motor driver, So with one IC we can interface two
DC motors and one stepper motor
• 600mA output current capability per channel
• 1.2A peak output current (non repetitive) per channel
• Enable facility
• Over temperature protection
• Logical "0" input voltage up to 1.5 V(High noise immunity)
• Internal clamp diodes

DC MOTOR

An electric motor is a machine which converts electrical energy into mechanical energy.
Principles of operation

In any electric motor, operation is based on simple electromagnetism. A current-


carrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor,
and to the strength of the external magnetic field. As you are well aware of from playing
with magnets as a kid, opposite (North and South) polarities attract, while like polarities
(North and North, South and South) repel. The internal configuration of a DC motor is

Page 24
designed to harness the magnetic interaction between a current-carrying conductor and
an external magnetic field to generate rotational motion.

Let's start by looking at a simple 2-pole DC electric motor (here red represents a

magnet or winding with a "North" polarization, while green represents a magnet or


winding with a "South" polarization).

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator,
field magnet(s), and brushes. In most common DC motors (and all that Beamers will
see), the external magnetic field is produced by high-strength permanent magnets1. The
stator is the stationary part of the motor -- this includes the motor casing, as well as two
or more permanent magnet pole pieces. The rotor (together with the axle and attached
commutator) rotates with respect to the stator. The rotor consists of windings (generally
on a core), the windings being electrically connected to the commutator. The above
diagram shows a common motor layout -- with the rotor inside the stator (field)
magnets.

The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnet(s)
are misaligned, and the rotor will rotate until it is almost aligned with the stator's field
magnets. As the rotor reaches alignment, the brushes move to the next commutator
contacts, and energize the next winding. Given our example two-pole motor, the
rotation reverses the direction of current through the rotor winding, leading to a "flip"
of the rotor's magnetic field, driving it to continue rotating.

Page 25
In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can
imagine how with our example two-pole motor, if the rotor is exactly at the middle of
its rotation (perfectly aligned with the field magnets), it will get "stuck" there.
Meanwhile, with a two-pole motor, there is a moment where the commutator shorts out
the power supply (i.e., both brushes touch both commutator contacts simultaneously).
This would be bad for the power supply, waste energy, and damage motor components
as well. Yet another disadvantage of such a simple motor is that it would exhibit a high
amount of torque "ripple" (the amount of torque it could produce is cyclic with the
position of the rotor).

Figure 1: Force in DC Motor Figure 2 : Magnetic Field in DC Motor

Page 26
Figure 3 : Torque in DC Motor Figure 4 : Current Flow in DC Motor

If an Electric current flows through two copper wires that are between the poles of a
magnet, an upward force will move one wire up and a downward force will move the
other wire down. The loop can be made to spin by fixing a half circle of copper which
is known as COMMUTATOR to each end of the loop. Current is passed into and out
of the loop by brushes that press onto the strips. The BRUSHES do not go round so the
wire do not get twisted. This arrangement also makes sure that the current always
passes down on the right and back on the left so that the rotation continues. This is how
a simple Electric motor is made.

APPLICATIONS:

1. Machines.
2. Material handler conveyors
3. System and gear drivers
4. Elevators
5. mixers

LCD

To display any character on LCD micro controller has to send its ASCII value to the
data bus of LCD. For e.g. to display 'AB' microcontroller has to send two hex bytes 41h
and 42h respectively.LCD display used here is having 16x2 size. It means 2 lines each
with 16 characters.

Page 27
Pins Functions

There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the
background light is built in). Their function is described in the table below:

Function Pin Name Logic Description


Number State

Ground 1 Vss - 0V

Power supply 2 Vdd - +5V

Contrast 3 Vee - 0 – Vdd

Control of 4 RS 0 D0 – D7 are interpreted as


operating 1 commands
D0 – D7 are interpreted as
data

5 R/W 0 Write data (from


1 controller to LCD)
Read data (from LCD to
controller)

Page 28
6 E 0 Access to LCD disabled
1 Normal operating
From 1 Data/commands are
to 0 transferred to LCD

Data / 7 D0 0/1 Bit 0 LSB


commands
8 D1 0/1 Bit 1

9 D2 0/1 Bit 2

10 D3 0/1 Bit 3

11 D4 0/1 Bit 4

12 D5 0/1 Bit 5

13 D6 0/1 Bit 6

14 D7 0/1 Bit 7 MSB

Algorithm to send data to LCD:

1. Make R/W low

2. Make RS=0; if data byte is command

RS= 1; if data byte is data (ASCII value)

3. Place data byte on data register

4. Pulse E (HIGH to LOW)

5. Repeat the steps to send another data byte

LCD Initialization:

This is the pit fall for beginners. Proper working of LCD depend on the how the LCD
is initialized. We have to send few command bytes to initialize the LCD. Simple steps
to initialize the LCD

Page 29
1. Specify function set: Send 38H for 8-bit, double line and 5x7 dot character
format.

2. Display On-Off control: Send 0FH for display and blink cursor on.

3. Entry mode set: Send 06H for cursor in increment position and shift is invisible.

4. Clear display: Send 01H to clear display and return cursor to home position.

Addresses of cursor position for 16x2 HD44780 LCD


line1 80H 81H 82H 83H 84H 85H 86H 87H 88H 89H 8AH 8BH 8CH 8DH 8EH 8FH

line2 C0H C1H C2H C3H C4H C5H C6H C7H C8H C9H CAH CBH CCH CDH CEH CFH

Contrast control (Potentiometer):

To have a clear view of the characters on the LCD, contrast should be adjusted. To
adjust the contrast, the voltage should be varied. For this, a preset is used which can
behave like a variable voltage device. As the voltage of this preset is varied, the
contrast of the LCD can be adjusted.

Variable resistors used as potentiometers have all three terminals connected. This
arrangement is normally used to vary voltage, for example to set the switching point of
a circuit with a sensor, or control the volume (loudness) in an amplifier circuit. If the
terminals at the ends of the track are connected across the power supply, then the wiper
terminal will provide a voltage which can be varied from zero up to the maximum of
the supply.

Page 30
CHAPTER-4

EXPERIMENTAL RESULT

In this project we controlled the speed of a Vehicle in a School zone, Work Zone, Curve
zone, Highway, U-turn. Prevent the accidents by detecting the collision distance and
speed using Ultrasonic sensor. The output of the gas sensor is given to LM358 dual
operational amplifier where it is compared with the threshold value for gas density
which is set using preset potentiometers and amplified. If the sensed voltage is greater
than the preset threshold voltage, the operational amplifier output on the driver circuit
for Buzzer.

CHAPTER 5
ADVANTAGES AND APLLICATIONS

5.1 ADVANTAGES
1. Avoid accidents in curve roads mountains roads and hill roads.

2. Saves thousands of lives.

3. Easily implementable to the existing roads.

4. Fully automated (No person is required to operate).

5. Installation cost is very less.

6. Vehicle monitoring systems can be implemented easily.

5.2 APPLICATIONS

• Real time traffic control


• It can be implemented in automated systems for wireless control.
• Controlling the horn of the vehicles across schools, hospitals etc

Page 31
CHAPTER 6

CONCLUSION AND FUTURESCOPE

CONCLUSION

In this project we present heavy traffic zone accident preventions technique in the real
world. It has been mainly designed in order to avoid accidents and to alert the drivers
about the speed limits for safe travelling. It can be utilized in special areas with sudden
sharp & high curve and thus accident are prevented in old bridges and Ghats section. It
is used to control the speed of the vehicle in hospital, school, and work zones. Accidents
can be prevented which are caused by the negligent driving or speeding of the user.
Heavy traffic zone are schools, hospitals, Highways, U-turn etc. There the Vehicle
speed can controlled automatically without the help of the driver. At the same time it
detects obstacle and stops the vehicle, so that accident will be prevented.

FUTURE SCOPE

Impact sensors can be used for detecting the damage caused to a vehicle during an
accident. GSM and GPRS can be used for tracing the location of the vehicle and
message is send to user’s relatives and the police station in the case of accident.

Page 32
REFERENCES

[1] Asmita H, Jathin Sreenivas, Nandini S Kannan and Sarita, “Accident and
Detection”, Volume V, Issuse V, May 2016.

[2] Supriya Vidhate, Mamta Tadavi, Manisha Jagtap and Rajratan Janrao, “Accident
Identification System with SMS Notification”, International Journal of Informative and
Futuristic Research, Volume 2, Issue 2, Octobet 2014.

[3] G.Chaitanya and B. Santosh Kumar, “Vehicle Control System Based on MEMS”,
International Journal of Engineering Trends and Technology, Volume 16, Issue 9,
October 2014.

[4] Rachita Shettar, Sandeep Dabhade, Basavaraj Viraktamath, Amit Dalal and Varsha
B. Vannur, ”Design and Development of Accident Prevention and Control system”,
International Journal of Engineering Research and Technology, Volume 4, Issues 05,
May 2015.

[5] Sachine M. S and Prasanna P, “Automatic Vehicle Accident Detection and Traffic
Control System”, International Journal on Recent and Innovative Trends in Computing
and Communication, Volume 3, Issue 6, June2015.

[6] A Vengadesh, et.al., Automatic Speed Control of Vehicle in Restricted Areas Using
RF and GSM, Volume 02, Issue 09, December 2015, pp.875-877.

[7] Akash Batra, et.al., Automatic Car Speed Control with Wireless RF Control, ISSN:
2277-9655, et al., 7(4): April 2018, pp.592-597.

Page 33
[8] R. Ashok Kumar et.al., A Beacon Based Automatic Vehicle Speed Control System
for Restricted Zone, Volume 7, Issue X, October 2018, pp.1152-1159.

[9] Shankhavi K B, et.al., Vehicle Speed Control using RF Communication, Volume


13, Issue 1, May 2016, ISSN: 2349 – 9303.

[10] R. Deepa. Design of Vehicle Speed Control System Using Wireless Instrument
Cluster, Volume 4, Issue 1, January 2015.

[11] Sunil R Kewate, et.al., Automatic speed control system by the color sensor for
automobiles – An innovative model based approach, ISSN 2250-3234, volume 4,
number 2 (2014), pp. 223-230.

[12] Dr. K. S. Tamilselvan, et.al., Android Based Vehicle Speed Control System in
Critical Zone Using GPS Technology, volume 7, issue 6, June 2018, pp.639-644.

[13] K. Govindaraju, et.al., Embedded Based Vehicle Speed Control System Using
Wireless Technology, Volume 2, Issue 8, August 2014, pp.1841-1844.

[14] Gopal P. Gawande, et.al., Review of Speed Control and Automatic Braking
System, Volume 3, Issue 2, February 2014, pp.474-476.

Page 34

You might also like