/odometer

Bicycle Odometer

Primary LanguageC

Bicycle Odometer

Description

This is a project for a bicycle odometer. The odometer will record the front wheel turns of the bicycle. Instead of using a magnet/reed switch on the front wheel this odometer will get the information from the wheel hub generator. The generator will also provide the power for the odometer. This odometer is not a full fledged bicycle computer. Its sole purpose is to record the total kilometers/miles the bike has traveled. For more details please see the docs directory.

Hardware

  • Odometer
  • AVR ISP (In System Programmer)
    • The programmer should work together with AVRDUDE. I e.g. use Dean Camera's AVRISP-MKII Clone but any other AVR ISP should also be fine.
  • A USB to Serial Adapter
    • It needs to have TTL level inputs/outputs and preferably 3.3-5 Volts power output like e.g. the Adafruit FTDI Friend.

Software

Build

Clone or download the firmware. Make sure all needed binaries are in your path and then issue the following commands:

  • make clean
  • make
  • make flash

This will remove any old build files, rebuild the Intel hex file and download the hex file onto the Attiny. Also remember to set the fuses:

  • make fuse

The fuses only need to be set once.

Usage

The odometer needs to be hooked up in parallel to the hub generator. As soon as the front wheel starts turning the Attiny will power up and start counting the AC voltage sinus waves sent by the hub generator. The number of front wheel turns will be stored in the non-volatile EEPROM. To retrieve the stored wheel turns from the EEPROM you will need to connect the odometer to a computer with a serial adapter. I have travelled 3113.6 km up to now using the odometer.

Date: 2020-02-11