0% found this document useful (0 votes)
9 views18 pages

Project Report wsn1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

PROJECT REPORT

ON
“ULTRASONIC CAR SENSOR”

Submitted in Partial Fulfillment of the Requirement


for the award of Degree of
Bachelor of Technology
In
Computer Science & Technology
Submitted By

SHIVANGI SHARMA (2K21CSUN026)


PRIYAL MITTAL (2K21CSUN03011)
JAGAT SINGH (2K21CSUN04013)
ABHISHEK TEWATIA (2K21CSUN04040)

Under the Guidance of


Dr. Ashish Sachdeva

SCHOOL OF ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE &TECHNOLOGY

MANAV RACHNA UNIVERSITY


FARIDABAD, HARYANA (INDIA)

(Formerly Manav Rachna College of Engineering)

<MONTH NOVEMBER>
< YEAR2024>

1
ACKNOWLEDEGEMENT

I would like to express my sincere gratitude to all those who provided guidance and support
throughout the development of this ultrasonic car sensor project. First, I would like to thank
my project supervisor, Dr Ashish Sachdeva, for their valuable insights, encouragement, and
expert advice, which were essential in understanding the complexities of microcontroller-
based embedded systems. Their mentorship has been invaluable in navigating the challenges
encountered during this project.

I am also grateful to department of computer science and engineer , for providing the
necessary resources and a supportive environment that enabled me to conduct this project
successfully. Special thanks to the lab assistants and staff for their assistance with equipment
and technical support.

Lastly, I would like to thank my family and friends for their encouragement, patience, and
support during this project. Their understanding and motivation were instrumental in the
successful completion of this work. This project has been a rewarding experience, and I am
truly appreciative of everyone who contributed to it in one way or another.

Priyal Mittal
Shivangi Sharma
Jagat Singh
Abhishek Tewatia

2
CANDIDATE’S DECLARATION

I/We hereby declare that work presented in this project report entitled “Ultrasonic car
sensor”, is an authentic record of our own work carried out at Manav Rachna University.

Supervisor Name: Student Name: Priyal Mittal


Shivangi Sharma
Jagat Singh
Abhishek Tewatia
Signature: Signature:
Date:

3
INDEX

S.no TOPIC Page No. Signature

1. Abstract 5

2. Introduction 6

3. Required Components 6

3. Collision Avoidance System Using 7-15


Arduino Uno

4. Conclusion 17

5. References 18-19

4
Abstract
The ultrasonic car sensor system is designed as an embedded safety application that assists
drivers in avoiding obstacles during parking or low-speed maneuvers. This system employs
an 8051 microcontroller and ultrasonic sensors to detect objects in the vehicle’s path,
calculate their distance, and alert the driver when they are within a potentially dangerous
proximity. The project focuses on leveraging the 8051 microcontroller’s I/O capabilities and
precise timing functions to drive an ultrasonic transceiver module that measures the distance
to nearby objects by calculating the time delay between the emission and reflection of sound
waves.

In operation, the ultrasonic sensor emits high-frequency sound pulses, which, upon striking
an obstacle, reflect back to the sensor. The 8051 microcontroller accurately measures this
echo time and uses it to compute the distance. The system then compares this distance to a
pre-set safety threshold. If an object is detected within the threshold, the microcontroller
triggers visual or auditory alerts, such as activating an LED or buzzer, to warn the driver. The
system may also include an LCD display that provides real-time distance readings, enabling
the driver to monitor proximity at a glance.

This project aims to enhance driver safety and reduce the likelihood of collisions, particularly
in situations where the driver’s field of view is limited. Additionally, this solution offers an
accessible, low-cost approach to automotive safety, suitable for integration in educational
demonstrations, small-scale vehicles, or prototype testing environments. It showcases the
applications of ultrasonic sensors in real-time systems and demonstrates core concepts in
embedded system design, such as signal processing, sensor integration, and microcontroller
programming. Through this project, users gain practical experience in building
microcontroller-based systems for safety-critical applications, with potential extensions for
multi-sensor systems that could offer 360-degree obstacle detection.

5
I. INTRODUCTION

