You are on page 1of 19

“Reverse car parking system using arduino”

A mini-project report
Submitted in partial fulfillment
for the degree of

Bachelor of Technology
In
Electronics and Communication Engineering

Submitted By

(i) Yatharth Pandey


(ii) Neeraj Rawat
(iii) Pramod Prasad
(iv) Pranesh Kumar
(Batch:2016-2020)

Department of Electronics and Communication Engineering


School of Engineering and Technology
H.N.B.Garhwal Central University ,Srinagar Garhwal
2018-19

1
TABLE OF CONTENT
Contents Page No.

Acknowledgement……………………………………………………………i

Abstract………………………………………………………………………ii

Table of Content……………………………………………………………..iii

List of figures………………………………………………………………...iv

References

2
ACKNOWLEDGEMENT

We would like to thank respected all faculty members for giving us such an opportunity to
expand our knowledge for our branch and giving us guidelines for writing a report .It helped me
a lot to realize of what we study for.

We would like to thank our parents who patiently helped us and for the financial support.We
would like to thank our friends who helped us to make our work more organized and well-
stacked till the end. I would thank Microsoft for developing such a wonderful tool like MS word.
It helped us to work in error free manner.

(i)

3
ABSTRACT

Parking a car in congested parking lots and tiny spaces is a tedious job and the important thing is
that you must be very careful while reversing so that you do not damage the car (your car or the
adjacent one. Almost all modern cars are equipped with reverse parking sensors that are
activated when the car is put in reverse gear and beep at variable rate depending on the distance
between the car and the closest obstacle.The Reverse Parking Sensors that are equipped in the
car are basically Ultrasonic Proximity Sensors i.e. they use Ultrasonic Sensors to measure the
distance between the car and the object and warn the driver if the car is too close. In this project,
I have built a simple prototype of a Car Reverse Parking Sensor with the help of Arduino UNO
and the very famous HC-SR04 Ultrasonic Sensor Although this system can be implemented in
several DiY projects involving robots, autonomous vehicles etc., I wouldn’t recommend it to
actually implement in your car (if your car isn’t already equipped with one)

(ii)

4
Table of Content
Sr.No. Content Page No.

1. Introduction 1
2. Main components 7-12
2.1 Arduino Uno 7-8
2.2 liquid crystal display screen 16x2 8-9
2.3 Buzzer 10-11
3. circuit design 12

4. program 12-19
5. conclusion 19

(iii)

5
List of figures

Sr.No Figure Page No.

1. Arduio Uno………………………………………………………………………..…..1

2. LCD ………………………………………………………………………………..…2

3. Buzzer……………………………………………………………………………….....3

4. Ultra sonic sensor……………………………………………………………………....4


5. Circuit diagram………………………………………………………………………..5

(iv)

6
1.Introduction

A reverse car parking defect is a term used to describe several scenarios in which cars with
automatic transmission can fail to properly engage the parking mechanism, causing the vehicle to
unintentionally roll, sometimes resulting in injury or vehicular accidents. The term has
significance in product liability law, and in a number of major cases in the United States have
been brought in which car manufacturers were accused of negligence for not addressing an
alleged dangerous flaw in the transmission. A "park-to-reverse" situation involves a driver who
believes that they have shifted into "park" and believing so, and the vehicle not moving when
they pull their foot off the brake, proceeds to exit the vehicle. There can then be a delay in
vehicle movement sufficient for the driver to either fully or partially exit the vehicle before the
vehicle moves. Typically, the vehicle will move backwards. However, when on certain vehicles
the shift selector can be placed between the detented park and reverse gear positions; i.e. in
"false park" the transmission is in hydraulic neutral, without the parking pawl engaged. As such
the vehicle can also roll either forward or back in neutral. While less common, transmissions
with the defect, can also be shifted to between "neutral" and "drive", and then self shift into
"drive" or roll (called a "neutral to drive" accident). "Park-to-Reverse" issues are nearly always
caused by several possible design flaws in a vehicle's transmission which makes it possible for a
driver to unknowingly place the vehicle's shift selector into a position in between the "park" and
"reverse" gear positions. Yet rather than being in "park', this area is a transitional zone between
gears, which is sometimes called "false park"

2. Main components

2.1. Arduino

Arduino/Genuino Uno is a microcontroller board based on the ATmega328P (datasheet). It has


14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
quartz crystal, 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. You can tinker with your
UNO without worring too much about doing something wrong, worst case scenario you can
replace the chip for a few dollars and start over again.

7
"Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0.
The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform; for an extensive list of current, past or
outdated boards see the Arduino index of boards.

Fig – 2.1.1

2.2 LCD

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.
Alphanumeric displays are used in a wide range of applications, including palmtop computers,

8
word processors, photocopiers, point of sale terminals, medical instruments, cellular phones, etc.
The 16 x 2 intelligent alphanumeric dot matrix display is capable of displaying 224 different
characters and symbols. A full list of the characters and symbols is printed on pages 7/8 (note
these symbols can vary between brand of LCD used). This booklet provides all the technical
specifications for connecting the unit, which requires a single power supply (+5V). We come
across LCD displays everywhere around us. Computers, calculators, television sets, mobile
phones, digital watches use some kind of display to display the time. An LCD is an electronic
display module which uses liquid crystal to produce a visible image. The 16×2 LCD display is a
very basic module commonly used in DIYs and circuits. 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. 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.

Fig 2.2.1

9
2.3. Buzzer
The two most common technologies used in buzzer designs are magnetic and piezo. Many
applications use either a magnetic or a piezo buzzer, but the decision regarding which of the two
technologies to use is based upon many different constraints. Magnetic buzzers operate at lower
voltages and higher currents (1.5~12 V, > 20 mA) compared to piezo buzzers (12~220 V, < 20
mA), while piezo buzzers often have greater maximum sound pressure level (SPL) capability
than magnetic buzzers. However, it should be noted that the greater SPL available from piezo
buzzers requires larger footprints.

In a magnetic buzzer, a current is driven through a coil of wire which produces a magnetic field.
A flexible ferromagnetic disk is attracted to the coil when the current is present and returns to a
"rest" position when the current is not flowing through the coil. The sound from a magnetic
buzzer is produced by the movement of the ferromagnetic disk in a similar manner to how the
cone in a speaker produces sound. A magnetic buzzer is a current driven device, but the power
source is typically a voltage. The current through the coil is determined by the applied voltage
and the impedance of the coil.

Fig 2.3.1

10
2.4 Ultra Sonic sensor
Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact measurement
function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters,
receiver and control circuit. The basic principle of work: (1) Using IO trigger for at least 10us
high level signal, (2) The Module automatically sends eight 40 kHz and detect whether there is a
pulse signal back. (3) IF the signal back, through high level , time of high output IO duration is
the time from sending ultrasonic to returning. Test distance = (high level time×velocity of sound
(340M/S) / 2
The Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger
input to start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40
kHz and raise its echo. The Echo is a distance object that is pulse width and the range in
proportion .You can calculate the range through the time interval between sending trigger signal
and receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high
level time * velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to
prevent trigger signal to the echo signal.

Fig 2.4.1

11
4. Circuit diagram

Fig 2.5.1

5. Program
#include <NewPing.h> //https://bitbucket.org/teckel12/arduino-new-ping/downloads/

#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters).
Maximum sensor distance is rated at 400-500cm.

#include <LiquidCrystal.h> //http://www.arduino.cc/en/Tutorial/LiquidCrystal


int RS=A5, E=A4, D4=A3, D5=A2, D6=A1, D7=A0;
LiquidCrystal lcd(RS, E, D4, D5, D6, D7); // initialize the library with the numbers of the
interface pins
int Buzzer = 13;

12
int val=0;
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and
maximum distance.

// Creating Charaters for Bar Graph and Reverse Mode Icon


byte Level0[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b11111,
0b11111
};
byte Level1[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b11111,
0b11111,
0b11111,
0b11111
};
byte Level2[8] = {
0b00000,
0b00000,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
byte Level3[8] = {
0b11111,
0b11111,
0b11111,
0b11111,

13
0b11111,
0b11111,
0b11111,
0b11111
};
byte NoLevel[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
byte R [8] = {
0b11111,
0b10000,
0b10111,
0b10101,
0b10110,
0b10101,
0b10000,
0b11111
};
byte B [8] = {

0b11000,
0b01000,
0b01000,
0b01000,
0b01000,
0b01000,
0b01000,
0b11000
};

void setup()
{
lcd.createChar(0, Level0);

14
lcd.createChar(1, Level1);
lcd.createChar(2, Level2);
lcd.createChar(3, Level3);
lcd.createChar(4, NoLevel);
lcd.createChar(5, R);
lcd.createChar(6, B);
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
pinMode(Buzzer,OUTPUT); //Setup Buzzer pin as output pin
}

void loop()
{
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay
between pings.
lcd.setCursor(0, 0);
lcd.print("Distance: ");
val=sonar.ping_cm();
lcd.print(val);
lcd.print("cm ");
lcd.setCursor(8, 1);
lcd.write(byte(5));
lcd.setCursor(9, 1);
lcd.write(byte(6));
lcd.setCursor(10, 1);
lcd.print("Mode ");

if(val<=10&&val>0)
{
lcd.setCursor(0,0);
digitalWrite(Buzzer, HIGH); // turn the Buzzer on (HIGH is the voltage level)
lcd.print("******Stop******");
lcd.setCursor(0,1);
lcd.print("****************");

}
else if(val<=25&&val>10)
{
digitalWrite(Buzzer, HIGH); // turn the Buzzer on (HIGH is the voltage level)

15
delay(50); // wait for a second
digitalWrite(Buzzer, LOW); // turn the Buzzer off by making the voltage LOW
delay(50);
lcd.setCursor(0, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(1, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(2, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(3, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(4, 1);
lcd.write(byte(2));
lcd.setCursor(5, 1);
lcd.write(byte(2));
lcd.setCursor(6, 1);
lcd.write(byte(3));
lcd.setCursor(7, 1);
lcd.write(byte(3));

}
else if(val<=50&&val>25)
{
digitalWrite(Buzzer, HIGH); // turn the Buzzer on (HIGH is the voltage level)
delay(75); // wait for a second
digitalWrite(Buzzer, LOW); // turn the Buzzer off by making the voltage LOW
delay(75); // wait for a second
lcd.setCursor(0, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(1, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(2, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(3, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(4, 1);
lcd.write(byte(2));
lcd.setCursor(5, 1);

16
lcd.write(byte(2));
lcd.setCursor(6, 1);
lcd.write(byte(4));
lcd.setCursor(7, 1);
lcd.write(byte(4));

}
else if(val<=75&&val>50)
{
digitalWrite(Buzzer, HIGH); // turn the Buzzer on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(Buzzer, LOW); // turn the Buzzer off by making the voltage LOW
delay(100);
lcd.setCursor(0, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(1, 1); // bottom left
lcd.write(byte(0));
lcd.setCursor(2, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(3, 1); // bottom left
lcd.write(byte(1));
lcd.setCursor(4, 1);
lcd.write(byte(4));
lcd.setCursor(5, 1);
lcd.write(byte(4));
lcd.setCursor(6, 1);
lcd.write(byte(4));
lcd.setCursor(7, 1);
lcd.write(byte(4));

}
else if(val<=100&&val>75)
{
digitalWrite(Buzzer, HIGH); // turn the Buzzer on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(Buzzer, LOW); // turn the Buzzer off by making the voltage LOW
delay(200);

17
lcd.setCursor(0, 1); // bottom leftlcd.setCursor(0, 1); // bottom left
lcd.write(byte(0));lcd.write(byte(0));
lcd.setCursor(1, 1); // bottom leftlcd.setCursor(1, 1); // bottom left
lcd.write(byte(0));lcd.write(byte(0));
lcd.setCursor(2, 1); // bottom left
lcd.write(byte(4));
lcd.setCursor(3, 1); // bottom left
lcd.write(byte(4));
lcd.setCursor(4, 1);
lcd.write(byte(4));
lcd.setCursor(5, 1);
lcd.write(byte(4));
lcd.setCursor(6, 1);
lcd.write(byte(4));
lcd.setCursor(7, 1);
lcd.write(byte(4));

else if(val<MAX_DISTANCE)
{
// wait for a second
digitalWrite(Buzzer, LOW); // turn the Buzzer off by making the voltage LOW
lcd.setCursor(0, 1); // bottom leftlcd.setCursor(0, 1); // bottom left
lcd.write(byte(4));lcd.write(byte(0));
lcd.setCursor(1, 1); // bottom leftlcd.setCursor(1, 1); // bottom left
lcd.write(byte(4));lcd.write(byte(0));
lcd.setCursor(2, 1);
lcd.write(byte(4));
lcd.setCursor(3, 1);
lcd.write(byte(4));
lcd.setCursor(4, 1);
lcd.write(byte(4));
lcd.setCursor(5, 1);
lcd.write(byte(4));
lcd.setCursor(6, 1);
lcd.write(byte(4));
lcd.setCursor(7, 1);

18
lcd.write(byte(4));

}.

5 Conclusion
Although science and technology has emerged a lot and is still progressing rather be in
computer technology, automobiles etc We know that in automobiles sector many
countries are doing great and launching new products (vehicles). Instead of having many
advantages and features they may have some disadvantages too and one of them in
vehicles is reverse car parking. To rectify this problem we have developed a system
which will help us to park our vehicles in reverse direction without collision with any
obstacle in its vicinity By using following several components we have finally completed
it

• Arduino UNO

• Ultrasonic sensor(HC-SR04)

• LCD(16*2)

• PCB

• Battery(9v)

So at last we would like to conclude our project procedure in brief In this we used three
ultrasonic sensors, which will sense any obstacle in its desired range, with the help of
arduino controller. Arduino controller is used control these ultrasonic sensors through our
preinstalled program, we also use LCD to display the distance for more accuracy in
parking our vehicle, buzzers are used for indication of any obstacles which lie under its
range.

19