iot
esp32
mqtt
automotive
TSI-Telemetry Project
An open-source automotive telemetry system that captures real-time vehicle diagnostics from an OBD-II compatible car (Volkswagen Polo GT TSI) and streams it to a backend for analysis and visualization.
Project Goals
- Learn ESP32 - Understand microcontroller programming, power consumption, dual-core architecture
- Learn C/C++ - Through modifying and understanding the firmware
- Learn MQTT - Industry-standard IoT messaging protocol
- Learn TimescaleDB - Time-series database built on PostgreSQL
- Learn Grafana - Real-time visualization dashboards
- Build something useful - Analyze driving patterns on Mumbai-Pune expressway
What I Want to Achieve
- Connect ESP32 to OBD2 adapter via Bluetooth LE
- Stream telemetry data during a 20-30km drive to my home server
- Display real-time dashboards in Grafana
- Post-drive analytics:
- Fuel efficiency calculations
- Driving behavior analysis (acceleration, braking patterns)
- Engine health monitoring
- (Future) GPS-based braking point optimization for tolls and speed cameras
Current Status
- ESP32 firmware: Working, modularized, tested with real car
- Server infrastructure: COMPLETE (TimescaleDB + Grafana + HiveMQ Cloud)
- Dashboard: COMPLETE (9 gauges + time series)
- GPS integration: Deferred to later phase
- ESP32 WiFi/MQTT: TODO (Day 2)
Future: OBD11 and Advanced Metrics
Currently using a generic ELM327 Bluetooth adapter, which provides standard OBD-II PIDs available on all modern cars. However, for VW/Audi/Seat/Skoda vehicles (VAG Group), there's a more powerful option:
OBD11 (also called OBDeleven) is the official diagnostic software approved by the VAG Group. It can access:
- Manufacturer-specific PIDs not available through standard OBD-II
- Extended diagnostics like DPF regeneration status, AdBlue levels, transmission temperatures
- Advanced coding to enable/disable features (e.g., needle sweep, comfort indicators)
- More accurate telemetry for TSI/TDI-specific metrics
This would unlock deeper insights into the VW Polo GT TSI beyond what generic OBD-II provides. OBD11 integration is being explored for future iterations of this project.
Hardware
| Component | Model | Purpose |
|---|---|---|
| Microcontroller | ESP32 Dev Board | WiFi + BLE dual radio |
| OBD Adapter | ELM327 BLE clone | Translates OBD-II to Bluetooth |
| Server | Mac Mini (home) | Runs TimescaleDB, Grafana, MQTT bridge |
Telemetry Data Points
Currently tracking 10 PIDs from the car:
| Metric | OBD PID | Unit | Grafana Range |
|---|---|---|---|
| RPM | 0x0C | rpm | 0-8000 |
| Speed | 0x0D | km/h | 0-200 |
| Coolant Temperature | 0x05 | °C | 0-130 |
| Intake Air Temperature | 0x0F | °C | -20 to 80 |
| Throttle Position | 0x11 | % | 0-100 |
| Engine Load | 0x04 | % | 0-100 |
| Manifold Pressure (MAP) | 0x0B | kPa | 0-250 |
| Fuel Level | 0x2F | % | 0-100 |
| Timing Advance | 0x0E | ° | -10 to 50 |
| Battery Voltage | 0x42 | V | 10-16 |
Architecture Summary
Car ECU → ELM327 (BLE) → ESP32 → Phone Hotspot → HiveMQ Cloud → Mac Mini Bridge → TimescaleDB → Grafana
Links
Architecture & Concepts
- Architecture - System overview and data flow
- Streaming Data - How real-time data flows through the system
- MQTT Protocol - Pub/sub messaging explained
Technology Deep Dives
- ESP32 Basics - Microcontroller fundamentals and power consumption
- C++ Primer - Understanding the firmware code
- TimescaleDB - Time-series database setup and queries
- HiveMQ Cloud - Cloud MQTT broker configuration
Implementation
- Grafana Dashboard - Visualization setup and queries
- Bridge Script - MQTT to database connector
- Proxmox Deployment - Docker Compose stack for home lab
- Setup Log - Step-by-step build journal
- Troubleshooting - Common issues and solutions