Miniproject 190515092415 1
Miniproject 190515092415 1
Miniproject 190515092415 1
on
BACHELOR OF TECHNOLOGY
in
Submitted By
2014-2018
GEETHANJALI COLLEGE OF ENGINEERING AND
TECHNOLOGY
This is to certify that the project report titled ARDUINO BASED COLLISION
PREVENTION WARNING SYSTEM being submitted by Ch.Madhav Reddy, A.Madhu
Viveka, B.Divya, bearing hall ticket number 14R11A0474, 14R11A0462, 14R11A0465, in partial
fulfillment for the award of the Degree of Bachelor of Technology in Electronics and
Communication Engineering is a record of bona fide work carried out under my guidance and
supervision. The results embodied in this report have not been submitted to any other University
for the award of any degree.
Internal Guide
Ms.M . Laxmi Dr. Vijaya Gunturu
Associate Professor Professor and HoD(ECE)
We are highly grateful to the great personality in the field of Electronics, none other
than Dr.Vijaya Gunturu, Professor and Head of the Department of Electronics and
Communication Engineering of GCET for guiding and taking care of our career in this
field. We are ever thankful to the Professor.
We are very happy for being guided by Ms. M Laxmi, Associate Professor for her
able guidance given to us to complete our technical work successfully.
Lastly, we like to thank our coordinator Prof. O.V.P.R. Siva Kumar for giving us
this opportunity to present the technical project work.
Above all, we are very much thankful to the management of Geethanjali College of
Engineering and Technology which was established by the high profile intellectuals for
the cause of Technical Education in modern era. We wish that GCET sooner should
become a deemed university and produce uncountable young engineers and present them
to the modern technical world.
With Regards
B.DIVYA (14R11A0465)
CONTENTS PAGE NO.s
Abstract i
List of Figures ii
1.1 HISTORY 2
1.2 TOOLS 2
1.3 RESOURCE 3
2.1 DEBBUGING 5
2.2 RELIABILITY 6
4.1.1 Types 15
4.1.2 Features 16
4.2.1 Description 21
4.3.1 Features 22
4.4 BUZZER 26
4.5 LED 26
5.3 PROGRAM 31
5.5 ADVANTAGES 36
6.1 WORKING 38
Chapter-7. RESULTS 40
Chapter-8. CONCLUSION 41
Chapter-10. REFERENCES 43
i
ABSTRACT
The objective of this project is to provide collision prevention warning system on a vehicle
to provide road safety for drivers. A collision prevention warning system is an automobile
safety system designed to reduce the severity of a collision. It is also known as a pre-crash
system, forward collision warning system, or collision mitigating system. Basically, the
distance between vehicles are segmented into three different zones. These are zone 1,
zone 2, zone 3.
This is an Arduino based collision prevention warning system. This kind of system is
the fastest growing safety feature in automotive industries. Such a system enables vehicles
to identify the chances of collision and give visual and audio warning to driver, so that the
driver can take necessary action to avoid collision.
ii
CHAPTER -1
Embedded systems are controlled by one or more main processing cores that are
typically either microcontrollers or digital signal processors (DSP). The key characteristic,
however, is being dedicated to handle a particular task, which may require very powerful
processors. For example, air traffic control systems may usefully be viewed as embedded,
even though they involve mainframe computers and dedicated regional and national
networks between airports and radar sites. (Each radar probably includes one or more
embedded systems of its own).
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale. Physically embedded systems range from portable devices such as digital watches
and MP3 players, to large stationary installations like traffic lights, factory controllers, or
the systems controlling nuclear power plants. Complexity varies from low, with a single
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure. In general, "embedded system" is not a strictly
definable term, as most systems have some element of extensibility or programmability.
For example, handheld computers share some elements with embedded systems such as the
operating systems and microprocessors which power them, but they allow different
applications to be loaded and peripherals to be connected. Moreover, even systems which
don't expose programmability as a primary feature generally need to support software
updates. On a continuum from "general purpose" to "embedded", large application systems
will have subcomponents at most points even if the system as a whole is "designed to
2
perform one or a few dedicated functions", and is thus appropriate to call "embedded". A
modern example of embedded system is shown in
1.1 HISTORY
In the earliest years of computers in the 1930–40s, computers were sometimes
dedicated to a single task, but were far too large and expensive for most kinds of tasks
performed by embedded computers of today. Over time however, the concept
of programmable controllers evolved from traditional electromechanical sequencers, via
solid state devices, to the use of computer technology.
One of the first recognizably modern embedded systems was the Apollo Guidance
computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At
the project's inception, the Apollo guidance computer was considered the riskiest item in
the Apollo project as it employed the then newly developed monolithic integrated circuits
to reduce the size and weight. An early mass-produced embedded system was the
Autonetics D-17 guidance computer for the minuteman missile, released in 1961. It was
built from transistor logic and had a hard disk for main memory. When the Minuteman II
went into production in 1966, the D-17 was replaced with a new computer that was the
first high-volume use of integrated circuits.
1.2 TOOLS
Embedded development makes up a small fraction of total programming. There's
also a large number of embedded architectures, unlike the PC world where 1 instruction set
rules, and the Unix world where there's only 3 or 4 major ones. This means that the tools
are more expensive. It also means that they're lowering featured, and less developed. On a
3
major embedded project, at some point you will almost always find a compiler bug of
some sort.
Debugging tools are another issue. Since you can't always run general programs on
your embedded processor, you can't always run a debugger on it. This makes fixing your
program difficult. Special hardware such as JTAG ports can overcome this issue in part.
However, if you stop on a breakpoint when your system is controlling real world hardware
(such as a motor), permanent equipment damage can occur. As a result, people doing
embedded programming quickly become masters at using serial IO channels and error
message style debugging.
1.3 RESOURCES
To save costs, embedded systems frequently have the cheapest processors that can do
the job. This means your programs need to be written as efficiently as possible. When
dealing with large data sets, issues like memory cache misses that never matter in PC
programming can hurt you. Luckily, this won't happen too often- use reasonably efficient
algorithms to start, and optimize only when necessary. Of course, normal profilers won't
work well, due to the same reason debuggers don't work well. Memory is also an issue.
For the same cost savings reasons, embedded systems usually have the least memory they
can get away with. That means their algorithms must be memory efficient (unlike in PC
programs, you will frequently sacrifice processor time for memory, rather than the
reverse). It also means you can't afford to leak memory. Embedded applications generally
use deterministic memory techniques and avoid the default "new" and "malloc" functions,
so that leaks can be found and eliminated more easily. Other resources programmers
expect may not even exist. For example, most embedded processors do not have
hardware FPUs (Floating-Point Processing Unit). These resources either need to be
emulated in software, or avoided altogether.
4
CHAPTER-2
The uses of embedded systems are virtually limitless, because every day new
products are introduced to the market that utilizes embedded computers in novel ways. In
recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have
become much cheaper. So when implementing a new form of control, it's wiser to just buy
the generic chip and write your own custom software for it. Producing a custom-made chip
to handle a particular task or set of tasks costs far more time and money. Many embedded
computers even come with extensive libraries, so that "writing your own software"
becomes a very trivial task indeed. From an implementation viewpoint, there is a major
difference between a computer and an embedded system. Embedded systems are often
required to provide Real-Time response. The main elements that make embedded systems
unique are its reliability and ease in debugging.
2.1 DEBUGGING
Embedded debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate they can be roughly grouped into the
following areas:
Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
An in-circuit debugger (ICD), a hardware device that connects to the microprocessor
via a JTAG or Nexus interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in the
processor.
An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
A complete emulator provides a simulation of all aspects of the hardware, allowing all
of it to be controlled and modified, and allowing debugging on a normal PC.
6
Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.
2.2 RELIABILITY
Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by them if an error occurs. Therefore the software
is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backup s is selected by an operator. Examples include aircraft navigation,
reactor control systems, safety-critical chemical factory controls, train signals, engines on
single-engine aircraft.
The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
A variety of techniques are used, sometimes in combination, to recover from
errors—both software bugs such as memory leaks, and also soft errors in the hardware:
7
Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
Subsystems with redundant spares that can be switched over to
software "limp modes" that provide partial function
Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly
secure & reliable system environment
An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software.
8
CHAPTER – 3
Cooperative Multitasking:
A non-preemptive multitasking system is very similar to the simple control loop scheme,
except that the loop is hidden in an API. The programmer defines a series of tasks, and
each task gets its own environment to “run” in. When a task is idle, it calls an idle routine,
usually called “pause”, “wait”, “yield”, “nop” (stands for no operation), etc.The advantages
and disadvantages are very similar to the control loop, except that adding new software is
easier, by simply writing a new task, or adding to the queue-interpreter.
Primitive Multitasking:
In this type of system, a low-level piece of code switches between tasks or threads based
on a timer (connected to an interrupt). This is the level at which the system is generally
considered to have an "operating system" kernel. Depending on how much functionality is
9
required, it introduces more or less of the complexities of managing multiple tasks running
conceptually in parallel.
As any code can potentially damage the data of another task (except in larger
systems using an MMU) programs must be carefully designed and tested, and access to
shared data must be controlled by some synchronization strategy, such as message queues,
semaphores or a non-blocking synchronization scheme.Because of these complexities, it is
common for organizations to buy a real-time operating system, allowing the application
programmers to concentrate on device functionality rather than operating system services,
at least for large systems; smaller systems often cannot afford the overhead associated with
a generic real time system, due to limitations regarding memory size, performance, and/or
battery life.
These embedded systems follow an absolute dead line time period i.e.., if the tasking
is not done in a particular time period then there is a cause of damage to the entire
equipment.
Eg: Consider a TV remote control system, if the remote control takes a few
milliseconds delay it will not cause damage either to the TV or to the remote control.
These systems which will not cause damage when they are not operated at considerable
time period those systems comes under soft real-time embedded systems.
Eg:Consider a web camera that is connected to the computer with internet can be
used to spread communication like sending pictures, images, videos etc.., to another
computer with internet connection throughout anywhere in the world.
Whenever a person comes near the door, it captures the image of a person and sends
to the desktop of your computer which is connected to internet. This gives an alerting
message with image on to the desktop of your computer, and then you can open the door
lock just by clicking the mouse. Fig: 2.2 show the network communications in embedded
systems.
11
Among these Microcontroller is of low cost processor and one of the main advantage
of microcontrollers is, the components such as memory, serial communication interfaces,
analog to digital converters etc.., all these are built on a single chip. The numbers of
external components that are connected to it are very less according to the application.
Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires many
external components like memory, serial communication, hard disk, input output ports
etc.., so the power consumption is also very high when compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved
with processing of signals
12
In critical industries where human presence is avoided there we can use robot which are
programmed to do a specific operation.
CHAPTER -4
HARDWARE IMPLEMENTATION
ARDUINO UNO
ULTRA SONIC SENSOR
LCD 16*2 MODULE
BUZZER
LED
BREAD BOARD
For instance, you can read a humidity sensor connected to a potted plant and turn on
an automatic watering system if it gets too dry. Or, you can make a stand-alone chat server
which is plugged into your internet router. Or, you can have it tweet every time your cat
passes through a pet door. Or, you can have it start a pot of coffee when your alarm goes
off.
Basically, if there is something that is in any way controlled by electricity, the
Arduino can interface with it in some manner. And even if it is not controlled by
electricity, you can probably still use things like motors and electromagnets, to interface it.
The possibilities of the Arduino are almost limitless. As such, there is no way that
one single tutorial can cover everything you might ever need to know. That said, I've done
my best to give a basic overview of the fundamental skills and knowledge that you need to
get your Arduino up and running. If nothing more, this should function as a springboard
into further experimentation and learning.
15
Arduino Uno
The most common version of Arduino is the Arduino Uno. This board is what most people
are talking about when they refer to an Arduino. In the next step, there is a more complete
rundown of its features.
The Diecimila and NG use an ATMEGA168 chips (as opposed to the more powerful
ATMEGA328),
Both the Diecimila and NG have a jumper next to the USB port and require manual
selection of either USB or battery power.
The Arduino NG requires that you hold the rest button on the board for a few seconds
prior to uploading a program.
ArduinoLilyPad
The LilyPad was designed for wearable and e-textile applications. It is intended to be sewn
to fabric and connected to other sewable components using conductive thread. This board
requires the use of a special FTDI-USB TTL serial programming cable. For more
information, the Arduino LilyPad page is a decent starting point.
An open source design. The advantage of it being open source is that it has a large
community of people using and troubleshooting it. This makes it easy to find someone to
help you debug your projects.
An easy USB interface . The chip on the board plugs straight into your USB port and
registers on your computer as a virtual serial port. This allows you to interface with it as
through it were a serial device. The benefit of this setup is that serial communication is an
extremely easy (and time-tested) protocol, and USB makes connecting it to modern
computers really convenient.
Very convenient power management and built-in voltage regulation. You can connect
an external power source of up to 12v and it will regulate it to both 5v and 3.3v. It also can
be powered directly off of a USB port without any external power.
An easy-to-find, and dirt cheap, microcontroller "brain." The ATmega328 chip retails
for about $2.88 on Digikey. It has countless number of nice hardware features like timers,
PWM pins, external and internal interrupts, and multiple sleep modes. Check out the
official datasheet for more details.
A 16mhz clock. This makes it not the speediest microcontroller around, but fast
enough for most applications.
13 digital pins and 6 analog pins. These pins allow you to connect external hardware
to your Arduino. These pins are key for extending the computing capability of the Arduino
into the real world. Simply plug your devices and sensors into the sockets that correspond
to each of these pins and you are good to go.
An ICSP connector for bypassing the USB port and interfacing the Arduino directly as
a serial device. This port is necessary to re-bootload your chip if it corrupts and can no
longer talk to your computer.
An on-board LED attached to digital pin 13 for fast an easy debugging of code.
And last, but not least, a button to reset the program on the chip.
The Arduino has two different types of input pins, those being analog and digital.
1 or 0
5V or 0V.
This input is commonly used to sense the presence of voltage when a switch is opened or
closed.
Digital inputs can also be used as the basis for countless digital communication protocols.
By creating a 5V (HIGH) pulse or 0V (LOW) pulse, you can create a binary signal, the
basis of all computing. This is useful for talking to digital sensors like a PING ultrasonic
sensor.
For a simple example of a digital input in use, connect a switch from digital pin 2 to 5V, a
10K resistor from digital pin 2 to ground, and run the following code:
connects to ground. Instead, electricity flows between 5V and the digital pin. This is
because electricity always chooses the path of least resistance.
The Arduino Uno R3 is a open source microcontroller board based on the ATmega328
chip. This Board has 14 digital input/output pins, 6 analog input pins, Onboard 16 MHz
ceramic resonator, Port for USB connection, Onboard DC power jack, An ICSP header and
a microcontroller reset button. It contains everything needed to support the
microcontroller. Using the board is also very easy, simply connect it to a computer with a
USB cable or power it with 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 Atmega16U2Atmega8U2 up to version R2)
programmed as a USB-to-serial converter. While 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. Also 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
19
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 5v to 12v for Arduino Uno.
DC Current: 40mA.
SRAM: 2 KB.
EEPROM: 1 KB.
Each of the 14 digital pins on the Arduino Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor of 20-50
kOhms.
Serial: pins 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: pins 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 attachInterrupt()
function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
20
LED: 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, labelled 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
analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
AREF: Reference voltage for the analog inputs. Used with analogReference().
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.
LCD (Liquid Crystal Display) screen is an electronic display module and find a
wide range of applications. A 16x2 LCD display is very basic module and is very
commonly used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special & even custom characters (unlike
in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines.
In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data.
21
The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it, clearing
its screen, setting the cursor position, controlling display etc. The data register stores the
data to be displayed on the LCD. The data is the ASCII value of the character to be
displayed on the LCD. Click to learn more about internal structure of a LCD.
4.2.1 Description
The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like
bats do. It offers excellent non-contact range detection with high accuracy and stable
readings in an easy-to-use package. From 2cm to 400 cm or 1” to 13 feet. It operation is
not affected by sunlight or black material like Sharp rangefinders are (although
acoustically soft materials like cloth can be difficult to detect). It comes complete with
ultrasonic transmitter and receiver module.
23
4.3.1 Features
Power Supply :+5V DC
Resolution : 0.3 cm
GND: GND
ultrasonic waves. After that the ultrasonic transmitter sends the waves at a predetermined
distance frontward. The maximum range for which obstacle can be detected depends on the
range of ultrasonic sensors used.
• Ultrasonic Receiver – If the ultrasonic wave detects the obstacle, it will produce a
reflected wave. An ultrasonic receiver is used for receiving the ultrasonic waves reflected
from the obstacle. The received ultrasonic wave is converted into a reception signal with
the help of a transducer. The signal is amplified by an amplifier (operational amplifier).
The amplified signal is compared with the reference signal, to detect components in
amplified signal due to obstacles on the road.
The ultrasonic sensor transmits sound waves and receives sound reflected from an
object. When ultrasonic waves are incident on an object, diffused reflection of the energy
takes place over a wide solid angle which might be as high as 180 degrees. Thus some
fraction of the incident energy is reflected back to the transducer in the form of echoes. If
the object is very close to the sensor, the sound waves returns quickly, but if the object is
far away from the sensor, the sound waves takes longer to return. But if objects are too far
away from the sensor, the signal takes so long to come back (or is very weak when it
comes back) that the receiver cannot detect it.: The sensor uses the time it takes for the
sound to come back from the object in front to determine the distance of an object.
The distance to the object (L) can then be calculated through the speed of ultrasonic waves
(v) in the medium by the relation, where, ‘t’ is the time taken by the wave to reach back to
the sensor and ‘Ɵ’ is the angle between the horizontal and the path taken as shown in the
25
figure. If the object is in motion, instruments based on Doppler shift are used. The
ultrasonic sensor can measure distances in centimetres and inches. It can measure from 0 to
2.5 meters, with a precision of 3 cm. HCSR04 range sensor HC-SR04 is a commonly used
module for non-contact distance measurement for distances from 2cm to 400cm. It has 4
pins: VCC – 5V, input power; TRIG – Trigger Input; ECHO – Echo Output; GND –
Ground Fig. 3: A trigger signal is provided to TRIG input, a HIGH signal of at least 10μS
duration. This enables the module to transmit eight 40KHz ultrasonic burst. If there is an
obstacle in-front of the module, it will reflect those ultrasonic waves. If the signal comes
back, the ECHO output of the module will be HIGH for duration of time taken for sending
and receiving ultrasonic signals. The Obstacle Depends obstacle from the sensor and it will
be about 38ms if there is no obstacle.
4.4 BUZZER
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm
devices, timers, and confirmation of user input such as a mouse click or keystroke.
4.5 LED
A light-emitting diode (LED) is a two lead semiconductor light source. It is a p-n
junction diode that emits light when activated.
When a suitable voltage is applied to the leads, electrons are able to recombine with
electron holes within the device, releasing energy in the form of photons. This effect is
called electroluminescence.
CHAPTER-5
SOFTWARE IMPLEMENTATION
The software used in this project is the ARDUINO IDE software 8.1.3.
: Arduino boards are able to read analog or digital input signals from different sensors
and turn it into an output such as activating a motor, turning LED on/off, connect to the
cloud and many other actions
. You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).
Unlike most previous programmable circuit boards, Arduino does not need an extra piece
of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++,
making it easier to learn to program. Finally, Arduino provides a standard form factor
that breaks the functions of the micro-controller into a more accessible package.
5.1 PROCEDURE
After learning about the main parts of the Arduino UNO board, we are ready to learn
how to set up the Arduino IDE. Once we learn this, we will be ready to upload our
program on the Arduino board.
In this section, we will learn in easy steps, how to set up the Arduino IDE on our
computer and prepare the board to receive the program via USB cable.
28
Step 1: First you must have your Arduino board (you can choose your favorite board) and
a USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega
2560, or Diecimila, you will need a standard USB cable
Step 2: Download Arduino IDE Software. You can get different versions of Arduino IDE
from the Download page on the Arduino Official website. You must select your software,
which is compatible with your operating system (Windows, IOS, or Linux). After your file
download is complete, unzip the file.
Step 3: Power up your board. The Arduino Uno, Mega, Duemilanove and Arduino Nano
automatically draw power from either, the USB connection to the computer or an external
power supply. If you are using an Arduino Diecimila, you have to make sure that the board
is configured to draw power from the USB connection. The power source is selected with a
jumper, a small piece of plastic that fits onto two of the three pins between the USB and
power jacks. Check that it is on the two pins closest to the USB port. Connect the Arduino
board to your computer using the USB cable. The green power LED (labeled PWR) should
glow.
Step 4: Launch Arduino IDE. After your Arduino IDE software is downloaded, you need
un zip the folder. Inside the folder, you can find the application icon with an infinity label
(application.exe). Double click the icon to start the IDE.
Step 5: Open your first project. Once the software starts, you have two options: Create a
new project. Open an existing project example.
Here, we have selected Arduino Uno board according to our tutorial, but you must
select the name matching the board that you are using.
Step 7: Select your serial port. Select the serial device of the Arduino board. Go to Tools -
> Serial Port menu. This is likely to be COM3 or higher (COM1 and COM2 are usually
29
reserved for hardware serial ports). To find out, you can disconnect your Arduino board
and re-open the menu, the entry that disappears should be of the Arduino board. Reconnect
the board and select that serial port
Step 8: Upload the program to your board. Before explaining how we can upload our
program to the board, we must demonstrate the function of each symbol appearing in the
Arduino IDE toolbar
Now, simply click the "Upload" button in the environment. Wait a few seconds; you
will see the RX and TX LEDs on the board, flashing. If the upload is successful, the
message "Doneuploading" will appear in the status bar.
30
LiquidCrystal lcd(6,7,8,9,10,11); // Creates an LCD object. Parameters: (rs, enable, d4, d5,
d6, d7)
int buzz = 2;
long duration;
int distance;
// the setup function runs once when you press reset or power the board
void setup() {
lcd.begin(16,2);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
Serial.begin(9600);
void loop()
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
digitalWrite(3, HIGH);
delay(100);
lcd.clear();
lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will
be displayed
lcd.print(" cm");
delay(10);
//lcd.clear();
// digitalWrite(3, LOW);
else
{
33
digitalWrite(3, LOW); // turn the LED off by making the voltage LOW
delay(100);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(buzz,HIGH);
delay(100);
lcd.clear();
lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will
be displayed
lcd.print(" cm");
delay(10);
/*tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);
tone(buzz, 2000);
34
delay(100);
noTone(buzz);
tone(buzz, 2000);
delay(100);
noTone(buzz);
delay(100);*/
else
digitalWrite(4, LOW); // turn the LED off by making the voltage LOW
delay(100);
digitalWrite(buzz,LOW);
5.5 ADVANTAGES
Intersection collision warning systems are designed to detect and warn drivers
of approaching traffic and potential right-of-way violations at intersections.
Obstacle detection systems use vehicle-mounted sensors to detect obstructions,
such as other vehicles, road debris, or animals in a vehicle's path or projected path
and alert the driver.
Forward collision warning systems, often known as rear end collision
avoidance systems, warn drivers that they are in a conflict situation with a lead
vehicle. These conflicts can arise when the lead vehicle is stopped, slowing, or
travelling at a constant speed.
CHAPTER-6
OPERATING PROCEDURE
The hardware you gather in first step, now connect all them to controller through wires.
Sensor to controller pin information :-
Sensor has four pins VCC, Trig, Echo and GND. Connect...
LCD Connections
6.1 WORKING
The basic idea behind this project is to avoid accident and prevent collision. It is a
precautionary measure that alerts the driver .The initial stage begins from the ultrasonic
sensor that identifies the vehicle in the front and back side. If the car is more than 40CM,
no warning is given means it is safe zone. If the car reaches to 20 cm it alerts the driver by
giving blue color light will glow that will show the notification and alerts the driver . At
distance below 20 cm distance red color light will alerts us that we are in danger zone by
producing a buzzer sound .At the same time the distance between one vehicle and another
vehicle will displayed in LCD. Wire connections are made from the bread board to the
LCD, aurdino kit to the ultrasonic sensors and finally bread board to the aurdino kit. This
project will make easy calculation of an distance between one vehicle and another vehicle
for the driver.
39
Zone 2 :- Only visual warning (In this zone driver has to pay attention)
Zone 3 :- Both visual and audio warning ( Driver has to take necessary action to avoid
collision)
40
CHAPTER-7
RESULTS
The project “Arduino based collision prevention warning system” was designed and is
found that the designed hardware and software has shown consistently faithful readings
and also proved to be accurate.
CHAPTER-8
CONCLUSION
In this paper we proposed and implement the collision prevention system. The basic idea
behind this project is to avoid collision and for detecting the obstacle. It is a precautionary
measure that alerts the driver .the initial stage begins from the ultrasonic sensor that
identifies the vehicle in the front and back side. .At 20 meter distance blue color light will
alerts us. When it reaches below 20meter distance red color light will alerts us we are in
danger zone by producing buzzer sound. At the same time the distance between one
vehicle and another vehicle was displayed in LCD. Wire connections are made from the
bread board to the LCD to aurdino kit and to the ultrasonic sensors and finally bread board
to the aurdino kit. This project will make easy calculation of an distance between one
vehicle and another vehicle for the driver. Using this system we may avoid many accidents
happened due to the following system .The system comprises, very low cost components
such as ultrasonic sensor, LCD and LEDs.
42
CHAPTER -9
FUTURE SCOPE
In this paper we proposed and implement the collision prevention system. Using this
system we may avoid many accidents happened due to the following system .The system
comprises, very low cost components such as ultrasonic sensor, LCD and LEDs. This
system might have many advantage such as:
CHAPTER 10
REFERENCES
https://www.youtube.com/watch?v=ontlwqrzfxo
http://howtomechatronics.com/tutorial.
https://plus.google.com/+Howtomechatr...
https://wapclub.xyz/.../
www.instructables.com/id/Arduino-LCD-Project-for-Measuring-Distance
www.toptechboy.com/arduino/lesson-20-arduino-lcd-project-for-measuring-distance-