Inspiration

Alcohol has a number. Fatigue doesn't.

In 1954 an Indiana police officer, Robert Borkenstein, built a machine that turned drunkenness into a number. Laws were built on that number: 0.08 in the US, 0.05 in Utah, 0.03 in Korea. Over the following decades, US drunk-driving deaths fell by about half (other factors, like seat belts, helped too).

Fatigue slows people in the same way. When researchers put the same people through both alcohol and a night without sleep, 17 to 19 hours awake produced performance equal to or worse than a blood alcohol level of 0.05% (Williamson & Feyer, 2000). If you woke up at 7 a.m., that window opens around midnight. That is exactly a hackathon night.

But fatigue has no number, no device, and almost no law:

  • In 1997 in New Jersey, a driver who had been awake for 30 hours killed 20-year-old Maggie McDonnell. His penalty was a $200 fine. Maggie's Law followed in 2003, and in its first ten years it was reported to have been used to charge one person, because there is nothing to measure.
  • People can't judge it themselves. In a 2023 AAA Foundation driving study, 75% of drivers who rated their drowsiness as low were in fact moderately or severely drowsy.

So the rules we have regulate the clock, not the person. We wanted the smallest possible thing that measures the person: you, right now, against yourself.

What it does

0.08 is a 90-second reaction test in the browser. No install, no login, about two minutes from start to finish.

  1. Daytime: take the test once. That record stays on your phone and becomes your own reference.
  2. At night: first you predict: just as sharp, a bit slower, or much slower.
  3. Result: a ruler shows your measured change next to your prediction, the change in your typical reaction time, and what that delay means in feet travelled at 65 mph.
  4. Reference: below a divider, the app shows what published studies saw in other people awake as long as you, in the unit everyone already knows: blood alcohol.
  5. Room: an anonymous view of how everyone's results changed by time of night, and how predictions compared with measurements.

The two kinds of numbers never share a scale. One is a measurement of you. The other is a group average from studies, tied only to your hours awake. Converting one person's reaction time into a blood alcohol level has not been validated, so we don't do it.

0.08 is a warning light, not a permit. It never says it's fine to drive or work. A result with no sign of slowing is explicitly not an all-clear.

How we built it

  • The test is a short form of the psychomotor vigilance task (PVT), a standard tool in sleep research since the 1980s. Astronauts on the International Space Station use a 3-minute version as a self-test.
  • Engine: requestAnimationFrame stimulus onset, pointerdown input timed with event.timeStamp, random 1 to 4 s intervals. It measures the screen's refresh rate first, marks trials hit by dropped frames, and aborts if the tab loses focus.
  • Scoring: two metrics per test, response speed and lapse share (responses of 355 ms or slower). Lapses matter: in the studies, missed signals grow far more than average speed does.

$$S = \frac{1}{n}\sum_{i=1}^{n}\frac{1000}{RT_i}$$

Each metric is compared with your own daytime record, in units of expected session-to-session noise:

$$z_S = \frac{S_{day} - S_{now}}{S_{day}\sqrt{s_T^2 + s_{T_b}^2 / k}}$$

where \(k\) is the number of daytime records. The larger of \(z_S\) and the lapse score decides the outcome. A borderline result offers 90 more seconds, with a stricter cut for the longer test.

  • Own baseline only. Phones differ in touch and display delay, so we never compare people or devices, only you against your own daytime record on the same phone.
  • Frozen rules: thresholds were fixed before the event. A Python reference implementation generates 12 test vectors, and the TypeScript scorer must reproduce them exactly.
  • Privacy: reaction times never leave the phone. The server gets one anonymous summary per test: your change from your own daytime record, hours awake, and your answers. No name, no account, no device ID.
  • Stack: Next.js static export, React, TypeScript, Tailwind CSS, Vitest, Firebase anonymous auth and Firestore, nginx on DigitalOcean.

Challenges we ran into

  • The name versus the science. The name borrows the best-known legal limit, but the studies measured 0.05% and 0.10%, and only as group averages. We had to resist showing each person "your blood alcohol equivalent" and keep the study numbers in a separate reference area.
  • Wording. Every sentence had to avoid reading as permission. The most dangerous outcome of this app is someone scoring well and feeling cleared to drive.
  • Timing in a browser. A 60 Hz screen adds up to 16.7 ms per stimulus, and phones behave differently in Low Power Mode. We classify each device's refresh rate and only compare records from the same class.
  • Ninety seconds is short. The standard PVT runs 10 minutes and the validated short form runs 3. A shorter test is noisier, which is why we have an overtime block and a "no evidence either way" outcome.

Accomplishments that we're proud of

  • A full loop that works on a phone in a hallway: daytime record, prediction, test, result, room view.
  • The scorer is checked against an independent reference implementation.
  • The app says plainly what it can't know.

What we learned

  • "I'm fine" is the least reliable instrument in the room. Asking for a prediction before the measurement turns a reaction test into a test of self-knowledge.
  • A number changes behavior only when people share it. Fatigue units exist in research and in enterprise products; none of them is one the public knows. That is why we borrow alcohol's.
  • We are not the first to compare a short test with a personal baseline, or to express fatigue in alcohol terms. Those exist as paid enterprise tools with dedicated hardware or contracts. What we could not find is the combination: free, no device, in a browser, for anyone, right before a decision that is hard to undo.
  • Our thresholds come from a simulation over assumed distributions, not from validation on real participants. The data is exploratory.

What's next for 0.08

  • Teams: a chat bot or repository hook that offers the test before a late-night deploy or merge, so a rule like "slowed down means a second reviewer" has a switch.
  • Organizations: a four-week pilot of a pre-shift self-check in one hospital ward or one transport depot. Individuals see their own result; the organization sees only totals.
  • Validation: repeated daytime sessions per person, so "your usual range" is measured, not assumed, plus a 3-minute mode that matches the validated short form.
  • Open data: anonymous day and night records published as a public dataset on how much people slow down, and when.

Built With

Share this project:

Updates

Submission history