All articles Telematics

Reading noisy fuel data from cars: what OBD doesn’t tell you

The fuel level jumped up and down while the car was simply driving. Nobody added fuel, and nobody took any. The data was lying.

Zaid Hijazi
2 min read
On this page

Key takeaways

  • The fuel sensor measures the surface, not the volume — slopes and braking move it.
  • A moving average hides real refuels. Use a median, then speed-aware smoothing.
  • Only trust a change that lasts minutes while the vehicle is stopped.

Where the number comes from

Most vehicles report fuel level through the OBD port as a percentage from a float sensor in the tank. The sensor measures the surface of the fuel, not the volume. When the vehicle accelerates, brakes, climbs or parks on a slope, the surface tilts and the reading moves — sometimes by 8% in a few seconds.

  1. 01 Float sensor
  2. 02 OBD / CAN
  3. 03 Device
  4. 04 Filter
  5. 05 Alert
From tank to alert: every stage can add noise.

Why a moving average isn’t enough

A simple moving average smooths the line but also smooths the real events. A 60-litre refuel becomes a slow ramp, and a real drain disappears into the curve. You need a filter that removes spikes but keeps steps.

Remove the spikes, keep the steps. That is the whole job of a fuel filter.

javascript
// rolling median, then speed-aware EMA
const m = median(window(raw, 11));
const a = speed > 5 ? 0.08 : 0.25;
level = level * (1 - a) + m * a;

Only trust change when the car is still

The final rule is simple: report a refuel or drain only if the change is larger than the noise band and persists for several minutes while the vehicle is stationary. This one rule does most of the work against false alerts.

Note:

All charts and numbers in this article use sample data.

What OBD still doesn’t tell you

Tank shape. A 10% drop at the top of a saddle tank is not the same volume as 10% at the bottom. Calibrate per vehicle model, or your litres will be wrong even when your percentages are right.

  • Telematics
  • OBD
  • Signal processing
Share
in X

Was this article useful? Thanks for the feedback!

Zaid Hijazi

Software & AI Engineer in Riyadh. I write about building systems where mistakes are expensive.

Keep reading