Royal Enfield Obd2 Dashboard

by DavidMoca in Circuits > Raspberry Pi

57 Views, 0 Favorites, 0 Comments

Royal Enfield Obd2 Dashboard

Gemini_Generated_Image_ra2sskra2sskra2s.png

RoyalEnfieldObd


A real-time OBD-II dashboard for the Royal Enfield Interceptor 650. Reads live engine data from the bike's ECU through a WiFi ELM327 dongle and displays it on a mobile-friendly web tablero.

Made with care in Guatemala πŸ‡¬πŸ‡Ή by a rider, for riders.

Dashboard running on a phone


What it shows

  1. RPM, speed, and estimated gear
  2. Engine oil temperature, intake air temperature
  3. Throttle position, MAP, engine load
  4. Battery voltage
  5. Instantaneous fuel consumption (L/100km) and tank-level tracking
  6. Per-session stats: max speed, max RPM, total km, total fuel
  7. Lifetime odometer (persists across reboots)
  8. Alerts for over-temp, low voltage, etc.


Contributing

Contributions are very welcome β€” this started as a personal project but the community can make it much better.

  1. Found a bug? Open an issue with as much detail as possible (bike model/year, dongle model, log output if available).
  2. Want to add a feature? Open an issue first to discuss, then send a PR.
  3. Ride a different Royal Enfield? PRs adding support for other RE models (350, 450, Himalayan, etc.) are especially welcome β€” share your PIDs, gear ratios, and tire specs. This project is Royal Enfield–focused, so contributions stay within the RE family.
  4. Don't speak English? Issues and PRs in Spanish are perfectly fine β€” the maintainer is bilingual.

When developing, please use MOCK_OBD=1 for changes that don't strictly require the real bike.


Support the project

This project is and always will be free and open source. If it's useful to you and you'd like to help keep it growing β€” covering hardware for testing other Royal Enfield models, weekend dev time, and the occasional gas tank for "testing rides" β€” a coffee-sized donation goes a long way.

Donate via PayPal

Donations are appreciated but never expected. The best contribution is still opening an issue or sending a PR.


License

MIT β€” Copyright (c) 2026 David Moca.

You are free to use, modify, and redistribute this project. Attribution to the original author is required.


Acknowledgments

  1. The OBD-II / ELM327 community for decades of reverse-engineering work.
  2. The Royal Enfield 650 owner forums and Reddit threads that helped figure out the non-standard PIDs.


Built by David Moca in Guatemala πŸ‡¬πŸ‡Ή GitHub @davinchoMoCa Β· moca.gt

Hardware


ComponentNotes

Royal Enfield Interceptor 650 (2018+)

Continental GT 650 should work out of the box β€” same ECU and OBD wiring

ELM327 WiFi dongle

Tested with Steren SCAN-030. Most generic ELM327 v1.5 clones should work

Raspberry Pi 3B (or any Linux box)

Runs the backend + serves the frontend

Mobile device

Phone/tablet mounted on the handlebar to display the dashboard

⚠️ The Interceptor 650 ECU does not speak full OBD-II. It uses a non-standard CAN protocol, and only a subset of PIDs are accessible. See debug/CONTEXT_2.md for the protocol notes.

Architecture

[Bike ECU] ←(K-line)β†’ [ELM327 dongle] ←(WiFi)β†’ [Pi running backend] ←(HTTP)β†’ [Phone browser]


  1. Backend (backend/): FastAPI server. Polls the dongle at ~2 Hz over a TCP socket, decodes PIDs, exposes JSON at /api/data.
  2. Frontend (frontend/): Vue 3 + Vite SPA. Mobile-landscape layout optimized for being mounted on the bike.
  3. Persistence: lifetime odometer and tank state are stored in a JSON file so they survive reboots.


Quick Start (development, No Bike Required)



The backend has a mock mode that generates synthetic OBD data, so you can develop the frontend without a real bike or dongle.

# Backend (terminal 1)
cd backend
pip install -r requirements.txt
MOCK_OBD=1 uvicorn main:app --reload --port 8000

# Frontend (terminal 2)
cd frontend
npm install
npm run dev


Open http://localhost:5173 in your browser. You should see fake data flowing in real time.

Production Setup (on a Raspberry Pi)


  1. Build the frontend: cd frontend && npm install && npm run build β€” this produces frontend/dist/.
  2. Run the backend: cd backend && uvicorn main:app --host 0.0.0.0 --port 8000. The backend serves the built frontend automatically.
  3. Connect the Pi to the dongle's WiFi AP (typically named Steren SCAN-030, WiFi_OBDII, or similar β€” open network or default password 12345678).
  4. Open http://<pi-ip>:8000/ from your phone, also connected to the dongle's WiFi.

A handful of env vars tune the behavior β€” see backend/main.py and backend/obd.py for details (e.g. FUEL_CORRECTION_FACTOR, MOCK_OBD).

Project layout

backend/ FastAPI server, OBD client, PID decoders
frontend/ Vue 3 dashboard (mobile-landscape)
scripts/ Utilities (ride log analysis, backups)
debug/ Standalone diagnostic scripts and project notes