ESP32 parking sensor: HC-SR04, three LEDs and a beeper
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.
| Resistor | 6 |
|---|---|
| LED | 3 |
| ESP32 DevKit | 1 |
| USB charger / port | 1 |
| Ultrasonic distance sensor | 1 |
| NPN transistor | 1 |
| Active buzzer | 1 |
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.