Custom Android Auto Performance Cluster & High-Frequency OBD-II Kinematic Telemetry Engine
Calibrated and validated on the ND2 Mazda MX-5 platform (SkyActiv-G 2.0L 6MT).
Android Auto Infotainment Cluster — S2000 Sweep Tachometer, Kinematic Gear Latch, 3-Channel Pedal Bars, and Multi-Function Display
Modern OEM instrumentation frequently abstracts, filters, or delays critical powertrain telemetry. Standard mobile OBD-II solutions introduce sample jitter and windshield mount clutter unsuited for track use or spirited driving.
MXTelemetry bridges raw vehicle bus diagnostics and inertial sensors directly to the factory infotainment screen via an independent Android Auto NavigationTemplate / SurfaceRenderer pipeline. Validated across 250,906 contiguous frames (>6 hours of physical road testing) with zero socket drops, it provides an S2000-style horizontal sweep tachometer, multi-frame ISO-TP CAN parsing, kinematic transmission gear tracking, drive-by-wire pedal calibration, live powertrain dyno gauges, and downshift rev-match assist.
MXTelemetry decouples diagnostic polling, hardware IMU tracking, kinematic state estimation, and UI rendering across isolated coroutine dispatchers inside an Android Foreground Service:
flowchart TD
subgraph Vehicle Driveline
ECU[Mazda SkyActiv-G 2.0L ECU]
OBD[OBD-II CAN Bus Port]
ECU --> OBD
end
subgraph Hardware & Sensor Layer
VLINKER[vLinker MC / STN Bluetooth Adapter]
IMU[Device Hardware Accelerometer]
OBD -->|ISO 15765-4 CAN 500 kbps| VLINKER
end
subgraph Android Foreground Service
BT_SVC[ObdBluetoothService<br><i>Coroutines / Dispatchers.IO</i>]
VLINKER -->|Bluetooth SPP RFCOMM| BT_SVC
IMU -->|Orientation-Aware 2-Axis G| BT_SVC
subgraph Multi-Frame ISO-TP Pipeline
PARSER[ObdParser.kt<br><i>11-13 Hz Continuous Polling</i>]
end
BT_SVC --> PARSER
subgraph Kinematic & Physics Engine
GEAR[GearTracker.kt<br><i>Hysteresis Ratio Latch</i>]
PEDAL[Pedal & Brake Estimator<br><i>Zero-Floor DBW + Asymmetric EMA</i>]
DYNO[PowerMetrics<br><i>MAF-Derived BHP & Torque</i>]
REV[RevMatchTracker.kt<br><i>Predictive Ghost Needle</i>]
end
PARSER --> GEAR
PARSER --> PEDAL
PARSER --> DYNO
PARSER --> REV
CSV[Buffered CSV Logger<br><i>Auto-Rotation on Disconnect</i>]
GEAR & PEDAL & DYNO & REV --> CSV
end
subgraph Presentation Layer
HUB[TelemetryHub<br><i>Single Source of Truth StateFlow</i>]
GEAR & PEDAL & DYNO & REV --> HUB
RENDER[CarClusterRenderer.kt<br><i>Hardware-Accelerated SurfaceCallback</i>]
HUB -->|Direct Canvas Draw| RENDER
AA_SCREEN[Android Auto Infotainment Screen]
MOBILE_UI[Companion Mobile MfdCarouselView]
RENDER --> AA_SCREEN
HUB --> MOBILE_UI
end
Because production manual transmissions lack electronic gear-selector switches, transmission state is solved kinematically by evaluating the effective driveline ratio:
-
Hysteresis Latching: Implements a multi-sample sliding window (
$N=5$ samples) to reject driveline shock and clutch transition noise during shifting ($\sigma = 0.16$ in 6th gear). -
Idle Exclusion Band: Suppresses false neutral/first-gear determinations near idle (
$N_{\text{engine}} < 755\text{ RPM}$ ) or near zero ground speed ($V_{\text{vehicle}} \approx 0\text{ MPH}$ ). -
Lock State Evaluation: Differentiates between locked clutch engagement (
DRV LOCK) and free-wheeling neutral coast-down (FREE).
-
Zero-Floor Throttle Calibration: Electronic throttle control (ETC) keeps the physical throttle plate (
PID 0x11) at$10%\text{--}14%$ at idle for airflow management. MXTelemetry maps physical rest ($12.0%$ ) to$0.0%$ operator pedal intent (THR), eliminating ghost throttle inputs. -
Asymmetric EMA Braking & Standstill Hold: Synthesizes longitudinal deceleration (
$G_{\text{long}}$ ) into a$0\text{--}100%$ braking proxy (DEC) smoothed via an asymmetric low-pass filter ($\alpha_{\text{attack}} = 0.35$ ,$\alpha_{\text{decay}} = 0.20$ ), with a$25%$ standstill hold at stoplights until throttle tip-in.
- Derives instantaneous crank horsepower and torque from real-time Mass Airflow (
PID 0x10) and engine speed without external chassis dyno sensors:
- Rendered on Page 2 of the MFD carousel as dual vertical bar gauges (
PWR/TRQ) with session peak-hold pips and overrun fuel-cut zeroing.
- Senses brake onset and vehicle deceleration to compute the required engine speed for an immediate downshift to the next lower gear:
- Drives a transient cue along the horizontal tachometer sweep to guide heel-and-toe throttle blips prior to clutch release.
- Hardware-accelerated
SurfaceCallbackcanvas styled in Mazda Soul Red Crystal (#D31120), Sport Amber (#FFB300), and Pitch Black (#0C0D0E). - Features a 0–8,000 RPM S2000-inspired segmented sweep, 3-channel pedal bars (
THR/DEC/DRV), and a 3-page MFD carousel (G-Force Vector, Thermals, and Powertrain Dyno) mirrored identically on the mobile companion app (MfdCarouselView.kt).
| Gear | Internal Ratio | Driveline Ratio ( |
Calibrated Kinematic Band (RPM/MPH) |
|---|---|---|---|
| 1st | ~200 – 215 | ||
| 2nd | ~118 – 128 | ||
| 3rd | ~80 – 88 | ||
| 4th | ~62 – 68 | ||
| 5th | ~50 – 55 | ||
| 6th | ~39 – 43 |
Final Drive Ratio: $2.800 : 1$ (OEM Limited-Slip Differential, 205/45R17 tire diameter).
- Validated Vehicle: 2019+ Mazda MX-5 Miata (ND2, 2.0L SkyActiv-G, 6-Speed Manual).
- Recommended Adapters: vLinker MC/FD+ Bluetooth, OBDLink LX/MX+ (STN chipset recommended for sustained multi-frame ISO-TP polling).
- Target OS: Android 12 through Android 15 (API 31–35) utilizing non-location Bluetooth permission model (
neverForLocation).
Because Android Auto restricts non-Play Store applications by default, install the APK using one of the following methods:
- On your Android device, navigate to Settings → Connected devices → Android Auto.
- Scroll to the bottom and tap Version 10 times consecutively to enable Developer Mode.
- Tap the top-right menu icon (⋮) → Developer settings.
- Check Unknown sources and set Application Mode to Developer or Release.
- Build and install via ADB:
./gradlew assembleDebug adb install -r app/build/outputs/apk/debug/app-debug.apk
- Enable Shizuku via Wireless Debugging or ADB.
- Open KingInstaller, grant Shizuku privileges, and enable Install as Play Store.
- Select
app-debug.apkand execute the installation.
Kinematic state machines, power estimators, and parsing logic are validated against 250,906 recorded vehicle telemetry frames (obd_*.csv):
./gradlew app:testDebugUnitTesttestKinematicGearDetection_lockedUpshifts(): Verifies sequential ratio convergence across high-RPM shifts.testDownshiftRevMatch_ghostNeedleTrigger(): Validates mathematical convergence of blip targets during braking.testAntiStallThreshold_suppression(): Verifies idle exclusion logic suppresses stall flags above 680 RPM.testPowerTorqueEstimation(): Validates MAF-derived BHP and torque against empirical WOT pull vectors.testTachSweepBoundaryBounds(): Confirms LED sweep geometry clamps within canvas boundaries across varied head-unit aspect ratios.
- Primary Language: Kotlin 100%
- Car Interface: Android Car App Library (
androidx.car.app:app:1.4.0) - Concurrency & Lifecycle: Android Foreground Service, Kotlin Coroutines,
StateFlow - Protocol Handler: Bluetooth SPP (Serial Port Profile) RFCOMM engine with multi-frame ISO-TP CAN reconstruction
- Build System: Gradle Kotlin DSL (
build.gradle.kts)
This project is licensed under the MIT License - see the LICENSE file for details.