Table of Contents

Cycling Computer

I intend to make a ludicrous bicycle computer, which will do silly things like:

Data

To Do

Physical

  1. Photograph bike for purposes of overlay-sketching and progress measurement
  2. Find packaging for the eletronics
  3. Decide how to mount sensors / microprocessor onto bike frame
  4. Create mount-points and place wires (unless wireless is decided upon)

Electronics

Software

  1. Investigate software timers which fire interrupts. Simon said something about these, and I'd not heard of them. They seem a lot simpler than a PWM loopback. Though not nearly as hacky ;-)
  2. Reference Clock (see below) needs a pull-up (or pull-down) resistor. Just shorting PWM-out to INT-in won't work.
  3. Use PWM2 to verify accurate rate detection using new reference clock
  4. Display rate in rpm and kmph.

Roadmap

  1. Use optical mouse sensor to read speed (and wobble?)
    1. Probably simplest to avoid using USB mouse, try PS2 instead.

Physical Bike Properties

Rear wheel circumference at 60psi: 2m 4cm (readings were 2m14, 2m04, 2m06, 2m04.5)

Maths

Assuming that the wheel of my bike as a circumference of 1m, and that I reckon the practical upper limit for my bike is 50mph (~80kmph)1) then I can expect my bike wheel to do about 20 rotations per second. In order to sample this effectively, I should be sampling at 40Hz.

However, I won't have an analog measurement from the wheel. I will have a pulse once per rotation. I can configure the board to fire an interrupt on this pulse (by catching the rising edge, for instance). I can also connect one of the PWM modules to an interrupt and use it to generate my reference clock.

So I can have a tick() interrupt fired at 40Hz, providing an accurate reference signal, and another interrupt fired for each rotation of the wheel. By counting ticks between wheel rotations I ought to be able to work out my speed fairly accurately.

88 subs per second

A “sub”2) is approx. 6 inches. 30mph = 44 feet/s = 88 subs/s: Great Scot!

1)
I don't expect to be able to cycle at this speed, this is just the upper limit I've chosen to design my system for
2)
As in sub-way sandwich