← Back to blog

How Automatic Mileage Detection Actually Works

Published 2026-05-04

An auto-detection mileage tracker decides on its own when you start a drive, follows it, and decides when you have stopped. All without you tapping a button. The how-it-works under the hood matters because it determines the trade-off between accuracy and battery.

Step 1: Wake on motion

The app does not run continuously. Instead, it registers with iOS to be woken up when meaningful motion happens. Apple's SignificantLocationChange API fires when you move to a different "cell" of GPS space (typically 500m or more). CoreMotion can also wake the app when the phone detects vehicle-class motion.

Step 2: Confirm a trip is starting

Wake-up alone is not enough. You might be walking the dog or riding a bike. The app checks speed (Doppler-based, accurate even in a parking garage with poor GPS), motion type (CoreMotion classifies walking vs cycling vs driving), and rate of position change. Multiple signals confirm a vehicle is moving before recording starts.

Step 3: Record the route

During recording, the app pulls high-accuracy GPS positions (filtered for accuracy < 200 meters), runs them through a Kalman filter to smooth GPS jitter, and stores a sequence of route points. CoreMotion runs in parallel as a sanity check. If the phone goes still for too long, the app starts looking for a stop.

Step 4: Detect the stop

A combination of speed dropping to zero, position not changing for a configurable window (typically 2-3 minutes), and CoreMotion confirming non-vehicle motion ends the trip. A 120-second cooldown prevents accidental re-triggers when the driver pauses at a long red light or in a drive-through.

Step 5: Map matching at trip end

Raw GPS points usually do not align perfectly with road network. Map matching snaps the recorded points to the actual road network, producing a clean route polyline that matches the streets you drove. This is also when the final mileage figure is computed (route length, not GPS-point-by-GPS-point sum).

Why battery efficiency varies between apps

The biggest battery cost is continuous high-accuracy GPS. Apps that wake only on significant-location-change and escalate to high accuracy ONLY during confirmed driving can run all day with single-digit-percent battery drain. Apps that run continuous high-accuracy GPS will drain a phone in 6-10 hours.

Why accuracy varies

GPS accuracy degrades in urban canyons, parking garages, tunnels, and dense forest. Sophisticated trackers use Doppler speed (which works even when position is unreliable), dead reckoning during gaps, and the Kalman filter to maintain accuracy in low-GPS conditions. Less sophisticated trackers drop trips or record garbled routes when GPS quality dips.

See auto-detection done right. Start free with TruMile →

Track every business mile.

40 auto trips a month, free forever. Switch from any tracker with a one-tap CSV import.

Download free on the App Store