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.
The histogram data written over serial is formatted for use in R, and the project includes a script to generate charts like the one above.
Code used in the project is available on github, published under a Creative Commons attribution license. Details about the circuit setup and the button functions are included there.
I had a LilyPad Arduino ATmega328 (Leah Buechley, arduino.cc). There was a nonfunctional cyclocomputer on a bike in my mom's garage (turns out it just had a dead battery). So, I connected up the sensor to my multimeter and started planning.
First mockup in cardboard; second mockup on paper. I decided to use alligator clips rather than sewing down my LilyPad, so I didn't have to commit it to this single project.
The wheel sensor: a magnet on the spoke, and maybe a Reed switch on the front fork.
The original computer sat in a dock on the handlebars. I made a little plastic connector that sits in it to connect to the Arduino, instead.
I drew inspiration from Becky Stern's LilyPad embroidery concerning how to attach wire ends decoratively.
I picked a tall pushbutton (similar to this one on sparkfun, but harvested from an old VCR) to trigger trip meter reports — easy to hit without looking.
On the other hand, I went with LilyPad Button Boards for the save and reset buttons, to avoid accidental pushing.
The speaker is from an old cordless phone — I took its ringer.
I soldered hookup wire to the tall button and the speaker, to sew them onto the denim.
The conductive thread frayed like crazy, even before use (an issue sparkfun may have addressed), so I super-glued it down liberally.
The back — that is, the left side — is not as decorative as the front (and note the electrial tape where one of the speaker's leads was leaning onto ground).
Field testing update: occasionally it resets of its own accord. I don't know why (input welcome!); guesses are: drawing too much current via speaker (though I think it has reset even when not beeping, and an ammeter reports reasonable current all the time); or shorting, either from moisture (I've been riding on damp roads) or fraying (the conductive thread I used is given to loose fibers).
Pursuant to some discussion on the Arduino Forums, and e-mails:
What about water? Probably failure. I've contemplated making it a plastic sleeve, and did ride it on a wet (and icy) street without harm; and the LilyPad foks say it's washable but of course with no battery attached.
Why LilyPad? Mostly because it's what I had. It was easy to make a cloth support for it, though, whereas I don't have (say) perfboard on hand.
Video Shooting: I shot the video on my mom's Canon Powershot G12 on an UltraPod Mini. (My D40x doesn't shoot video, nor does the UltraPod quite hold it up always.) For the stills I attached it to the garage door rail; for the riding segment it was slung under the handlebars (still on the UltraPod — my mom may not have known she was signing her camera up for that part).
Video Editing: I used Apple's iMovie '09 (which shipped with my computer). I had previously scorned it (having used Final Cut in school), but after watching their intro video and unchecking a few swooshey-effect boxes I was able to do what I needed pretty easily — including recording a voiceover extremely smoothly.
Also on the LilyPond web site.
Backlinks:
2011-01-21 / Arduino LilyPad ATmega328; conductive thread and other components; denim, thread, bias tape, velcro
Created by and © 2011 Mark Fickett except where noted. I try for valid XHTML 1.0 Strict and CSS.