Source: https://mokxi.com/teachers/plans/build-bike-computer
Updated: 2026-11-19

Lesson plan

# Build a bike computer lesson plan

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

3 chapters, 6 lessons, about 5 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Magnets, interrupts, speed, distance and cadence.
- Lights that switch themselves and a screen you can read on the move.
- A ride log on microSD and a bike computer of your own.

### Materials for the whole unit

- Arduino Uno R3
- Hall sensor, A3144 x 2
- LED
- microSD card module
- OLED display, 128x64
- Photoresistor sensor module
- Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 2 h 35 min

## Wheels

Magnets, interrupts, speed, distance and cadence.

Lesson | Time | What students do

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. | 55 min

- A magnet and a switch
- South pole, pin low
- Count it on an interrupt
- Bounces
- Time between turns

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. | 55 min

- One turn, one circumference
- Fifteen km/h
- Slow down
- How far
- Stopped

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. | 45 min

- The second sensor
- Eighty rpm
- Which gear?
- Coasting

### Materials

- Arduino Uno R3
- Hall sensor, A3144 x 2
- LED
- microSD card module
- OLED display, 128x64
- Photoresistor sensor module
- Resistor

### Check for understanding

Each student finishes "Cadence" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Coasting".

Chapter 2. About 1 h 30 min

## Lights and screen

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

Lesson | Time | What students do

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. | 45 min

- Lights that think
- Dusk
- See and be seen
- Daylight

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. | 45 min

- A screen on I2C
- Ride and read
- Pixels lit
- Night ride

### Materials

- Arduino Uno R3
- Hall sensor, A3144 x 2
- LED
- microSD card module
- OLED display, 128x64
- Photoresistor sensor module
- Resistor

### Check for understanding

Each student finishes "Display" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Night ride".

Chapter 3. About 55 min

## Ride

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

Lesson | Time | What students do

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. | 55 min

- Card in
- Start riding
- Ride over
- No card, no problem
- Take it for a ride

### Materials

- Arduino Uno R3
- Hall sensor, A3144 x 2
- LED
- microSD card module
- OLED display, 128x64
- Photoresistor sensor module
- Resistor

### Check for understanding

Each student finishes "Project: a ride log" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Take it for a ride".

Your class

## Teach this unit as a class

Start a class from this course and its 6 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
