Skip to content

dhruv282/eco_drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EcoDrive

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.

โœจ Features

  • ๐Ÿš— 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

๐Ÿง  Sensor Fusion Overview

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

Fusion pipeline

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

๐Ÿ—บ๏ธ Map & Visualization

  • 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

โš ๏ธ Limitations & Disclaimer

  • 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.

๐Ÿ“œ License

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.

About

๐ŸŒฑ ๐Ÿ—บ๏ธ Explore eco-driving using on-device sensors, GPS, and real-time map visualization

Resources

License

Stars

Watchers

Forks

Contributors

Languages