The
ESP32-C3 Based Parking Assistant is an advanced parking sensor system
that utilizes the ESP32-C3 super-mini micro-controller to provide
accurate distance measurements and parking assistance.
This is the third iteration of my previously released parking assistant videos.
This
parking assistant system uses ultrasonic sensors to help drivers park
their vehicles accurately by providing visual and audible feedback about
distance to the obstacles.
Sponsors
PCBWay
ships from china to most of the countries of the world within 3 to 7
business days. Talking about the quality, its absolutely mind-blowing.
Components Required
- [Buy Now] For this project I am using an ESP32-C3 Super Mini single core microcontroller which has a small formfactor and also includes Wi-Fi and Bluetooth (Arduino Uno or similar microcontroller).
- [Buy Now] A HC-SR04 Ultrasonic Sensors (3-4 units)
- [Buy Now] A 24 LED NeoPixel Ring
- [Buy Now] A TM1637 7-Segment display
- [Buy Now] A Buzzer
- [Buy Now] A 100 ohm Resistor
- [Buy Now] A mini AC-DC 5V Adapter
- And mounting hardware printed using a 3D printer
Circuit Diagram
The wiring setup is pretty straightforward:
- Connect the microcontroller's Pin 4 to the buzzer
- Connect Pin 3 to the NeoPixel ring
- Wire Pin 2 to the Trig pin and Pin 1 to the Echo pin of the ultrasonic sensor
- Connect Pin 8 to CLK and Pin 9 to DIO of the TM1637 7-segment display
- Finally, connect all the positive (+) terminals to the power rail and all negative (-) terminals to ground
Breadboard Testing
Board and Library
-------------------
For the project to function, we first need to install the "ESP32-C3" board from the board manager. Additionally, we need to install the "TM1637Display.h" and "Adafruit_NeoPixel.h" libraries via the library manager.
I began by testing each component individually with the ESP32-C3 board to verify their functionality. Once all modules were confirmed to be working, I connected all of them to the ESP32 board and uploaded the program to orchestrate their combined operation. All source codes for this project are available on my GitHub repository.
We'll begin the "Parking Assistant" code by importing all the required libraries. Then, in the variable declaration section, we will define all pin numbers and the initial sensor values, making them globally accessible.
In the setup() section, the code first establishes a Wi-Fi connection to my Raspberry Pi-based home server. This feature is optional and can be disabled simply by removing or commenting out the relevant code section.
Following the network initialization, all pin modes (INPUT/OUTPUT) are defined, and the necessary hardware modules are initialized.
The loop() section operates continuously, performing two primary tasks:
It reads the distance from the ultrasonic sensor and outputs the value to the 7-segment display.
It also controls the NeoPixel LED color and number based on the measured distance, providing a visual indication of the approaching vehicle.
The system detects when the vehicle is stationary by monitoring for a stable distance reading. Once parked, the NeoPixels enter a "rainbow" animation mode before both the 7-segment display and NeoPixels power down.
The Board
This is the 2D and 3D representation of my board. Initially, I designed it with just the circular PCB, but in the final iteration, I incorporated an additional PCB dedicated to the ultrasonic sensor.
If you'd like to get started with PCB design, I have a step-by-step guide in "Tutorial No. 45: Transformers PCB BADGE", the link is in the description below.
Soldering
Lets
starts by soldering the resistance to the board. Then lets solder the
ESP32-C3 microcontroller to the board. Since I care a lot about my ICs
and micro-controllers, I never solder them directly to the board. In
case of an ICs, I always try to use IC bases or if a base is not
available I use female pin-headers. (This avoids direct soldering and
allows for easy replacement).
Then, let solder the buzzer followed by
the AC-DC 5V Adapter to the board. Once thats done let solder the
7-Segment display to the board followed by the NeoPixel Ring. To
maintain the height I added few supports to keep the ring affloat.
The
220V power supply will be connected to these ports and the Ultrasonic
sensor will connect to these ports via a 1M long cable.
Note:
While a resistor isn't strictly required for WS2812 LEDs, it's often
recommended to include one on the data line, especially for longer
strips, to ensure reliable operation and protect the first LED from
voltage spikes. A resistor between 220 ohms and 1k ohm is typically
used.
3D Printing
I created the 3D model for this project using Microsoft 3D Builder. The top section is made up of four key components:
- Main Housing – The primary enclosure for the unit.
- Front Covers – Protective panels for the front section.
- Internal Holder – A custom piece to secure the unit inside the housing.
- Back Lid – The rear cover that completes the assembly.
For
the bottom section housing the ultrasonic sensor, I used a 3D model
originally created by dstark1 from Thingiverse, which I modified to fit
into my project.
The 3D printed cover acts as a light-diffusing cover
for the NeoPixel ring. Its semi-translucent material softens the bright
LEDs, preventing eye strain and protecting the components.
Once all the 3D models were sorted, I went ahead and printed them using my 3D printer.
Assembly
To complete the setup, assemble the 3D-printed enclosure and insert the electronics into it. Mount the ultrasonic sensor on the garage wall at bumper height for accurate detection, and install the LED strip where it is clearly visible to the driver. Calibrate the system by testing with objects at known distances and adjust the SAFE_DISTANCE, WARNING_DISTANCE, and DANGER_DISTANCE values in the code accordingly. Finally, fine-tune the buzzer’s frequency and duration for optimal alerts.
Demo
When the unit boots up, the LEDs flash in rainbow colors and then switch to displaying a color based on the proximity. The distance is also shown on the 7-segment display. If no movement is detected, the LEDs and the 7-segment display turn off.
Beyond standard proximity detection, this version also includes Wi-Fi/Bluetooth connectivity, allowing smartphone integration to monitor distance data via Google Charts.
Let me know what you think.
Feel free to like, share, and comment if you have any suggestions for improvement!
Key Features
Progressive visual feedback - LED color changes from green to red as distance decreases
Audible alerts - Beeping frequency increases as vehicle approaches obstacles
Weather-resistant - design for outdoor use
HC-SR04 Ultrasonic Sensor:
Maximum Range - 4 meters
Minimum Range - 2 cm
Thanks
Thanks again for checking my post. I hope it helps you.
If you want to support me subscribe to my YouTube Channel: https://www.youtube.com/@CrazyCoupleDIY
References
- Arduino based parking assistant V1: https://youtu.be/LQGhprwuHe0
- Arduino based parking assistant V2: https://youtu.be/MqJxUf3Cugg
- All About TM1637: https://youtu.be/Ob9mrq_Lj9k
- Transformers PCB BADGE: https://youtu.be/vlJoQAzjYDo
Support My Work
- BTC: 1Hrr83W2zu2hmDcmYqZMhgPQ71oLj5b7v5
- LTC: LPh69qxUqaHKYuFPJVJsNQjpBHWK7hZ9TZ
- DOGE: DEU2Wz3TK95119HMNZv2kpU7PkWbGNs9K3
- ETH: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4
- BAT: 0x9D9E77cA360b53cD89cc01dC37A5314C0113FFc3
- LBC: bZ8ANEJFsd2MNFfpoxBhtFNPboh7PmD7M2
- COS: bnb136ns6lfw4zs5hg4n85vdthaad7hq5m4gtkgf23 Memo: 572187879
- BNB: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4
- MATIC: 0xD64fb51C74E0206cB6702aB922C765c68B97dCD4
Thanks, ca again in my next tutorial.
Tags
----
WS2812,TM1637,4-DIGIT
7 SEGMENT LED DISPLAY,HCSR04,ESP32-C3.buzzer,adafruit,NeoPixel,NeoPixel
24 LED,ProtoPasta,Addressable LED Ring,24 Bit WS2812 RGB
LED,NeoPixel,Arduino,HC-SR04 Ultrasonic Sensors,ESP32 C3 Super
Mini,ESP32-C3,Mini AC-DC 5V Adapter,arduino accident detection,esp32
projects,arduino projects,accident detection,collision avoidance
system,cds,ods,diy cds,ParkingAssistant
No comments