This project leverages the powerful dual-core capabilities of the ESP32-S3 to integrate a 64x64 HUB75 LED Matrix, MQ-3 Alcohol Sensor, and RemoteXY Bluetooth Control. It creates an all-in-one smart vehicle safety device combining "Active Warning," "DUI Prevention," and "Remote Control."
The system is designed to solve the limitations of traditional warning triangles—such as short visibility distance due to passive reflection, the high risk of exiting the vehicle to place them, and single-functionality—effectively preventing secondary collisions.
The system was developed using a modular approach. Below are links to the individual modules and the final integrated version:
-
Final Integrated Version (Main Project)
-
ESP32-S3_Vehicle_Warning_System - The complete system containing all features.
-
Sub-modules (Testing)
-
ESP32-S3-MQ3-Alcohol-Sensor - Alcohol sensor ADC reading and calibration tests.
-
ESP32-S3-Chinese-Traditional-LED-Matrix - Traditional Chinese TTF font rendering and scrolling text tests.
-
ESP32-S3_RemoteXY_BLE_LED_Control - Bluetooth interface control and menu logic tests.
This project contains hardware schematics, software source code, and system resources. The directory structure is as follows:
.
├── Circuit_and_PCB/
│ ├── ESP32-S3_Vehicle_Warning_schematic.kicad_sch # KiCad Schematic Source File
│ └── ESP32-S3_Vehicle_Warning_schematic.png # Schematic Preview Image
├── data/
│ └── font.ttf # Pre-optimized Font File (Includes 4808 common Chinese chars)
├── src/
│ └── main.cpp # Main Source Code
├── module_2d_image.excalidraw # System Connection Diagram (Excalidraw source)
├── partitions_custom.csv # Custom Partition Table (Allocates 5MB Flash for fonts)
├── platformio.ini # PlatformIO Project Configuration File
└── README.md # Project Documentation
- Motivation & Background
- System Functionality
- Hardware Architecture
- Software Architecture
- Installation Guide
- Font Upload Guide (Crucial Step)
- Operation Manual
- Gallery & Demo
- Solving "Secondary Collisions": Traditional warning triangles rely on passive reflection, making them hard to see in rain, fog, or at night. Furthermore, they cannot convey specific information (e.g., Breakdown vs. Medical Emergency).
- Reducing Operational Risk: Drivers risk their lives walking into traffic to place traditional triangles.
- The Solution: A combination of Active LED Warning, Bluetooth Remote Control (stay inside the car), and Alcohol Detection.
The system is controlled via the RemoteXY App over Bluetooth, featuring an intuitive menu-driven interface.
(Above: RemoteXY Bluetooth interface showing Alcohol readings and Warning controls)
| Selector | Function | Details |
|---|---|---|
| 1. Alcohol Tester | Alcohol Detector | Supports mg/L and PPM units. When active, the Warning Light is forced OFF (Interlock). |
| 2. Triangle Light | Warning Triangle | Controls the external LED strip (ON/OFF). |
| 3. Buzzer Alarm | Audio Alarm | PWM linear volume control (0% ~ 100%). |
| 4. Matrix Brightness | Brightness | Adjusts LED Matrix brightness (0% ~ 100%). |
| 5. Preset Messages | Preset Warnings | Cycle through 9 modes: Accident, Breakdown, Temp Stop, Road Work, Fog Mode, SOS, etc. |
| 6. Custom Message | Custom Text | Type any Traditional Chinese/English text to scroll instantly. |
| 7. Text Color | Text Color | Switch between Rainbow, Red, Yellow, Green, Blue, White, etc. |
| 8. Text Speed | Scroll Speed | Adjust scrolling speed (Level 1 ~ 10). |
| 9. Text Size | Text Size | Dynamically adjust font size (8px ~ 60px). |
(Above: Complete circuit schematic including ESP32-S3, HUB75 interface)
- MCU: Espressif ESP32-S3-DevKitC-1U-N8R8
- Display: 64x64 RGB HUB75 LED Matrix (P3)
- Sensor: MQ-3 Alcohol Gas Sensor
- Power: 5V 2A Power Bank + Independent Filtering Circuit
| Module | Pin Name | ESP32-S3 GPIO | Note |
|---|---|---|---|
| HUB75 | R1/G1/B1/R2/G2/B2 | 4/5/6/7/15/16 | Data Lines |
| A/B/C/D/E | 1/2/42/41/40 | Row Select | |
| CLK/LAT/OE | 17/18/8 | Control | |
| Control | Shared Control | GPIO 2 | Interlock Control |
| Sensor | MQ-3 ADC | GPIO 1 | Analog Input |
| Audio | Buzzer | GPIO 42 | PWM Output |
- Memory Optimization: Uses
ps_callocto allocate graphics buffers in external PSRAM. - Smart Rendering: Uses
OpenFontRenderto handle Traditional Chinese fonts. - Anti-Jamming: Implements BLE Lazy Loading to prevent data congestion during sensor updates.
- File System: Uses LittleFS to store the font library.
- Install VS Code and the PlatformIO extension.
git clonethis repository.- Ensure drivers (CH343/CP210x) are installed on your computer.
[IMPORTANT] This is the most critical step!
The data/ folder in this project comes with a pre-built font.ttf. This file has been optimized and includes:
- Ministry of Education's 4808 Common Traditional Chinese Characters
- Common ASCII Characters
- Special Symbols (Degrees Celsius, Warning signs, Arrows, etc.)
You DO NOT need to generate the font yourself. You simply need to upload it to the ESP32's Flash memory.
- Connect the ESP32-S3 to your computer.
- Click the PlatformIO Icon (Alien head) in the VS Code sidebar.
- In the PROJECT TASKS panel, expand:
esp32-s3-devkitc-1Platform
- Click Upload Filesystem Image.
- PlatformIO will package the
datafolder and flash it to the board.
Once the terminal shows SUCCESS, restart the board. If the Serial Monitor shows Font Loaded, the system is ready.
- Startup: Default mode is Alcohol Tester. Screen displays "Warming Up".
- Warning Mode: Use the App to turn on the Triangle Light and select a Preset Message. The Alcohol Tester will power off automatically (Interlock).
- Customization: You can change the text content, color, and size on the fly via the App.
VID_20260105_074201_10sec_demo.mp4
full Demo video https://youtu.be/1AC4jYxGVUE?si=3yO8Ul78Wa-x0ozm
- Q: Screen is black/blank? -> A: Please verify that you have performed the Upload Filesystem Image step to load the font.
- Q:
Failed to mount LittleFSerror? -> A: Check ifpartitions_custom.csvis correctly configured inplatformio.ini. - Q: Bluetooth is laggy? -> A: This is normal when the LED Matrix is refreshing at high speeds. The system prioritizes display stability.
Created by Welton5532




