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.

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.

LessonTimeWhat 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
  1. A magnet and a switch
  2. South pole, pin low
  3. Count it on an interrupt
  4. Bounces
  5. Time between turns
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
  1. One turn, one circumference
  2. Fifteen km/h
  3. Slow down
  4. How far
  5. Stopped
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
  1. The second sensor
  2. Eighty rpm
  3. Which gear?
  4. 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.

LessonTimeWhat 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
  1. Lights that think
  2. Dusk
  3. See and be seen
  4. Daylight
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
  1. A screen on I2C
  2. Ride and read
  3. Pixels lit
  4. 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.

LessonTimeWhat 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
  1. Card in
  2. Start riding
  3. Ride over
  4. No card, no problem
  5. 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.