With the increase in urbanization, the demand for safe and precise parking systems is greater
than ever. Parking a vehicle in tight spaces poses challenges, and minor collisions while
parking are common. These accidents, while usually low-impact, lead to unnecessary repair
costs, inconvenience, and can even pose safety risks. The ultrasonic car sensor system aims to
address these challenges by providing a reliable, real-time obstacle detection mechanism.

Ultrasonic sensors are well-suited for proximity detection in automotive applications due to
their high accuracy and cost-efficiency. This project leverages an 8051 microcontroller to
control ultrasonic sensors, process distance measurements, and alert the driver when an
obstacle is detected within a predefined threshold. The use of an 8051 microcontroller makes
the system scalable and modular for further enhancement, such as multi-sensor integration for
full 360-degree detection.

The system not only serves as a low-cost alternative to commercially available parking
sensors but also provides a valuable learning opportunity in understanding microcontroller-
based embedded systems, sensor interfacing, and real-time signal processing.

II. REQUIRED COMPONENTS


A list of key components includes:

 8051 Microcontroller: Manages timing, I/O control, and processing.


 HC-SR04 Ultrasonic Sensor: Emits ultrasonic pulses and detects reflections to
determine distance.
 Buzzer/LED Indicator: Alerts the driver of close obstacles.
 LCD Display (Optional): Shows real-time distance readings for precise feedback.

6
III. Collision Avoidance System Using Arduino Uno

Fig 1.4

This is a simple Arduino based Collision Avoidance System. It is also known as


Forward Collision Warning System. Basically ,it is an advanced driver-
assistance system designed to prevent or reduce the severity of a collision. It
will continuously monitors the distance between the vehicles/objects in front of
it , so that it can provide warning to the driver if the vehicles get too close.

7
Step 1 : Components Required

5 More Images
Fig 1.5

1.Controllers : Arduino UNO

2.Sensor : HCSR04 Ultrasonic sensor

3.Piezo Buzzer : For providing sound

4.Three LEDs(RED,YELLOW,GREEN)

5.Three Resistors(1k)

6.DC Motor

7.Few jumper wires for connection

8.Breadboard

8
Step 2 : Circuit Design and Connections

Fig 1.6

Fig 1.7

9
Now it's time to connect all the components to Arduino through wires!

Ultrasonic sensor(HCSR04) to Arduino Uno

 VCC pin of Ultrasonic sensor is connected to 5V power supply of Arduino.


 GND pin of Ultrasonic sensor is connected to GND pin of Arduino.
 TRIG pin of Ultrasonic sensor is connected to 7th pin of Arduino.
 ECHO pin of Ultrasonic sensor is connected to 4th pin of Arduino.

LED connections : It has two pins Anode(longer leg) and Cathode(shorter leg).

 Green LED : Connect anode to resistor and then to 13th pin of Arduino. Connect cathode to GND of
Arduino.

 Yellow LED : Connect anode to resistor and then to 12th pin of Arduino. Connect cathode to GND of
Arduino.
 Red LED : Connect anode to resistor and then to 2nd pin of Arduino. Connect cathode to GND of
Arduino.

Buzzer

 Positive terminal of buzzer is connected to pin-10 on Arduino.


 Negative terminal is to GND of Arduino.

DC Motor

 It has two terminals.

Connect one terminal to pin-6 on Arduino and another one to GND of Arduino.

Step 3 : Arduino Sketch


const int trigPin = 7;

const int echoPin = 4;

int buzz = 10;

long duration;

int distance;

10
void setup()

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(2, OUTPUT);

pinMode(6, OUTPUT);

Serial.begin(9600);

void loop()

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

if (distance >= 20)

digitalWrite(6, HIGH);

else

digitalWrite (6, LOW);

11
if (distance >= 100)

digitalWrite(13, HIGH);

else

digitalWrite(13,LOW);

if(distance < 100 && distance >= 50)

digitalWrite(12, HIGH);

delay(400);

digitalWrite(12, LOW); delay(400);

else

digitalWrite(12, LOW);

if(distance < 50 && distance >= 20)

digitalWrite(2, HIGH);

delay(600);

digitalWrite(2, LOW);

delay(600);

digitalWrite(buzz, HIGH);

tone(buzz, 2000);

delay(400);

12
noTone(buzz);

delay(100);

tone(buzz, 2000);

delay(400);

noTone(buzz);

delay(50);

