A complete Advanced Driver‑Assistance System (ADAS) embedded solution, combining microcontroller firmware, Linux‑based AI processing, over‑the‑air updates, and a unified KivyMD GUI dashboard. Developed at Alexandria University’s Faculty of Engineering, Electronics and Communication Department.
The core idea of this graduation project is to develop a modular, low‑cost ADAS platform that integrates into standard vehicles. The system comprises:
-
AI‑Powered Vision for lane keeping and traffic‑sign recognition on Raspberry Pi 4.
-
Driver Drowsiness Simulation using OpenCV & dlib to emulate in‑cabin monitoring.
-
Embedded Microcontrollers (STM32F103C6) running FreeRTOS for real-time control:
- Collision Avoidance
- Blind‑Spot Detection
- Auto Parking
-
Wireless Bridges using ESP32s for data relaying between modules.
-
GUI Dashboard built with KivyMD on Raspberry Pi 3 for visual feedback.
-
Firmware‑Over‑the‑Air (FOTA) update system hosted locally in the car.
[Camera]
|
| USB
v
[Raspberry Pi 4] ── Wi‑Fi MQTT ──► [Raspberry Pi 3 (GUI)]
│
│ SPI → ESP32‑ALERT ── Wi‑Fi MQTT ──► [Raspberry Pi 3 (GUI)]
│
[ESP32‑CTL] ← UART → STM32F103C6 ← SPI → ESP32‑ALERT
│
[Raspberry Pi 3 (FOTA)] ← UART → STM32F103C6
-
Camera → Raspberry Pi 4
- USB camera streams video for AI vision (lane/sign) on Pi 4.
-
Raspberry Pi 4 → MQTT → Raspberry Pi 3 (GUI)
- AI inference alerts (lane, sign, drowsiness) are published directly over Wi‑Fi MQTT.
-
ESP32‑CTL ↔ STM32 (UART)
- UART at 115200 baud relays mobile‑app control commands to STM32.
-
ESP32‑ALERT ↔ STM32 (SPI)
- SPI bus gathers collision/blind‑spot data from STM32.
- Publishes sensor alerts via Wi‑Fi MQTT to the GUI Pi 3.
-
Sensors on STM32
- 2 × HC‑SR04 ultrasonic sensors (front & rear)
- 2 × digital IR sensors for side blind‑spot detection
-
Power & Level‑Shifting
- 10 V → 5 V regulator for all boards.
- Common ground; level‑shifters ensure safe 3.3 V SPI/UART signalling.
-
Raspberry Pi 3 (FOTA)
- Hosts Python HTTP server for uploading STM32
.binfiles from a laptop. - Uses UART to flash new firmware onto STM32.
- Hosts Python HTTP server for uploading STM32
-
Raspberry Pi 3 (GUI)
- Runs KivyMD dashboard on a 7″ display.
- Subscribes to MQTT to show real‑time sensor and vision warnings.
-
Sensor Layout:
- 4× Ultrasonic sensors for obstacle detection
- 2× IR proximity sensors for rear corner blind‑spot detection
┌─────────────────────────────────────────────────────────┐
│ Raspberry Pi 4 │
│ ┌──────────┐ ┌────────────────────────────────────┐ │
│ │ Yocto │ → │ AI_Features (Docker) │ │
│ │ Linux │ │ (lane, sign inference) │ │
│ └──────────┘ └────────────────────────────────────┘ │
│ │ Wi‑Fi MQTT → Raspberry Pi 3 (GUI) │
│ │ ▲ │
│ │ SPI → ESP32‑ALERT ── Wi‑Fi MQTT ── ─ ─ ─ ─┘ │
└─────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────┐
│ STM32F103C6 Node │
│ ┌──────────────┐ ┌─────────────────────────────────┐ │
│ │ Sensors │ │ FreeRTOS tasks: collision, │ │
│ │ HC‑SR04 & IR │→ │ blind‑spot, autoparking logic │ │
│ └──────────────┘ └─────────────────────────────────┘ │
│ ↑ UART → ESP32‑CTL │
└─────────────────────────────────────────────────────────┘
↓
┌────────────────────────┐
│ Raspberry Pi 3 (GUI) │
│ — KivyMD MQTT client │
│ — 7″ inch screen │
└────────────────────────┘
↓
┌──────────────────────────┐
│ Raspberry Pi 3 (FOTA) │
│ — Python HTTP server │
│ — UART to STM32 flashing │
└──────────────────────────┘
Real-time obstacle detection using front and rear ultrasonic sensors. Alerts are sent to the GUI if a collision risk is detected.
IR sensors monitor the vehicle’s rear corners to detect nearby obstacles in adjacent lanes.
Computer vision–based eye tracking detects signs of driver fatigue. If detected, an auto-parking request is triggered.
The system includes an automatic parking feature that is activated when the drowsiness detection system flags the driver as inattentive. Key aspects:
-
Trigger Mechanism: Initiated by an EXTI command from the embedded Linux module upon drowsiness detection.
-
Task Coordination: FreeRTOS suspends unrelated tasks (e.g., blind spot & collision detection), then activates:
AutoParkingHandlerParkCar
-
Operation:
- Searches for a valid parking space using side-mounted ultrasonic sensors.
- Executes a reverse-parking maneuver using a sequence of directional motor commands.
- STM32F103C6 (FreeRTOS-based real-time node)
- Raspberry Pi 3 & 4 (Yocto Linux, Python GUI, Web Server)
- ESP32 (SPI/UART bridge, Wi-Fi MQTT client)
- KivyMD (Python GUI)
- OpenCV + dlib (Drowsiness Detection)
- Docker (for AI Modles deployment)
- Yocto (Linux Image Customization)
- MQTT (HiveMQ) (Pub/Sub communication layer)
- STM32CubeMX + STM32CubeIDE for STM32 firmware
- Python 3.x with KivyMD for GUI
- Docker for Models Deployment
- Yocto for Linux Customization
- QT Creator for Dashboard Development
- ESP-IDF or Arduino for ESP32 firmware