Skip to content

basant20415/Graduation_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

41 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ADVANCED ROAD SAFETY SYSTEM BASED ON V2V AND V2C

This repository contains all the necessary knowledge to build our graduation project on Embedded Linux. The project is organized into three main folders: vehicle to vehicle communication, vehicle to cloud communication, and openstreetmap.

Software Development Life Cycle (SDLC)

๐Ÿ” 1. Requirements Analysis

Goal: Detect road damages and send alerts to nearby cars, the cloud (government), and visualize on a map.

Stakeholders: Smart car users, non-smart car users ,government agencies.

โœ… Functional Requirements:

  • Detect potholes, cracks, faded road markings, and other road objects using YOLOv12.

  • Send alerts to:

    • Other vehicles (V2V via ESP-NOW).

    • AWS Cloud (V2C via MQTT over AWS IoT Core Broker).

    • Visualization interface (OpenStreetMap + Flask).

๐Ÿ›ก๏ธ Non-functional Requirements:

  • Real-time performance.

  • Secure transmission (TLS, certificates).

  • Low latency for alerts.

2. ๐Ÿง  System Design

๐Ÿ—๏ธ Architecture:

Modular design with subsystems:

  • AI Subsystem (YOLO).

  • V2V Communication (ESP32 to other ESP32 via ESP-NOW).

  • V2C Communication (Raspberry Pi to AWS IoT Core via MQTT).

  • OpenStreetMap (flask + MongoDB).

๐Ÿ› ๏ธ Technology Stack:

  • Raspberry Pi (Python/C++).

  • ESP32 (C/C++).

  • AWS IoT Core (MQTT).

  • MongoDB Atlas (Cloud DB).

  • Flask + Leaflet.js for the map UI.

๐Ÿ”„ Data Flow:

  • The camera detects damage โ†’ YOLO confirms โ†’ GPS adds the location.

  • Alert sent to:

    1- Other vehicles (via ESP-NOW).

    2- AWS (via MQTT).

    3- Database (MongoDB).

  • Map updated via Flask API.

3. ๐Ÿ’ป Implementation

๐Ÿ’ฌ Programming Languages:

  • C++ (main app + MQTT + raspberrypi to esp32 ).

  • Python (Flask, AI inference).

  • JavaScript (Leaflet.js map).

๐Ÿ”— Software Integration:

  • When the Raspberry Pi detects road damage using camera and YOLOv12,it sends alert to:

    1-ESP32 (main vehicle) using UART, then the main vehicle sends the alert to the other ESP32 (other vehicle) using ESP-NOW.

    2-aws iot core using mqtt ,then aws iot core sends the alert to government agencies (our gmail as a simulation).

    3-mongodb atlas ,then these damages are shown as markers on the map.

๐Ÿ”Œ Hardware Integration:

  • YOLO runs on Pi + webcam.

  • Raspberrypi to ESP32 (main vehicle) using uart.

  • ESP32 to other ESP32 (other car) using ESP-NOW for V2V.

๐Ÿ“‚ Key Files:

  • main.cpp:listens to GPS data, checks for road damage detection, records the GPS location, and triggers communication subsystems (V2V, V2C, and Map) to send and visualize alerts.

  • aws.cpp: Reads AI + GPS files then send alert to aws iot core.

  • Esp32_To_Esp32/v2v.c: sends alert to the other vehicle using ESP-NOW.

  • uart.cpp:reads detected road damage from a file and sends it over UART to an ESP32 for further V2V communication.

  • Other-Vehcile/v2v.c:receive ESP-NOW messages.

  • request.py:gets damage location then sends it to the server via post request.

  • app.py:saves the damage on mongo db atlas then sends all the damages to map.html file.

  • map.html: add the damages on the map.

๐Ÿ”’ Security:

  • TLS encryption.

  • IoT policies and certificates.

๐Ÿงช 4.Testing

๐Ÿงฑ Unit Testing:

  • AI detection accuracy.

  • GPS string parsing.

  • UART transmission.

  • ESP-NOW transmission.

  • mqtt transmission.

  • markers on the map.

๐Ÿ”€ Integration Testing:

  • AI + GPS + UART โ†’ ESP32 (Main Car) โ†’ ESP-NOW โ†’ ESP32 (Other Car)

  • AI + GPS + MQTT Pipeline โ†’ AWS IoT Core โ†’ Email Notification (Gmail)

  • Flask + MongoDB + map markers.

๐Ÿงช System Testing:

  • Full end-to-end flow: detect โ†’ send โ†’ visualize.

๐Ÿงช Edge Case Testing:

  • No GPS signal.

  • No internet โ†’ local backup.

  • ESP32 not responding.

5. ๐Ÿš€ Deployment

๐Ÿ–ฅ๏ธ On Raspberry Pi:

  • Auto-run app on boot.

  • Custom image using Yocto.

๐ŸŒ Database:

  • MongoDB Atlas with static IP whitelisting.

๐Ÿ—บ๏ธ Web Map:

  • Flask server accessible via public static IP or EC2.

๐Ÿ” Security:

  • Certificates uploaded to Pi.

  • Private key permissions restricted.

๐Ÿ“ˆ 6. Maintenance & Future Work

๐Ÿ”ง Maintenance:

  • Fix AI false positives.

  • Monitor MQTT message delivery.

๐Ÿ”ฎ Future Enhancements:

  • Add an image or video showing the damage with the message sent to AWS.

  • We suggest that the government agencies have access on mongodb atlas for updating the map after maintenance.

  • using lidar and radar for different weather conditions.

alt text

Acknowledgments

This project was inspired and influenced by the work of the Yocto Project community and developers. Also, it was mentored by Dr. Essam at shoubra faculty of engineering

Contributors

This project was the graduation project of a group of 7 from Faculty of Engineering, computer department, Benha University, Class of 2025.

My teammates are:

Contributing

Contributions to the Advanced Road safety system project are welcome! If you find any issues or have suggestions for improvements, please feel free to submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published