Racking Up Miles On A Bicycle Odometer

[jonh] religiously tracks the miles he rides on his bicycle. When his odometer’s battery started getting low, he wanted a way to run the miles up to where they were before, since replacing the battery resets everything to zero. [jonh] used an Atmel microcontroller to run up the miles on his bike computer so he could pick right back up where he left off. There is definitely a Ferris Bueller’s Day Off joke in here somewhere.

The bike computer itself is designed to plug into a base that connects to a magnet-triggered reed relay. It uses a wheel-mounted magnet to count the number of revolutions made and thus the distance traveled. [jonh] hooked up a simple microcontroller-driven circuit to these connectors to trick the bike computer into thinking it was moving, and moving fast! Since he knew the number of miles he wanted to sandbag onto the odometer, he was able to program it to run up the proper amount of miles and then stop. There’s no source code listing for the project, but this shouldn’t be too hard to reproduce. He provides a pencil-drawn schematic for the connection to the cyclometer from the microcontroller. At the end, there’s also some sage advice for those of you who are interested in building a decent hardware hacking lab on the cheap.

27 thoughts on “Racking Up Miles On A Bicycle Odometer

  1. Parallel connecting batteries is safe if one battery has a slightly lower voltage than the other *and* you use a diode to prevent the higher voltage battery from charging the lower voltage battery. Kidde does something like this in all of their CO alarms, but they do it using a wall wart as the ‘other’ higher voltage source. I had to hack one so it wouldn’t complain about it not having a battery.

    An improved hack would be to replace the ucontroller in the bike computer with one that didn’t lose the information when you changed the battery, imho.

  2. From my experience, there is usually a “hidden” function in the menus that let you reset your mileage to whatever number you want. Ive done this a few times over the years with my Sigma, but your cycle computer might just suck.

  3. I have a cheap bike computer and it does allow me to set the odometer in it when you change the battery. I wonder if he looked at the manual to see.

    I have thought of doing this for fun however, perhaps set the max speed of your last trip to something crazy.

  4. One wonders if he thought to set the scale factor that relates sensor pulses to distance traveled to the maximum number in order to speed up the process.

    Also, what will he do when the unit wraps around after 9,999 or 99,999 miles?

    very few bike computers let you know the battery is dying.

    To echo previous comments: These things usually use a face-mounted CR2032 or similar, making wiring all but impossible unless wires are put in prior to battery installation. Most units do allow you to set the odometer after installing a new battery.

  5. I’m glad to see I’m not the only one to think about the fact that most decent bike computers have the ability to set the mileage. Being a cateye computer, I’m fairly certain that it would have this feature as well.

  6. Typical hackers..

    We have a problem.
    It can be solved using n amount of cash and z amount of time.

    OR, by buying a new odometer with the feature in no time at all and using 50% of cash.

    But it’s not as fun or nerdy :)

  7. Why has nobody yet mentioned the 555 timer???
    I bike odometer only receives a series of on/off pulses…
    Another perfect example of were a microcontroler is overkill
    Ok so you could set things on the microcontroler like creating a certain average speed max speed extra.
    The solution to this problem might be to just attach wires to the battary terminals so the battery might be replaced without loss of power… That’s what I do with mine (:

  8. Nick: Just stop on one of those large car sensors in the road. The magnetic fields that they put off make my cycle computer register over 75mph…

    There’s even a grocery store near my house that has some curious magnetic field at the bike rack. I always register 40-50mph while I’m inside shopping…

  9. SIDE PROJECT:
    Most bike computers are actually accurate up to the 120+MPH range. I know this because we used one as a cheap but accurate odo for the rally car.

    Got a bad speedo? Want your co-driver to have accurate mileage? Bike computer hooked to the pulses that the transmission generates.

    My Dodge Neon has a 3v sensor that pulses to 8v.

  10. Spork, rechargable lithium button batteries are available but the voltage is often higher, nominally 3.6v or 3.7v and 4.2v when freshly charged which might damage the circuity.
    The other problem with rechargable lithium batteries is their self discharge rate means you may have to regularly top it up, non-rechargable lithiums have an extreemely low self discharge rate so can be used years after purchase.

    Digital watches that in the manual state they have a runtime of 3-5 years aren’t wrong, I once had a Casio watch where the original battery did indeed last 5 years as the manual said.

    Rechargable lithium button cells can be found in some windup torches, I took one of those, a LIR2032 which is the equivilant to a CR2032 but higher voltage, and ran it in my PhotonLight keychain torch which was designed to use two CR2016’s, it worked well and was initially brighter for a short time until the voltage started dropping but the hassle of taking out and charging it every couple of weeks got real annoying so I went back to CR2016’s that last a month or two with the same usage.

    Though hacking it to use a rechargable battery isn’t a bad idea if you were to generate a charging voltage from the front wheel, a magnet on the spokes moving past a coil wired into the rechargable battery, perhaps the same magnet that the cycle computer uses to measure wheel speed.
    Same technique the ReeLights use: http://www.reelight.com

  11. Ok so im guilty as any one at this, over engineering a problem. Where it would be easier to simply add the 14 miles you were at when it dies to the total u ride after. OR as the comment above notices to make it not lose battery again. But aside from missing the easy solution of writing down the mileage when it dies and adding it to the total, this embodies what HAD is all about. It really is a hack , on that note i totally approve of the over engineering of this problem. Nice work.

  12. I’ve almost ashamed to admit I’ve done that twice.

    The first time I used a PC, and simply toggled a pin on the parallel port on & off at a certain frequency (constant speed) and ran it for a while. A long while occasionally.

    Then my flatmate mentioned to the bike shop, so they got me to build one, bike nerds get real upset when you wipe the odometer. I can’t remember the chip I used, but you set the wheel size & distance, and it spat out pulses. I think most newer cycle computers let you set the odometer, usually at battery change time.

    And all the ‘just parallel the battery while you swap them’ folk need to venture out and try it. Easier said than done…

Leave a Reply to MohonriCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.