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.
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.
Wheels
Magnets, interrupts, speed, distance and cadence.
| Lesson | Time | What students do |
|---|---|---|
| Wheel magnetCatch a spoke magnet with an A3144 Hall switch on an interrupt, count every pass the instant it happens, and throw out bounces. | 55 min |
|
| 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. | 55 min |
|
| 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. | 45 min |
|
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".
Lights and screen
Lights that switch themselves and a screen you can read on the move.
| Lesson | Time | What students do |
|---|---|---|
| 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. | 45 min |
|
| 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. | 45 min |
|
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".
Ride
A ride log on microSD and a bike computer of your own.
| Lesson | Time | What students do |
|---|---|---|
| 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. | 55 min |
|
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".
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.