Skip to content

Smart Vehicle Tracker

Ismail ElDahshan edited this page May 22, 2026 · 26 revisions

Smart Vehicle Tracker

Name GitHub
Yussuf Abdelkarim Youssefibrahim03
Ismail Dahshan ismaileldahshan1
Amr Eid GH_UID2

Github Repo: https://github.com/ismaileldahshan1/Smart_Vehicle_Tracker

1. The Proposal

Abstract / Elevator Pitch:

Vehicle theft remains a serious and growing problem in Egypt, with limited affordable solutions available to everyday car owners. Existing GPS trackers on the market require expensive cellular subscriptions and lack integration with the vehicle's own diagnostic system, meaning they can only report location — not whether the engine is actually running or the car is being driven.

This project proposes a smart vehicle tracker built around a Nucleo STM32L432KC microcontroller running FreeRTOS. The system plugs into the car's OBD-II diagnostic port via an ELM327 Bluetooth adapter (connected through an HC-05 Bluetooth module) to read real-time engine data such as vehicle speed and RPM. Simultaneously, a NEO-6M GPS module tracks the car's geographic location. If the vehicle moves without the owner's authorization, a SIM800L GSM module immediately sends an SMS alert to the owner's phone containing the car's live GPS coordinates as a Google Maps link. The system provides a complete anti-theft solution: it knows both where the car is and what it's doing — all without requiring WiFi or internet subscriptions.

Project Objectives & Scope:

MVP:

  • OBD-II engine data reading (speed, RPM) via ELM327 Bluetooth → HC-05 → UART
  • Continuous GPS position tracking with NMEA sentence parsing (NEO-6M)
  • Anti-theft detection: alert triggered when vehicle speed > 0 while system is armed
  • SMS alert to owner via SIM800L GSM module with Google Maps location link
  • Arm/disarm system state via serial command or software flag
  • FreeRTOS task architecture with queues and semaphores for inter-task communication
  • UART serial logging of GPS coordinates, OBD-II data, and events

Stretch Goals:

  • Periodic location updates via SMS at configurable intervals while car is moving
  • Speed threshold alerts (notify owner if car exceeds a set speed)
  • Trip logging with timestamps — start/end location and duration over UART
  • Geofence boundary detection with configurable safe zone

2. System Architecture

2.1 High-Level Block Diagram:

Hardware Architecture connections: image

Subsystem Breakdown:

The system is organized around three input modules and two output modules, all managed by the MCU running FreeRTOS.

Inputs: The ELM327 Bluetooth OBD-II adapter plugs into the car's diagnostic port and communicates wirelessly with an HC-05 Bluetooth module configured in master mode. The HC-05 outputs serial data over UART to the Nucleo, allowing the MCU to send OBD-II PID requests (as simple AT command strings like "010D\r" for speed) and receive parsed responses. The NEO-6M GPS module communicates over a second UART, continuously feeding NMEA sentences that the MCU parses to extract latitude and longitude. System arming is controlled via a software flag toggled through a serial command.

Processing: The MCU runs FreeRTOS with separate tasks for OBD-II communication, GPS parsing, alert logic, SMS transmission, and UART logging. The OBD-II task periodically requests vehicle speed and RPM from the ELM327. The GPS task parses $GPRMC sentences to extract coordinates. The Alert task monitors whether the system is armed and the vehicle is moving (speed > 0) — if both conditions are true, it triggers the SMS task. Tasks communicate through FreeRTOS queues (sensor data → alert logic) and semaphores (shared arm/disarm state).

Outputs: The SIM800L GSM module connects over a third UART and sends SMS alerts to the owner's phone number using standard AT commands. The SMS contains the vehicle's current GPS coordinates formatted as coordinates. A UART debug log outputs all GPS coordinates, OBD-II readings, and system events to a serial terminal for development and diagnostics.

3. Hardware Design

Component Selection:

Schematics & Wiring:

Circuit diagrams, pinout tables, and breadboard layouts.

Bill of Materials (BOM):

A table listing component names, part numbers, quantities, costs, and links to datasheets.

Power Budget:

Calculations ensuring your power supply can handle the peak current draw of all components combined.

4. Software Implementation

