Lab 2
Lab 2
Laboratory Activity 2
Submitted by:
Miro G. Angeles
Deen Reiner B. Crusem
Julius Caezar R. Eugenio
BS CPE 4-1
Submitted to:
Prof. Aileen V. Rocillo
October 2024
Laboratory Activity 2
Arduino-Based Smart Parking Sensor with LED and Buzzer Alerts
OBJECTIVES
At the end of the experiment, the students should be able to:
1. Integrate an ultrasonic sensor with an Arduino to measure proximity.
2. Operate LEDs and a buzzer based on sensor data.
3. Develop a program for an automated parking assistance system.
4. Demonstrate the system's functionality by producing visual representation of smart
parking, incorporating sensors and Arduino components.
Introduction
With the goal of lowering human error and increasing parking operations' efficiency,
parking systems have emerged as an essential part of contemporary infrastructure.
Intelligent technologies that give drivers real-time guidance are being developed as a result
of the growing need for smart parking space management solutions brought on by
urbanization. The time spent looking for a parking place is decreased, traffic congestion and
emissions are reduced, and space use is optimized with the aid of these smart parking
systems. In order to give the driver real-time feedback, this concept uses an ultrasonic
sensor to determine the distance between a car and a wall. LEDs offer visual cues for the
car’s proximity, while a buzzer serves as an auditory alert when the vehicle is too close,
ensuring improved safety and convenience during parking (Jemmali et al., 2022).
The importance of smart parking systems in cities is highlighted by Abrar Fahim et al.
(2021), who point out that sensor-based technology is now essential for automating parking
procedures and enhancing user experience in general. Similarly, a 2019 study by Idris et al.
examines the development of smart parking systems, emphasizing how sensors and real-
time data processing might improve parking effectiveness. The system created for this
project is based on these technological developments, which enable precise and ongoing
monitoring of parking areas. The technology facilitates safer, more effective parking by
providing drivers with real-time visual and audio feedback. This is in line with the larger
objective of lowering human error and enhancing parking operations.
Feedback control systems are used by the smart parking system to improve
responsiveness and performance. In this configuration, the system generates feedback in
the form of visual (LED) and audio (buzzer) messages, while the sensor supplies input data
(distance measurements). This setup is an example of a closed-loop control system, in
which inputs are received in real time and the system continuously modifies its outputs.
According to Haidekker (2020), feedback control systems are essential for automated
applications because they enable accurate performance improvements and changes. By
ensuring that the driver is aware of their closeness to impediments, this feedback
mechanism allows them to take appropriate remedial action. Additionally, the smart parking
system employs optical threshold logic to determine the appropriate response based on
distance measurements. This logic involves comparing sensor readings against predefined
distance thresholds to activate specific outputs. For instance, different distance ranges
correspond to distinct LED colors and buzzer signals, guiding the driver as they park. Optical
threshold logic is essential for making quick decisions based on sensor data, ensuring
efficient operation of the system. As Sarkar et al. (2021) discuss, such logic is vital for real-
time applications where immediate feedback is required to maintain safety and operational
efficiency.
The circuit setup involves connecting an ultrasonic sensor to the Arduino to measure
distances, along with three LEDs (green, yellow, and red) and a buzzer to provide visual and
audio alerts based on proximity.
Procedure
The table below provides a summary of the pin assignments for the various components
connected to the Arduino Uno board:
d.
Code
The outcomes of the Arduino-Based Smart Parking Sensor with LED and Buzzer
Alerts successfully aligned with our desired project's objective. The ultrasonic sensor
accurately measured distances within the specified ranges. When the distance exceeded 12
cm, the serial monitor displayed "out of reach." For distances ranging from 6 cm to 12 cm,
the green LED illuminated, accompanied by a sequence of rapid beats from the buzzer,
indicating a safe condition. In the range of 4 cm to 6 cm, the yellow LED activated, with the
buzzer producing a single beat per second to signal caution. When the measured distance
was 3 cm or less, the red LED turned on, and the buzzer emitted a continuous long sound,
signifying a dangerous condition. Although occasional misreadings were observed, likely due
to the ultrasonic sensor's previous use in multiple projects, the feedback mechanism
effectively communicated safe, caution, and danger zones, aligning well with the system's
intended design.
The results from testing the Arduino-Based Smart Parking System demonstrated that
the ultrasonic sensor was able to measure proximity accurately, and the system effectively
signaled different distance thresholds using LEDs and buzzer alerts. The division of distance
ranges into safe (6-12 cm), caution (4-6 cm), and danger (0-3 cm) provided a clear and
functional response mechanism for each scenario. However, during the testing phase, a few
challenges and areas for improvement were identified.
Proposed Improvements:
1. Incorporating a Button to Silence the Red Alarm: One practical improvement would
be the addition of a manual override button to silence the red alarm (buzzer) when a
danger zone is detected. This would prevent continuous noise in cases where the
user is already aware of the issue, providing a more user-friendly experience without
compromising safety.
Conclusion
In conclusion, the project objectives were achieved successfully. The integration of
an ultrasonic sensor with the Arduino was accomplished, allowing the system to measure
proximity with precision. The sensor effectively captured real-time distance data, which was
used to control both LEDs and a buzzer, offering clear visual and auditory feedback at
specific distance thresholds. This functionality allowed the system to indicate safe, caution,
and danger zones, fulfilling the primary requirement of the smart parking assistance system.
Moreover, a custom program was developed to automate the process, ensuring that
the appropriate LED indicators and buzzer alerts were triggered according to the proximity
data. This automation not only improved the system's reliability but also minimized the need
for manual intervention, streamlining the parking assistance process.
Lastly, the overall functionality of the system was successfully demonstrated through
a visual representation of a working smart parking system. The combination of sensors,
Arduino components, and programming illustrated how these technologies can be integrated
into a practical, real-world application. The project serves as a strong example of how
automation and sensor technology can work together to enhance parking systems, providing
an efficient and reliable solution for monitoring vehicle proximity in confined spaces.
References
Idris, M. I., Leng, Y. Y., Tamil, E. M., Noor, N. M., & Razak, Z. (2019). Car park system: A
review of smart parking system and its technology. Information technology journal,
8(2), 101-113.
Abrar Fahim, Mehedi Hasan, Muhtasim Alam Chowdhury, Smart parking systems:
comprehensive review based on various aspects, Heliyon, Volume 7, Issue 5, 2021,
E07050, ISSN 2405-8440, https://doi.org/10.1016/j.heliyon.2021.e07050.
Jemmali, M., Melhim, L.K.B., Alharbi, M.T. et al. Smart-parking management algorithms in
smart city. Sci Rep 12, 6533 (2022). https://doi.org/10.1038/s41598-022-10076-4
Sarkar3, M., Chakraborty1, R., Taki1, G. S., Chakraborty2, A. K., & https://orcid.org/0000-
0002-7717-9294, M. S. (2021, July 26). Design of basic logic gates using optical
threshold logic. Engineering Research Express.
https://iopscience.iop.org/article/10.1088/2631-8695/ac1903
Ramos, S. (n.d.). Exploring piezo buzzer integration with Arduino: A comprehensive guide .
Arduino Intro. https://arduinointro.com/articles/projects/exploring-piezo-buzzer-
integration-with-arduino-a-comprehensive-guide
Latha, N. A., Murthy, B. R., & Kumar, K. B. (2016). Distance sensing with ultrasonic sensor
and Arduino. International Journal of Advance Research, Ideas and Innovations in
Technology, 2(5), 1-5.
Appendices
Fig 6. Members working on coding and testing the smart parking system.
Table 2. HC-SR04 Ultrasonic Sensor Datasheet
Parameters Details/Value
Model HC-SR04
Type Ultrasonic Ranging Module
Application Distance measurement, object detection
Operating Voltage 3.3Vdc ~ 5Vdc
Quiescent Current <2mA
Operating Current 15mA
Operating Frequency 40KHz
Operating Range & Accuracy 2cm ~ 400cm (1in ~ 13ft) ±3mm
Sensitivity -65dB min
Sound Pressure 112dB
Effective Angle 15°
Connector 4-pins header with 2.54mm pitch
Dimensions 45mm x 20mm x 15mm
Weight 9g
Operating Temperature -15°C to 70°C
Storage Temperature -20°C to 80°C