EcoDrive is an experimental Flutter application that uses on-device sensors and GPS to analyze driving behavior and visualize estimated emissions and efficiency directly on a map.
The goal of the project is to explore how far you can go with phone-only telemetry (accelerometer, gyroscope, and GPS) to approximate vehicle dynamics such as acceleration, braking, and driving smoothness โ without requiring access to the vehicle CAN bus.
-
๐ Trip recording (start / stop drives)
-
๐บ๏ธ Map-based trip visualization using OpenStreetMap (via
flutter_map) -
๐ GPS tracking with polyline replay of trips
-
๐ Real-time telemetry
- Speed
- Longitudinal acceleration
- Estimated emission intensity
-
๐จ Color-coded route segments based on emission intensity
-
๐พ Local trip storage (JSON files on device)
-
๐ Trip replay mode
EcoDrive combines multiple phone sensors to produce a more accurate, vehicle-aligned estimate of motion:
| Sensor | Purpose |
|---|---|
| Accelerometer | Determines gravity vector โ phone tilt (pitch / roll) |
| User Accelerometer | Linear acceleration (gravity removed) |
| Gyroscope | Tracks short-term rotation (yaw) during turns |
| GPS | Provides absolute heading, speed, and position |
User Acceleration
โ
Rotate by gravity vector (tilt compensation)
โ
Rotate by gyroscope yaw (vehicle turns)
โ
Correct yaw drift using GPS heading
โ
Vehicle-aligned longitudinal acceleration
This layered approach reduces errors caused by:
- Phone mounting angle
- Vehicle turns
- Gyroscope drift over long trips
-
Uses Carto basemap tiles (
basemaps.cartocdn.com) for a clean, modern map style- Light and dark themed basemaps are supported
- Built on top of OpenStreetMap data
-
Rendered via flutter_map (non-commercial usage)
-
Route segments are colored based on estimated emission intensity:
- ๐ข Low
- ๐ก Medium
- ๐ High
- ๐ด Very High
-
Start and end points are highlighted in trip replay mode
-
This app does not read real vehicle fuel or emission data
-
Emission values are heuristic estimates, intended for visualization and experimentation only
-
Accuracy depends on:
- Phone mounting position
- Sensor quality
- GPS signal quality
This project should be treated as an educational / experimental tool, not a scientific instrument.
EcoDrive is open-source software released under the MIT License. You are free to modify and distribute the application under the terms of this license. See the LICENSE file for more information.
Please note that this README file is subject to change as the application evolves. Refer to the latest version of this file in the repository for the most up-to-date information.


