Inspiration
When a car crashes, the driver most at risk isn't the one who crashed. It's the next driver, arriving at 200+ km/h around a blind corner without knowing anything is wrong. Today that warning depends on people: a marshal has to see the crash, react and wave a flag, and the driver has to spot it. Every step takes time, and at racing speed time is distance: a car at 250 km/h covers about 70 m every second, so the 4.6 s a marshal chain takes in our model is over 300 m of track the next driver crosses unwarned. We asked: what if every approaching car were warned automatically, within half a second?
What it does
Detect: a phone in each car classifies what its motion sensors feel as a kerb strike, spin, impact, severe impact or rollover, and reports when the car is lying still afterwards. Fuse: every signal within 50 m and 5 s joins one incident. Confidence from independent sources (the phone, the driver) is combined so they reinforce each other. Severity: rules rate each incident from 0 to 4, from a kerb strike up to "red flag recommended". Severity 4 (no answer to the driver check, or a driver red request) sends approaching cars a slow zone. The full red flag goes out automatically on a timeout, or when race control confirms a driver's request. Route: for every car within 2 km behind the incident, the server works out how many seconds away it is and how much distance it needs to slow down, assuming 1 s reaction, braking to 80 km/h at 1.2 g, and a 100 m margin. A car under 6 s away, or inside the 500 m flag zone, gets the incident's full warning. At 6-20 s it gets yellow, at 20-40 s caution, and beyond that nothing. Warn: each approaching car gets its own flag (caution, yellow, double yellow, slow zone or red) on its phone screen and on in-car warning lights, with the corner, distance and ETA, plus beeps and vibration. In the simulation, cars obey the flags: double yellow caps speed at 120 km/h, slow zone 80, red 60. Each phone acknowledges the warning, which measures latency end to end. Driver check: the crashed car's phone runs a 20 s "I'M OK" countdown. No answer means an automatic red flag and an urgent medical status. Race control: a live dashboard shows each incident, its sources and confidence, the cars approaching by ETA, simulated driver vitals, the Interlagos map and a live g-force trace. Only race control can return a flag to green.
How we built it
Server: FastAPI, with the core engine: incidents, fusion, severity, the ETA router, medical status and latency tracking. Car node: the phone's accelerometer and gyroscope in a browser page, reached over an https tunnel. Simulation: 18 simulated cars racing on the real Interlagos layout (4,247 m trace exported with FastF1), alongside the two real phones. In-car warning lights: an Arduino with a yellow LED, a red LED and a buzzer, following car 21's warning a few times a second. The proof: a 10,000-incident Monte Carlo simulation comparing marshals only with FlagZero, plus a replay of every live incident using the latency measured on the real phones. We measured a median of 53 ms from the crash reaching the server to the approaching phone acknowledging its warning (n=7), with a tunnel round trip of about 20 ms. Launcher: a one-click start script, a QR join page, and a keyboard-driven mock phone for testing without hardware. 63 automated tests.
Challenges we ran into
Latency was the central challenge. The whole point of FlagZero is to beat a marshal's flag by seconds, so we measured the warning chain end to end on real phones, from the crash reaching the server to the approaching phone acknowledging its warning. We routed the phones through a Cloudflare tunnel to the laptop server and measured a median of 53 ms.
Accomplishments that we're proud of
We simulated 10,000 incidents under the same assumptions for both sides. The approaching car was warned before reaching the hazard 94.9% of the time with FlagZero, against 48.4% with marshals alone. Secondary impacts fell by about 50%, from 54.9% to 27.6%. The median time from incident to warning dropped from 4.6 s to 0.35 s (0.3 s sensor capture plus the 0.05 s network delay we measured), and cars reached the hazard at an average of 46 km/h instead of 92 km/h. These figures come from a model: the next car arrives 1-10 s behind at 150-250 km/h, and the phone is assumed to miss 10% of crashes, which then fall back to the marshals.
On the live demo incident (a kerb strike at T8 Laranjinha), the replay showed 4.7 s with marshals against 0.35 s measured with FlagZero, and expected secondary impacts fell from 3.47 to 2.05. We drop phone #1 from a height and catch it, and the car behind it, along with its warning lights, switches to yellow, then double yellow, then red. We built all of it overnight at the Formula Tech Hackathon.
What we learned
In motorsport safety, the warning chain matters as much as the detection. Some cases no system can fix: a car under about 2 s behind can't stop in time, whoever warns it. The simulation shows exactly where that line is. Being clear about what a model does and doesn't prove makes the result more convincing, not less.
What's next for FlagZero
Validate crash detection on real vehicles, and measure detection and false-alarm rates with proper drop tests. Real positioning (GPS/RTK or the circuit's timing loops) instead of simulated positions. A second independent sensor, such as trackside cameras, to catch the crashes a phone misses. Warning lights in every car's dashboard, a more reliable network, authentication, and no single server that everything depends on. Pilot it with a real race control on a club circuit.
Log in or sign up for Devpost to join the conversation.