A month ago GearSense was a ratio scribbled on a napkin. Tonight it sits on my desk, learns a drivetrain it has never seen, and tells me which gear I am in — having been told nothing about the bike at all. Three things happened today to get it here. It learned to discover gears for itself; we let it stand on a standard the whole industry already shares instead of rebuilding it; and somewhere in the middle of that, quietly, it stopped being an idea.
The number that couldn't be right
It started, as the good ones do, with something that looked wrong. The screen said IN GEAR 3, and underneath it, OF 2 DETECTED. Three of two. How can I be in a gear higher than the number of gears the thing claims to have found? Either it could count or it couldn't, and that contradiction sat there glaring at me.
My instinct went somewhere uncomfortable: maybe we weren't sensing the gear at all. Maybe the test rig — the little board that plays the role of rider and drivetrain — was simply telling the head unit "you're in gear three," and GearSense was parroting it back. That would make the whole project a very expensive echo. I said so, plainly, because a doubt you don't voice is a doubt that quietly rots the foundation.
The real proof was on the other screen — GearSense's own log, doing its own arithmetic. And it told the truth precisely because it was messy:
wheel=2.45 crank=1.23 ratio=1.990 -> (no match)
wheel=2.50 crank=1.23 ratio=2.033
wheel=2.62 crank=1.28 ratio=2.045
wheel=2.55 crank=1.30 ratio=1.963
wheel=2.55 crank=1.23 ratio=2.072
A parrot repeats 2.000. GearSense never sees 2.000 — it receives raw wheel and crank counts over two separate Bluetooth radios and divides them itself, scatter and all. Those wobbling decimals are the sensing. And that first line, the one that politely declines to call anything a gear, is a machine exercising judgement on its own evidence. An echo can't do that.
1 of 1 detected. It has found exactly one gear and is sitting in it. An echo can't be this honest about what it doesn't know yet.
Numbers are for humans
So the detection was real. But the contradiction was also real — just a different kind of bug. The big number and the little number were measuring two different things and the words pretended they were one. The "3" was an identity (a position on the cassette, looked up in a hardcoded table). The "2" was a tally (how many distinct gears we'd happened to confirm). Gluing an identity to a tally is how you get nonsense like three-of-two.
Pulling on that thread unravelled something much bigger and much better. If the device already knew the seven gears from a table, what was it really discovering? Nothing. The honest version doesn't get told the cassette at all. It earns it. And that reframed the entire machine:
That sentence — numbers are for humans, the ratio is the control system — is the whole architecture in a line. The discrete gears are a courtesy to the rider. The continuous ratio is the truth the electronics live by.
Learning from nothing
So out came the hardcoded table, and in went a thing that builds the drivetrain up from an empty list as you pedal:
-
01
Divide Every reading, wheel frequency over crank frequency. One number, the ratio.
-
02
Recognise Is it within a few percent of a ratio we've already learned? Then that's the gear — and we nudge that gear's stored average a hair closer to the new sample, so it sharpens with every turn of the cranks.
-
03
Discover Matches nothing we know — but holds steady for a beat or two? That's a new gear. Mint it, slot it into the list in ratio order, and renumber.
-
04
Rank The number on the glass is simply the current ratio's position in that sorted list. Which makes it always "X of N" with X never greater than N. The old contradiction isn't patched — it's impossible.
Then I flashed it, started the rig from cold, and pedalled. The screen began with nothing and filled in before my eyes:
ratio=2.03 # LEARNED gear #1 (now 1 gear)
ratio=2.18 # LEARNED gear #2 (now 2 gears)
ratio=2.40 # LEARNED gear #3 (now 3 gears)
ratio=1.41 # LEARNED gear #4 — inserted FIRST, all others renumber
# ...and on up the cassette, building its own ladder
Watching a fresh gear appear as a new rung on the ladder — and watching the whole ladder politely renumber itself when a lower gear turns up later — is the most alive this project has ever felt. My friend Bjorn and I just stood there grinning at it. It has that wow. It knows nothing, and then it knows your bike, and you never told it a thing.
2 of 7 detected. The pip ladder on the right has seven rungs — every gear the bike has, learned from nothing. The number on screen is always its rank in that earned list.
Standing on the standard
There was one piece of cleverness left that turned out to be a piece of foolishness. To tell the speed sensor from the cadence sensor, the firmware had been reading the sensor's name and looking for the letters "cad." It worked — because my bench sensors are politely named. It would have fallen over against a real Garmin or Wahoo named something else entirely.
And then the obvious question, the one that should have come first: isn't there a standard? There is. These are all Bluetooth SIG CSC sensors — same service, same characteristic, every vendor. And the data isn't an opaque blob: the very first byte of every measurement declares what's in it.
So the name-guess came out, and role now comes from the protocol itself. But the real prize wasn't the tidier code. It was the realisation behind it, and I'll put it the way it landed on me:
That's the difference between a project and a product. The wheel is already round. My job isn't to re-cut it; it's to put something on top of it that's never existed.
Born
As Bjorn was heading out the door today I heard myself say, "You know, we're going to have to start thinking seriously about how we sell these." He stopped, and after a second said: "I know. But I don't know how — I've never gotten a project this far before."
I'm still smiling at that, hours later. Not because it's a problem solved — it's a problem we've never had the privilege of having. For a month this was a hunch about a number. Tonight it's a thing on a bench that learns. A remarkably short gestation, and I don't take for granted what it took: stubbornness, a willing bike, late nights, and a working partnership I'll write about honestly because theIdea.club runs in the open — the firmware across today was built shoulder-to-shoulder with Claude, me bringing the bike and the bad ideas and the skepticism, it holding the protocol details and a steadier memory than mine and pushing back when I'm about to fool myself. Neither of us gets there alone.
Conceived a month ago. Born today. Now we find out how far it can ride.
Loading…