tone(buzz, 2000);

delay(400);

noTone(buzz);

delay(50);

tone(buzz, 2000);

delay(400);

noTone(buzz);

delay(50); }

else

digitalWrite(2, LOW);

This is the code we used to program our Arduino Uno. You can change the pin
connection(Input/Output) if you want. But you have to change the pin number and connection
in your code according to the changes that you've made. Otherwise just copy and paste this
code in Arduino IDE.

13
Step 4 : Working of the Circuit
We already discussed about the circuit connection and required code for our project. Make
those necessary circuit connection and upload the given code to the Arduino using Arduino
IDE. Now let's see about the working of our circuit.

It has four different zones.

Zone 1 : No Warning(Safe zone)

Zone 2 : Visual Warning

Zone 3 : Visual and Audible Warning(Need to pay attention)

Zone 4 : Auxiliary brake

Zone 1 :

When the distance between the object in front of the Ultrasonic sensor is greater than 100cm
then no warning will be provided. Only green colour LED will glow and motor will run,
indicating that object is at a safe distance.

Zone 2 :

If the distance between the object in front of the sensor is between 100-50cm ,then yellow
colour LED will start blinking. This indicates that "Object is approaching". Motor will
continue to run.

Zone 3 :

If the distance get reduced between 50-20cm ,then red colour LED will start blinking. In
addition to that a beep sound is also provided by the buzzer. Driver needs to respond in this
situation. In spite of the warning, the motor will continue to run.

Zone 4 :

This is the last zone. Here, if the distance between the object is even get reduced to less than
20cm ,then the motor will automatically stop functioning.

Step 5 : Test the Setup


This is the hardware working of this project. I haven't added the motor . If you want you can
add the motors also. I have already provided the connections and code for motor in step 2 &
3.

14
IV. Applications of the Car Parking Sensor

 Reverse Parking Assistant


Imagine you're in a crowded parking lot, and you need to reverse park. This sensor
can be a game-changer. By mounting the ultrasonic sensor on the back bumper, you
can get real-time audio feedback on the distance to any obstacles behind you. This
way, as you reverse, the system emits sound signals that increase in frequency the
closer you get to an object, helping you park without risking scratches or bumps. For
added accuracy, you could even use multiple sensors positioned on the sides and back
of the vehicle, offering a full perspective on nearby objects when reversing.
 Home Garage Parking System
For those who have tight garage spaces, a wall-mounted sensor can be a lifesaver.
Mount the sensor on the back wall where you park, so it activates when the car
approaches. As you pull in, the sensor detects how close the car is getting to the wall
or any items stored in the garage. A loud buzzer, mounted on the garage wall, will
warn you to stop at the perfect parking distance. You could even integrate colored
LEDs (e.g., green for safe, yellow for caution, red for stop) that light up sequentially
as you get closer, providing a clear, visual parking guide.
 Trailer Parking Aid
Parking with a trailer attached is notoriously challenging due to blind spots and the
extra length. Mounting a sensor on the back of the trailer can provide feedback that’s
relayed to the driver’s cabin. You could use a wireless RF or Bluetooth module to
transmit the distance data from the trailer sensor to an LED display or speaker in the
car, which lets you know when you’re nearing an obstacle. With this setup, the trailer
practically becomes an extension of the vehicle’s own senses, making backing up a
trailer much less stressful.
 Bicycle and Motorcycle Parking
This system isn’t just for cars! In a tight storage area or a packed garage, parking a
bike or motorcycle can benefit from similar distance guidance. The sensor can be
mounted near the front wheel or the handlebar area to detect obstacles. Instead of a
loud buzzer, you might opt for a gentle chime or a small LED light that changes color,
so as not to disrupt the household or disturb neighbors.
 Warehouse or Factory Application
Imagine a busy warehouse with forklifts moving in and out. Adding this system to
forklifts or even installing it near narrow passageways can improve safety by helping
operators know how close they are to objects. You could also mount the sensor on
walls or shelving units in tight warehouse areas to guide forklifts as they maneuver.
With a louder buzzer and perhaps a flashing LED, operators get clear alerts when
they’re approaching hazardous objects.
 Smartphone Integration
