Amateur endurance racing team · 2026
LapTimer: lap timer and endurance race strategist
A self-built Android app that times laps to millisecond precision with an external GPS receiver, and works out the optimal driver rotation for an endurance race.
Goal
A six-driver amateur team (8-hour endurance races judged on how even the lap times are, not on speed) had no affordable, accurate way to time their laps or plan driver changes. Ready-made systems are expensive or don't give the team live access to their own data. So I built everything myself: an Android app, a live pit-wall screen in the browser and a strategy calculation.
Results in numbers
What changed
10 Hz+
GPS refresh rate with the external receiver (a phone's own GPS is about 1 Hz)
±2 s
lap-finish prediction accuracy after the rebuild (was ±30 s)
191
laps timed at one 8-hour race
56%
of the team's consistency penalty came from pit stops: exactly what the strategy now improves
The situation
In endurance racing the fastest lap doesn’t win. What counts is how even the lap times are over the whole race. So choosing drivers and timing the driver changes matters as much as speed. The team had the track and the cars, but no tool that could tell them live whether a lap was on target, and no data to choose the driver order from. I built it on my own: an Android app that reads an external GPS unit, predicts when the lap will end, sends everything to the cloud and turns it into a race strategy.
Constraints
- A phone's own GPS updates too rarely (about once a second) and jumps around too much to tell which second the car crossed the finish line.
- The app has to run for hours with the screen off, without the phone switching off its location access in the background.
- The phone has to last a full 8-hour race day, including long stretches sitting still in the pits.
- Different cars share different engine data. Asking for the wrong thing slows everything down or gets no answer at all.
Solution
How I solved it
Precision
How do you catch the moment the car crosses the finish line to a fraction of a second, when the phone's GPS updates rarely and isn't accurate enough?
The app connects over USB to an external GPS unit (u-blox) and reads its data directly, tens of times more often than the phone’s own location service. Every line of data is checked, and lines garbled by interference are thrown away at once. If the USB connection drops, it reconnects by itself.
The finish-line crossing is found between two GPS points in a row: the system works out exactly where the straight line between them cuts across the finish line. A “gate” a few metres wide allows for small sideways drift, and a direction check rules out crossing the wrong way. The time comes from the phone’s steady internal clock, which never jumps, and the result is accurate to the millisecond.
Prediction
The first version predicted the lap finish as if the car went the same speed all the way round. In reality it's 120 km/h on the straight and 40 in the corner.
Now the car’s position is compared live with the driver’s own reference lap: which spot on that lap matches where the car is now, and how long it took to get there. The search only moves forward, so it can’t jump to the wrong part of the track in a corner, and it copes when the car is briefly held up by traffic. With every GPS point, the driver sees whether they are ahead or behind and when the lap will probably end.
Data quality
How do you stop one odd slow lap (traffic, a cold lap after a driver change) from spoiling the reference lap, while still showing drivers their real time?
The prediction always updates live, so drivers see honestly how much a lap is slipping, even in traffic. But the reference lap is only updated by “clean” laps: not the lap out of the pits, not a lap in traffic, and not a lap far off the driver’s normal time. Each new clean lap changes the reference less the more laps have already been counted. So the reference shows the driver’s usual steady pace, not their best lap.
Live monitoring
The pits want to see lap times, GPS status and the current driver live, without going out to the track.
The app sends every lap’s start, finish, running time, speed and GPS status to the cloud straight away. A pit-wall screen in the browser shows it all live. Drivers and sessions can be renamed on the web and the change goes back to the phone by itself.
Car data
How do you read the car's own data (revs, coolant temperature, voltage) when different cars share different data and asking for the wrong thing slows everything down?
The app connects over Bluetooth to an adapter in the car’s diagnostics port (OBD-II) and first asks the car which data it actually provides. After that it only asks for data that will really get an answer, instead of waiting for a reply for every missing value.
Strategy
The result depends on how even the lap times are, not just on speed. How do you decide from data in what order and for how long each driver should drive?
A separate analysis reads our own and every competitor’s lap times from the cloud. It showed something important: the scoring punishes big deviations much more than small ones, so one very slow pit lap does more damage than ten slightly slow laps. That gives a clear order: the most consistent driver starts and finishes, and the driver with the most uneven times gets a short, closely watched stint in the middle of the race.
The system can also tell whether the whole track slowed down (rain, a red flag) or just one driver got tired, because it compares every team’s pace at the same moment. So nobody gets swapped out for nothing when it’s really the track that changed.
Result
At the first real endurance race, it timed 191 laps over 8 hours without the app needing a restart or the GPS connection dropping. The data showed something no one would have noticed by eye: 56% of the team’s whole consistency penalty came from pit stops, and three especially slow driver changes caused most of it. That finding, backed by numbers rather than a guess, now sets the driving order and pit-stop routine for the next race.
What's next
Next is showing the strategy advice (each driver’s target pace and the track conditions) live during the race, not just afterwards, and letting the prediction use a reference lap on a new track from the very first lap.