Skip to content

markfickett/bicycle

Repository files navigation

<style type="text/css"> </style>

Bicycle Computer for Arduino LilyPad

This is a bicycle computer, designed to count wheel revolutions using a cyclocomputer wheel sensor. It stores two trip meters and a speed histogram; the trip meters are reported in Morse code via a speaker, and the histogram can be saved to EEPROM and later printed over the serial connection.

(Mouse over text like this for elucidatory tooltips.)

See photos and a video along with discussion concerning the hardware construction (sewing) and use.

Authorship and License

Creative Commons License

This work is licensed under a Creative Commons Attribution 3.0 Unported License; it is written by Mark Fickett. (Do let me know if you find it interesting or useful! Or, should you find bugs, a report or a pull request would be welcome.)

Hardware

The interface was designed for the LilyPad Arduino ATmega328 (Leah Buechley, arduino.cc). All peripheral hardware has one lead connected to the specified pin, the other to ground.

  • PIN_REV_SENSOR (12) — connected to a commercial cyclocomputer's sensor (chosen only because it was already on the bike)
  • PIN_SPEAKER (3) — a buzzer, originally the ringer on a cordless touch-tone phone
  • PIN_BUTTON_REPORT (2) — a momentary switch, easily triggered without looking (similar on sparkfun), originally from a VCR's circuit board
  • PIN_BUTTON_A and PIN_BUTTON_B (11 and 12) — LilyPad Button Boards, difficult to trigger accidentally
  • and PIN_STATUS (13) — the built-in status LED

Controls and Outputs

The status light blinks K (dah-dit-dah, -.-) when setup completes, then a short blink each time the wheel sensor is triggered. The trip meters are named (in Morse output) dit or dit-dit. Button inputs are either a tap (quick press and release), or a hold:

  • Tap PIN_BUTTON_REPORT to hear the trip meters' values in Morse on PIN_SPEAKER.
  • Tap PIN_BUTTON_A or PIN_BUTTON_B to reset the associated trip meter; the name of the trip meter and SK are sent as confirmation.
  • Hold PIN_BUTTON_REPORT to write the histogram values to serial output, formatted for R (see makeGraph.R).
  • Hold PIN_BUTTON_A to save the histogram to EEPROM. Before writing S is sent; then the status LED is lit during writing, and finally a dit is sent after writing is complete. The histogram is always read from EEPROM on startup.
  • Hold PIN_BUTTON_B to clear the histogram. (This does not write the cleared histogram to EEPROM.) An X is sent as confirmation.

Dependency: Morse Library

The Morse code output uses a Morse library for Arduino, the key feature of which is to allow monitoring an input (PIN_REV_SENSOR) while sending Morse.