4.1 Software Architecture:

Description of the firmware design (e.g., Bare-metal Superloop, Interrupt-driven, or RTOS).

4.2 Flowcharts & State Machines:

Visual diagrams mapping out the core logic, state transitions, and interrupt service routines (ISRs).

4.3 Key Algorithms:

Explanations of any complex logic used (e.g., PID control loops, digital filtering, sensor fusion).

4.4 Development Environment:

Compilers, IDEs, and toolchains used (e.g., Keil, PlatformIO, STM32CubeIDE).

5. Testing, Validation & Debugging

5.1 Unit Testing:

How individual hardware components and software functions were tested in isolation.

5.2 Integration Testing:

How the system was tested as a whole.

5.3 Challenges & Solutions:

A log of major bugs, hardware failures, or design flaws you encountered, and the engineering steps you took to solve them.

6. Results & Demonstration

6.1 Final Prototype:

High-quality photos of the completed build.

6.2 Video Demonstration:

A link to a short video showing the system working in real-time under various conditions.

6.3 Performance Metrics:

Data showing how well the project met its initial objectives (e.g., "Response time was measured at 12ms, well within our 50ms goal").

7. Project Management

7.1 Division of Labor:

Ismail — OBD-II subsystem and Bluetooth communication. Responsible for configuring the HC-05 in master mode and pairing it with the ELM327, writing the OBD-II PID request/response parser over UART, and implementing the OBD-II FreeRTOS task. Also handles FreeRTOS task architecture setup (task creation, queue and mutex configuration).

Youssef — GPS subsystem and SMS alert system. Responsible for interfacing the NEO-6M GPS module, writing the NMEA parser to extract coordinates, interfacing the SIM800L GSM module, implementing the SMS sending logic with AT commands, and formatting the Google Maps link. Implements the GPS and SMS FreeRTOS tasks.

Amr — Alert logic, system integration, and testing. Responsible for the Alert FreeRTOS task (monitoring armed state + vehicle speed to trigger SMS), the arm/disarm mechanism, UART debug logging, power supply design, and overall system integration. Also leads documentation (wiki page, presentation slides) and demo preparation.

Shared responsibilities: All three members contribute to debugging, FreeRTOS tuning (task priorities, stack sizes), and the final demo.

7.2 Timeline:

Date Milestone Deliverable
Mon, Mar 30 Project kick-off Brainstorming ideas, team formation begins
Tue, Apr 14 Milestone 1: Team formation Team finalized (Ismail, Youssef, Amr)
Wed, Apr 15 Milestone 2: Proposal presentation In-class proposal slides, wiki Sections 1, 2.1, and 7
Apr 16–19 Order HC-05, NEO-6M, SIM800L. Set up FreeRTOS project on STM32. Assign subsystems
Mon, Apr 20 Checkpoint A: Wiki/page setup Full proposal on course wiki with block diagram, objectives, labor division, and timeline
Apr 21–28 Development sprint 1 Ismail: HC-05 paired with ELM327, OBD-II PID requests returning speed/RPM on serial terminal. Youssef: GPS NMEA parsing working, SIM800L sending test SMS. Amr: FreeRTOS tasks created and scheduled, UART debug log running
Wed, Apr 29 Milestone 3: Progress demo Live demo of at least one major subsystem (OBD-II reading speed or GPS + SMS working). In-class progress presentation
Apr 30–May 5 Development sprint 2 Alert logic integrated: armed + speed > 0 → SMS sent with GPS coordinates. All tasks communicating via queues and mutexes. Full system integration begins
Wed, May 6 Checkpoint B: Integration update Wiki update with integration status, testing evidence (screenshots, serial logs), and remaining issues
May 7–12 Final sprint In-car GPS testing. SMS alert timing verification. Edge case handling. Demo rehearsal. Wiki page completed with all sections. Code cleaned up
Wed, May 13 Milestone 4: Final demo Final in-class presentation, live demo, final code submission, completed wiki page

8. Appendices & References

8.1 Source Code Repository:

Link to your GitHub/GitLab repo.

8.2 References:

Links to datasheets, tutorials, academic papers, and course materials used during development.

Clone this wiki locally