For an advanced setup, you could integrate Bluetooth to send sensor data to a
smartphone app. This way, instead of relying only on sound alerts, the driver can look
at their phone to get a visual indicator of how close they are to an obstacle. Imagine a
display showing colored zones (green, yellow, red) or even the exact distance in
centimeters or inches. This could be especially useful for car owners who like tech-
savvy solutions.

15
V. CONCLUSION
The ultrasonic car sensor system developed in this project demonstrates an effective, low-cost
solution for enhancing vehicle safety during parking and low-speed maneuvers. Using the
8051 microcontroller and the HC-SR04 ultrasonic sensor, the system reliably detects
obstacles within close range and alerts the driver through clear visual and audio signals. This
setup not only prevents minor collisions but also reduces stress and guesswork for drivers in
tight parking spaces.

The system showcases the practical application of microcontrollers in real-time distance


measurement and sensor integration, making it suitable for small-scale automotive
applications, educational purposes, and prototyping. Furthermore, it opens up possibilities for
further enhancements, such as multi-sensor arrays for 360-degree coverage and temperature
sensors for more accurate distance calculations. Overall, this project highlights how
embedded systems can make meaningful contributions to everyday safety, offering a valuable
learning experience in electronics, programming, and system design.

16
VI. References
1. "The 8051 Microcontroller and Embedded Systems: Using Assembly and C" - by
Muhammad Ali Mazidi, Janice Gillispie Mazidi, and Rolin D. McKinlay
o Covers programming of the 8051 microcontroller, which can be useful for handling
sensor input in parking systems.
2. "Embedded Systems: Introduction to ARM Cortex-M Microcontrollers" - by
Jonathan W. Valvano
o Introduces ARM Cortex microcontrollers, which offer a more powerful platform if
you want to scale up from 8051-based systems.
3. "Ultrasonic Transducers: Materials and Design for Sensors, Actuators and
Medical Applications" - Edited by K Nakamura
o Discusses the design and properties of ultrasonic transducers, critical for
understanding how they function in a parking sensor context.

4. "Automobile Parking Assistant System Using Ultrasonic Sensor"


o Provides insights into the application of ultrasonic sensors in vehicle parking
assistance, including common issues and best practices for sensor calibration.
5. "Ultrasonic Sensor Applications in Parking Assistance Systems"
o Explores various ultrasonic sensor setups and placement strategies to optimize
obstacle detection in parking systems.
6. "Development of Microcontroller-Based Ultrasonic Distance Measurement
Systems"
o Describes the process of setting up microcontroller-based distance measurement with
ultrasonic sensors, including programming and accuracy considerations.
7. "Research and Implementation of Auto Parking System Based on Ultrasonic
Sensors" (IEEE)
o Examines challenges and solutions in implementing auto-parking systems using
ultrasonic sensors, covering sensor precision, calibration, and real-time response.
8. "Arduino Uno-Powered Parking Guidance System with Ultrasonic Sensors"
(IEEE)
o Focuses on hardware design and programming for a parking guidance system based
on the Arduino Uno microcontroller and ultrasonic sensors.
9. "Car Parking Distance Controller Using Ultrasonic Sensors Based on Arduino
Uno" - Journal of Robotics and Control (JRC)
o Presents a project using ultrasonic sensors and an Arduino Uno to measure safe
parking distances, highlighting testing techniques for different distance scenarios

ResearchGate

10. Professional Trends in Industrial and Systems Engineering (PTISE)


o Details an intelligent parking system that leverages multiple ultrasonic sensors and an
Arduino controller to detect parking spaces and assist with autonomous parking
maneuvers

ResearchGate

11. 8051 Microcontroller Tutorial on TutorialsPoint


Link

 Provides foundational knowledge of the 8051 microcontroller, which can be adapted for
managing ultrasonic sensor data.

17
12. Basics of Ultrasonic Sensors on Digi-Key
Link

 Offers a comprehensive overview of ultrasonic sensors, including how they work and typical
applications, relevant for understanding sensor behavior in parking systems.

13. Interfacing Ultrasonic Sensor with 8051 Microcontroller on Circuit Digest


Link

 Walkthrough for connecting and programming an ultrasonic sensor with the 8051
microcontroller, useful for beginners.

14. Collision Avoidance System Using Arduino Uno


By Sarik Naveeth S

18

You might also like