D

DIY Electronics

— Building circuits, programming microcontrollers, and making things blink
49 members Created Jun 2026

Ethernet on an Arduino Mega with the W5500 module

My Open-Source Garage Parking Sensor

Built a parking guide that shows a colored LED bar indicating how far the car is from the wall. Hardware: ESP32, HC-SR04 ultrasonic sensor, and a 10-LED bar graph module.

The LED mapping: green LEDs illuminate from 200cm down to 60cm as you approach. At 60cm, yellow LEDs warn. Below 30cm, red LEDs flash. Below 15cm, all LEDs flash rapidly — stop immediately. The thresholds are stored in flash and configurable via a simple web interface hosted on the ESP32.

One reliability improvement: the HC-SR04 occasionally outputs erroneous readings (spikes to zero or maximum range). I apply a median filter over 5 consecutive readings and discard any reading that differs from the median by more than 10cm. This eliminates the occasional flash from a bad echo.

29

Report thread

Why are you reporting this thread?

Restore the redacted content?

This will make it visible to everyone again. The clear action is logged in the mod log.