You are on page 1of 9

Pie Infocomm - 2021

Project Report - IoT

Submitted By : Shubham Srivastava

Project Name : Arduino Based Car Parking Assistance

Assisted By:- Mr. Shahil Gupta


INDEX
❏ Front Page 1
❏ Index 2
❏ Introduction 3
❏ Requiremnets 3-4
❏ Connection details 4
❏ Working Principle 5

Automated Car Parking Assistance

1. Introduction :
The objective of this report is to propose a smart self control system for automated car
parking which will help the user in the process of car parking and will safeguard the user’s
automobile from any mishap or bumping in any other object such as wall or any other things
which could cause any damage to the vehicle.

2. Requirements :
For the proposed system of automated car parking assistance system we will need
following hardware:

❏ Arduino Uno:- The Arduino Uno 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.

❏ Ultrasonic Sensor (HC-SR04):- An ultrasonic sensor is an electronic device that


measures the distance of a target object by emitting ultrasonic sound waves, and converts
the reflected sound into an electrical signal.

❏ Buzzer:- An electric signaling device that makes a buzzing sound.

❏ Jumper wire:- Jumper cables is a smaller and more bendable corrugated cable which is
used to connect antennas and other components to network cabling.

❏ Resistors:- A resistor is a passive two-terminal electrical component that implements


electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce
current flow, adjust signal levels, to divide voltages, bias active elements, and terminate
transmission lines.
❏ LED’s :- A light-emitting diode (LED) is a semiconductor light source that emits light
when current flows through it.

❏ Power supply cable:- A cable used for connecting the arduino borad to power source.

In addition to the above hardware requirements we will also need Arduino IDE for the coding.

3. Connections details :-
Connect the Red LED to pin D2, Yellow LED to D3 and the Green LED to D4 of the
Arduino by putting in a 220ohm resistor between the Arduino board and the LEDs. Now lets
connect the Buzzer to analogue pin A0. Next, connect the Trig pin of the Ultrasonic Sensor to D5
and the Echo pin to D6 of the Arduino. Once all the modules are connected to the Arduino board,
its time for us to connect all the positive and negative pins . Ground all the negative terminals.
4. Working Principle:- The system has three condition to work with which are as follows

A. Waiting for the car, In this condition the device keeps looking for a moving object
within the sensors proximity. If an object enters the proximity then one of the three LEDs turns
on based on how far the moving object is. If the object is way too close, then a noise is made to
make the moving object aware of the distance.

B. No car in the garage If there is no object in the proximity then turn off all the
LEDs.

C. The car has stopped moving (Parked in the right spot) If the object has stopped
moving and is still in the proximity wait for a few seconds and then turn off the LEDs.

5. Arduino Sketch Code:-

int trigPin = 5;

int echoPin = 6;

int redLED = 2;

int yellowLED = 3;

int greenLED = 4;

int buzzer = A0;

long TempDistance = 0;

int counter = 0; // Counter value to check if the object has stopped moving

void setup() {

Serial.begin(9600);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);
pinMode(redLED, OUTPUT);

pinMode(greenLED, OUTPUT);

pinMode(yellowLED, OUTPUT);

pinMode(buzzer, OUTPUT);

void loop() {

long duration, Distance;

digitalWrite(trigPin, LOW);

delay(200);

digitalWrite(trigPin, HIGH);

delay(500);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

Distance = (duration/2) / 74; // Distance in Inches

if(counter < 20){

if (Distance > 200)

{turnThemAllOff();}

// Turn on Green LED

if ((Distance > 55) && (Distance <= 200)) {

digitalWrite(greenLED, HIGH);

digitalWrite(yellowLED, LOW);
digitalWrite(redLED, LOW);

noTone(buzzer);

// Turn on Yellow LED

if ((Distance > 15) && (Distance <= 55)) {

digitalWrite(yellowLED, HIGH);

digitalWrite(redLED, LOW);

digitalWrite(greenLED,LOW);

noTone(buzzer);

// Turn on Red LED

if (Distance <= 15) {

digitalWrite(redLED, HIGH);

digitalWrite(greenLED,LOW);

digitalWrite(yellowLED, LOW);

noTone(buzzer);

if (Distance < 8) {

tone(buzzer, 500);

if ((Distance == TempDistance) || ((Distance+1) == TempDistance) || ((Distance-1) ==


TempDistance)){
if(counter >= 20){ // Turn off the lights if the object hasn't moved for 20 cycles (no change in
distance)

Serial.println("No movement detected, turning off the lights");

turnThemAllOff();

else

{counter++;}

else{counter = 0;}

TempDistance = Distance;

Serial.print(Distance);

Serial.println(" inches");

Serial.print("Counter : ");

Serial.println(counter); delay(500);

void turnThemAllOff(){

digitalWrite(redLED, LOW);

digitalWrite(greenLED,LOW);

digitalWrite(yellowLED, LOW);

noTone(buzzer);

You might also like