All paths

Build a bike computer

Hall switches on interrupts, speed and distance from a tire, cadence, automatic lights, an OLED and a ride log on microSD.

Arduino Uno R3Free6 lessons5 h3 chapters1,467 XPMaker · Intermediate+150 XP

0 of 6 done

What you will build

2 projects, built step by step

6 lessons in 3 chapters, about 5 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Cadence

Add a crank sensor on the second interrupt: pedal turns a minute, the gear worked out from wheel turns per pedal turn, and coasting spotted.

Open it in the simulator
Chapter 2 project

Display

Put speed in big digits, distance, cadence and the lights on an SSD1306 OLED, with a text-only library that leaves RAM for the card.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Wheels

Magnets, interrupts, speed, distance and cadence.

  1. Open205 XP

    Wheel magnet

    Catch a spoke magnet with an A3144 Hall switch on an interrupt, count every pass the instant it happens, and throw out bounces.

    0 of 5 steps

  2. Locked205 XP

    Speed and distance

    Turn the time for one wheel turn into km/h and the count of turns into meters, for a 2105 mm road tire, with whole-number math.

    0 of 5 steps

  3. ProjectLocked348 XP

    Cadence

    Add a crank sensor on the second interrupt: pedal turns a minute, the gear worked out from wheel turns per pedal turn, and coasting spotted.

    0 of 4 steps

4 questions, graded as you go.
Chapter 2

Lights and screen

Lights that switch themselves and a screen you can read on the move.

  1. Locked174 XP

    Lights

    Switch the headlight on at dusk and off in daylight from a light sensor, with two levels so it never flickers, while the wheel keeps counting.

    0 of 4 steps

  2. ProjectLocked348 XP

    Display

    Put speed in big digits, distance, cadence and the lights on an SSD1306 OLED, with a text-only library that leaves RAM for the card.

    0 of 4 steps

3 questions, graded as you go.
Chapter 3

Ride

A ride log on microSD and a bike computer of your own.

  1. Locked187 XP

    Project: a ride log

    Log every ride to RIDE.CSV on a microSD card, second by second, end the ride after ten still seconds with a summary, and ride on without a card.

    0 of 5 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 6 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Wheels

  1. Wheel magnetCatch a spoke magnet with an A3144 Hall switch on an interrupt, count every pass the instant it happens, and throw out bounces.
  2. Speed and distanceTurn the time for one wheel turn into km/h and the count of turns into meters, for a 2105 mm road tire, with whole-number math.
  3. CadenceAdd a crank sensor on the second interrupt: pedal turns a minute, the gear worked out from wheel turns per pedal turn, and coasting spotted.
Chapter 2

Lights and screen

  1. LightsSwitch the headlight on at dusk and off in daylight from a light sensor, with two levels so it never flickers, while the wheel keeps counting.
  2. DisplayPut speed in big digits, distance, cadence and the lights on an SSD1306 OLED, with a text-only library that leaves RAM for the card.
Chapter 3

Ride

  1. Project: a ride logLog every ride to RIDE.CSV on a microSD card, second by second, end the ride after ten still seconds with a summary, and ride on without a card.
Keep going

The next course on your track

Build a bike computer is part of the maker track, a ladder of courses from zero to expert.

Next course

Build a boat autopilot

A tiller pilot for the simulator: a tilt-compensated compass with declination, a limited rudder, a PID heading loop that knows 359 from 1 and ignores waves, and great-circle navigation to GPS waypoints. Never for real navigation.

Open the next course
Track

Maker track

Follow the starter kit you already own, then build a claw machine, a balance bot, a handheld console or an LED cube, each a short course checked by the simulator.

See every course on the track
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Build a bike computer

Is Build a bike computer free?

Yes. All 6 lessons of Build a bike computer are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Build a bike computer take?

About 5 hours: 6 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Cadence and Display.

Where do I start?

With "Wheel magnet", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.