xander
← back

M-TRACE: road condition monitor

Oct 2026
github ↗

A $100 box that turns any fleet vehicle into a road inspector, tracking every pothole against Michigan's 30-day liability clock. Built solo in 24 hours at Hack Dearborn and placed 2nd of 50.

  • ESP32
  • Embedded
  • Python
  • Machine Learning
  • IBM watsonx
  • Hackathon

At Hack Dearborn I worked alone against teams of up to four, with 24 hours and about $100 of hardware, and placed 2nd of 50. The project was M-TRACE: a box that rides in the trucks a road agency already runs, measures every 50 m of road, and keeps a 30-day clock on every pothole it finds.

Doing a team's work alone came down to two things: practicing every piece I might need before the event, and cutting anything that didn't move the result.

Getting ready

In the week before the event I built about a dozen small practice projects on the parts I expected to use: an ESP32, a BNO085 motion sensor, GPS, an SD card, and a few wireless links. Each one had to end in a measured number, not just "it works":

Fixed-rate sampling
A FreeRTOS task pinned to one core held 100.2 Hz under WiFi load, worst tick 11.6 ms. The naive loop-and-delay version ran at 72 to 77 Hz with every tick late.
Wireless link
ESP-NOW between two boards: 100 pings a second, 0% loss, 2.9 ms round trip.
Classifier
A hand-built gesture classifier, 98% (59 of 60) on held-out trials.
Gotchas
Logged one line per lesson and reread them before the event: the BNO085 answering at 0x4B instead of the documented 0x4A, SD cards stalling up to a second per write, GPS sentences saturating a 9600 baud link at 5 Hz.

Each practice project had a different purpose from anything I planned to build at the event. The rule was that the knowledge transfers and the files don't.

Easy Rider: the pre-event

The pre-event round was a dry run of the real thing, and I entered it solo with Easy Rider, placing 1st of 4. People want to save money by biking to work but don't, because busy roads feel unsafe. Easy Rider races three commuters (car, calmest bike route, fastest bike route) along real metro Detroit routes while a yearly cost counter ticks up for each, with bike routes colored by traffic stress.

The pitch was 30 seconds and the race took 7 of them. The lesson I carried into the main event: say the problem once, then let the demo show the answer.

M-TRACE

The problem

Under Michigan law, once a road defect has been readily apparent for 30 days, the road agency is presumed to know about it (MCL 691.1403). Yet potholes mostly get reported by residents, federal-aid roads get a PASER condition rating only once every two years, and local roads don't have to be rated at all: in 2017, about 6% of their lane miles had any PASER data.

Fleet vehicles already drive every road, every week. M-TRACE makes those trips measure the road.

How it works

The M-TRACE box on a breadboard: ESP32, BNO085 motion sensor, GT-U7 GPS module and microSD breakout
The box: ESP32, BNO085 motion sensor, GT-U7 GPS and microSD, about $100 in parts.
  1. Measure. The box reads the motion sensor 100 times a second and GPS 5 times a second, scores the roughness of every 50 m of road, and flags severe hits, all on the board.
  2. Upload. Results queue on the SD card and upload over WiFi whenever there's a connection, so nothing is lost while the truck is out of range.
  3. Match. Roughness is corrected for speed and matched to SEMCOG's rated road segments by position and direction of travel.
  4. Act. A hit becomes a confirmed pothole once it shows up on two or more passes. Each one gets a 30-day clock from its first hit and a printable work order, hardest first.

Roughness for each stretch is the RMS of the vertical acceleration after removing slow motion like braking and body roll, normalized to 45 mph. One fitted line turns it into an estimated PASER grade, so roads nobody rates get one:

estimated PASER=5.75−3.18ln⁡(R)\text{estimated PASER} = 5.75 - 3.18 \ln(R)

The decision that mattered: report what lost

The easy version of this project would have put the most impressive model on the slide. Instead, every approach was scored on drives it never trained on, next to a simple baseline, and the results decided what shipped:

Roughness line
67% within one PASER grade. Shipped.
Ridge regression
64%, on 15 vibration features.
IBM Granite TSPulse
62%. It rescales the vibration before reading it, so it sees the shape of a jolt but not its size, which is what separates poor roads from good ones.
Always guess 6
56%. Most roads are fair, so this scores well while being unable to tell a poor road from a good one.

With only 182 training sections, the models with more knobs fit noise. The simple line was as good as anything else and easy to explain, so it shipped, and the models that lost are on the page because that's how you can trust the one that won.

The same rule held for the language models. IBM Granite 4 writes a weekly brief from computed facts, and any draft containing a number that isn't in those facts is rejected and rewritten. The Road Desk agent on watsonx Orchestrate answers only through tools that call M-TRACE's read-only API. Neither one can invent a number.

Results

From 11 drives covering 179 miles in southeast Michigan:

Potholes
158 confirmed on two or more passes, out of 572 spots hit.
Grading
67% within one PASER grade on 151 half-mile sections the model never saw, against 56% for the baseline. It never called a good road poor.
Forecast
Backtested on SEMCOG's own history: of the fair and good miles flagged as riskiest in 2020, 51% were rated poor by 2024, against 21% of all fair and good miles.
Device
On-board detection matched the backend on all 799 hits and all 5,758 roughness windows.
Left: confirmed potholes ranked by severity, each with the days left on its 30-day clock. Right: the fair and good roads most likely to turn poor by 2028.
Accuracy view: estimated PASER grades checked against SEMCOG's ratings
The accuracy view shows estimated grades against SEMCOG's ratings, so a road agency can see exactly how far to trust them.

Limits

One vehicle, 11 drives, one week, one region. Small gaps between models could change with more driving, and each new vehicle type would need its own calibration. The next steps are boxes in several vehicles, a full season of data, and a check against a county's own repair records.