Raspberry Pi Cycle Computer
I’m a keen cyclist and, with a few friends, have racked up a fair few miles over the years cycling for pleasure, commuting and charity. Last year, for example, we cycled the C2C (Sea to Sea) cycle route from Whitehaven to Sunderland for a local charity over a couple of days.
My bike is equipped for commuting & longer tours; nice panniers, bright lights, comfy seat and cycle computer. The cycle computer is the weakest link; it only displays basic time/distance/speed information, so I also track shorter rides on my iPhone using the excellent application RunKeeper. This tracks speed/position/altitude information via GPS and logs data on their website, plotting the position on Google Maps and graphing the information over time.
I would like to track longer rides but iPhone battery life whilst GPS is on is prohibitive. I could buy a dedicated GPS cycle computer but good ones cost in excess of £100.
This got me thinking. Would it be possible to make a bike computer using my Raspberry Pi? It would need to meet the following specifications:
- Waterproof handlebar mounted control unit:
- Small back-lit dot-matrix LCD display.
- Couple of buttons to select options.
- Quick release mechanism.
- Waterproof seat-post mounted enclosure for Raspberry Pi:
- Rechargeable battery pack to power system for at least 24 hours.
- GPS receiver.
- Quick release mechanism.
- Magnetic sensors on front wheel and crank to measure speed and cadence.
- Software:
- Show usual stats on LCD display including speed, distance, altitude & bearing.
- Log GPS data over time.
- Easy way to dump data to PC for export to third party apps for mapping, etc.
- Cost approximately £100 (note my optimism on some of the parts costs):
- £35.00 – Raspberry Pi
- £10.00 – Enclosures
- £15.00 – Screen
- £10.00 – Battery solution
- £20.00 – GPS receiver
- £10.00 – Wiring and sensors.
I think it can be done. Software is not much of an issue (it being my bread and butter). There are some hardware challenges to be overcome though, namely:
- Suitable waterproof enclosures.
- A stable 5V battery power supply for the Raspberry Pi, screen and GPS device.
- A cheap low powered GPS receiver module.
- A cheap low powered backlit portrait LCD display.
- A method for clocking the pulses from the sensors for RPM and cadence.
- Keeping the wiring between screen, Raspberry Pi and sensors to a minimum.
- Ideally all components must work with 5V logic levels.
Of the above, initial research on the Internet indicates that the hardest bit will be finding a suitable screen enclosure for mounting on the handlebars. However, I think this project has legs (well, wheels) and may well pursue it further this year…
Update: 18/01/2013
It looks like I’m getting somewhere with the BOM:
- Screen: An 84×48 pixel unit available from SparkFun for £7.00 (originally for the Nokia 5110).
- GPS Receiver: AdaFruit GPS Breakout (£24.00).
- Raspberry Pi Enclosure: Possible an Otterbox 2000 or similar.
The only snag is the screen’s maximum input voltage is 5V so running at full voltage (the Raspberry PI runs 5V logic) may shorten the lifespan of the display (and, from reports on forums, blow the backlight LED’s) but I can work around that with electronic trickery.