Project Report wsn1
Project Report wsn1
Project Report wsn1
ON
“ULTRASONIC CAR SENSOR”
SCHOOL 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.
3
INDEX
1. Abstract 5
2. Introduction 6
3. Required Components 6
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.
6
III. Collision Avoidance System Using Arduino Uno
Fig 1.4
7
Step 1 : Components Required
5 More Images
Fig 1.5
4.Three LEDs(RED,YELLOW,GREEN)
5.Three Resistors(1k)
6.DC Motor
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!
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
DC Motor
Connect one terminal to pin-6 on Arduino and another one to GND of Arduino.
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);
distance= duration*0.034/2;
digitalWrite(6, HIGH);
else
11
if (distance >= 100)
digitalWrite(13, HIGH);
else
digitalWrite(13,LOW);
digitalWrite(12, HIGH);
delay(400);
else
digitalWrite(12, LOW);
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.
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.
14
IV. Applications of the Car Parking Sensor
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.
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.
ResearchGate
ResearchGate
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.
Walkthrough for connecting and programming an ultrasonic sensor with the 8051
microcontroller, useful for beginners.
18