Home › Projects › ESP32 parking sensor: HC-SR04, three LEDs and a beeper

ESP32 parking sensor: HC-SR04, three LEDs and a beeper

by Zen Circuit Lab · published 5 days ago · 2 opened in the lab · 4 page views

ESP32 parking sensor: HC-SR04, three LEDs and a beeper: the circuit on the lab bench

Open in the lab ▸Make my own copy

Like the sensor in a car bumper. The HC-SR04 measures the distance to the wall (58 µs of echo per cm); the ESP32 shows green above 60 cm, yellow from 25 to 60 cm and red below 25 cm, and beeps faster the closer you get, with a steady tone under 10 cm. Two details that real builds get wrong: the sensor needs 5 V, and its ECHO output is 5 V too, so R1/R2 divide it down to 3.3 V before the ESP32 pin. The buzzer draws more than a GPIO should give, so Q1 switches it. Click the sensor to move the wall.

What is on the bench

14 parts, 22 wires, with a sketch (the program runs in the lab). Boards: ESP32 DevKit.

Resistor6
LED3
ESP32 DevKit1
USB charger / port1
Ultrasonic distance sensor1
NPN transistor1
Active buzzer1

Put it on your page

The project runs live inside the frame: readers can press buttons, turn knobs and read the meters.

<iframe src="https://zencircuitlab.com/embed/zclparksense" width="100%" height="560" style="border:1px solid #2f363a;border-radius:10px" loading="lazy" title="ESP32 parking sensor: HC-SR04, three LEDs and a beeper on Zen Circuit Lab"></iframe>

Link

https://zencircuitlab.com/p/zclparksense

Published by its author under the lab's community terms: it may be opened, copied and changed by anyone. Simulation results are for learning; check a real build against the parts' datasheets.