Introduction: Bicycle Speedometer Display
What Is It?
As the name suggests, in this project you will learn how to create a display for your bike that consists of both a speedometer and an odometer. Indicating real time speed and distance travelled. The total cost of this project comes to around 15 USD (not including the bike or the Arduino) yet the effort spent is worth the result.
How Does It Work?
This device works by counting the number of turns the wheel takes in a given period of time. It does this using an infrared sensor that detects the colours white and black. On the front tire, a white patch is painted on to allow the infrared sensor to detect when the wheel has made one revolution. Based on this information, the Arduino can determine the total distance travelled by the bike by multiplying the revolutions of the wheel by the circumference of the wheel. It is also able to calculate the speed of the bike by timing the intervals between consecutive revolutions of the wheel. This information is then displayed on the LCD display which is carefully positioned in the rider's field of view.
Onto the build....
Supplies
Part List
- 1x 1602A LCD Display
- 1x Infrared Sensor
- 20x Jumper Wires (Male to Male)
- 3x Jumper Wires (Male to Female)
- 1x Arduino Uno
- 1x PTM Switch
- 1m Long Velcro Strip
- 1x 10x5cm Perf Board
- 1x M3 Bolt
- 1x M3 Hex Nut
- 1x 7805 5V Voltage Regulator
- 2x Li-Ion 3600 mAh 3.7V Batteries
- 2x 18650 Battery Holders
- 1x 10k Potentiometer
- Optional: Duct Tape
- White Paint
Equipment List
- Scissors
- Hot Glue Gun
- Solder
- Soldering Iron
- Computer
- Arduino Uno Cable
- Arduino Software
- Paint Brush
Step 1: Circuitry: the 1602A Liquid Crystal Display
Required Parts And Equipment:
- 12x Jumper Wires
- 1x LCD Display
- Soldering Iron
- Solder
First, lets take out the LCD Display. It's important to remember that only 12 of the 16 pins actually need to be soldered to jumper wires. These pins are the 6 pins on either end of the strip of ports. Using a solderingiron, we can permanently join the wires to these ports as seen in the photos above.
Don't use too much solder as it may lead to the creation of a short between two pins yet using too little may result in an improper or dry joint that doesn't conduct electricity. So be careful to manage the amount of solder you use per pin.
Step 2: Circuitry: the Arduino and Perf Board
Required Parts And Equipment:
- 1x Arduino Uno
- 1x 10k Potentiometer
- 5x Jumper Wires
- 1x Perf Board
- 1x M3 Bolt
- 1x M3 Hex Nut
- Soldering Iron
- Solder
- Attach the Arduino Uno to the Perf Board by lining up one hole from the UNO and one from the Perf Board and then securing the two with an M3 bolt and hex nut. Blue tack, tape or hot glue may be used for additional stability.
- Connect the LCD Display to the necessary Arduino pin ports as per the diagram above. The perf board may be used to join many jumper wires that are connected to the same terminal. E.g. Positive and GND.
- Solder the potentiometer pins to jumper cables and connect those cables to the necessary ports as illustrated by the diagram above.
Step 3: Circuitry: the Infrared Sensor
Required Parts And Equipment:
- Infrared Sensor
- 3x Male to Female Jumper Wires
This is the sensor that will detect the number of rotations of the wheel and relay that information to the Arduino module.
Connect the jumper wires to the Infrared Sensor and then to their respective Arduino pins as illustrated the diagram above.
Step 4: Circuitry: Power Input
Required Parts And Equipment:
- 2x Li-Ion 3600mAh 3.7V Batteries
- 2x Li-Ion Battery Holders
- 1x PTM Switch
- 1x 7805 5V Voltage Regulator
- Soldering Iron
- Solder
Explanation
Since the bike will be moving, it requires a portable power source. The Arduino Uno board can be externally powered by a 5V source which is where the 2 Li-Ion batteries come in. Each cell is 3.7V, and therefore in series, it provides a total voltage of 7.2V. Hence, we require a 5V regulator to step that voltage down to 5V so that the UNO is supplied with 5V.
Process
First solder the voltageregulator to the perf board as shown in the images above. Then solder the positive terminal of one battery holder and the negative terminal of the other battery holder to relevant pins on the 7805 (see schematic above).
The switch should be soldered between the two batteries so that when closed, it creates a series circuit. Finally, place the batteries in the holders and connect the outputs from the 7805 to the V (in) and GND pin on the Arduino.
Step 5: Uploading the Code
Required Parts And Equipment:
- Computer
- Arduino Uno
- Arduino USB Cable
In order to complete this step, you must have the Arduino IDEdownloaded. Once this is complete, connect your Arduino to a computer, download the code attached below, and upload it to the UNO. Make any adjustments to the code you deem necessary in order to suit your situation. Once this is done, the circuit should be operational.
If something isn't working, troubleshoot it by checking all connections with a multimeter and re-visit previous steps in detail.
Attachments
Step 6: Adding Velcro to Components
Required Parts And Equipment:
- Velcro
- Scissors
- Hot Glue Gun
- (Tape: Optional)
Using scissors, cut out velcro slots that fit the backside of the LCD screen, the perf board and both battery holders. Once this is complete, use a hot gluegun to secure these velcro strips to the components. If hot glue isn't available, tape may be used.
Remember to make sure that the velcro is securely fastened to the components as we wouldn't want components falling off during the cycle journey.
Step 7: Painting the Bike Wheel
Required Parts And Equipment:
- Paint Brush
- White Paint
This step is very important as it is this paint that allows the infrared sensor to detect the number of rotations the bike wheel takes. Ensure an even coating that has no black spots. The larger the area of paint, the less likely the chance of the infrared sensor failing to detect a single rotation.
Keep this step neat and make sure that the spot is kept white enough for the sensor to differentiate it from the black tire.
Step 8: Adding Velcro to the Bike
Required Equipment And Parts:
- Velcro
- Hot Glue Gun
- Optional: Duct Tape
- Scissors
In this step, cut out the necessary lengths of velcro, a counter part to each component. Then add the velcro to the necessary places on the bike (placement diagram can be viewed in the next step). Secure is using either duct tape or hotglue.
Step 9: Placing the Components
Required Parts And Equipment:
- Duct Tape
- Scissors
Finally. place all the components in their respectivepositions as per the diagram above. Ensure that the components won't fall off during a bumpy ride by testing how securely fasted they are to the bike.
Now its time to place the infrared sensor by the wheel of the bike. It should be securely fastened while oriented towards the rim of the bike so that it can detect the white patch as it crosses the sensor. I did this using some ducttape, yet other, more permanent methods can be used instead.
Step 10: Finished!
Thats it! The display is now complete.
Enjoy.

Participated in the
Sensors Contest
8 Comments
3 years ago
Very nice as a learning project, but as said, not very practical (fine on an indoor trainer though). And also as mentioned, the UNO (etc.) has an onboard regulator.
I like that the project isn't based around 3D printing though.
Maybe you should extend the project to investigate the design cycle? (pun intended) i.e gradual improvements.
One could use I2C to talk to the display to reduce cabling. Use a much smaller processor board. Say a WeMos, which has WiFi, so you could display on your phone via a web page! Store and download speed profiles for a ride, add an RTC. Do away with the IR which is power hungry and affected by sunlight. Examine reed or inductive detectors. Add cadence, temperature, beep when you reach 88mph, manage your lights, by combining speed and cadence you could display gear (front & rear sprocket selection), log GPS etc.
You are unlikely to match any commercial units, I recently purchased a cycle 'computer' with speed (current, max, ave), odometer, temperature, cadence (current, max, ave), time, heart-rate (current, max, ave), and support for two wheel sizes, all for £8.50 and runs for months on two button cells! Mad! But the beauty of a practically useful project, especially if it supports another hobby, is that it makes a great starting block for learning and improving, or for providing unique functions that you can't find in the wild, or at a reasonable cost.
Reply 3 years ago
lol love the reference to 88mph. you're absolutely right and agree with you 100%, this will NEVER compete with a purchased unit, but then again very few DIY projects will.
I made my own music player, 8-bit audio .wav files. It is rubbish on batteries, rubbish sound, converting to 8bit audio is a pain, it's messy, it's akward, exposed PCB and wires, cost me over $NZ20 to make. I bought a $5 mp3 player from China, supports multiple file formats, FM radio, excellent battery life, small, uses a single AA battery, etc. Guess which is my favourite music player? :) Nothing beats DIY, and you should never stop doing it! For those reasons I love this project. I think it's cool someone has a PCV velcro'd to the side of their bike.
3 years ago
I like the photo-diode idea, as opposed to the more traditional reed-switch to count revolutions.
Reply 3 years ago
Thanks, although if there is one problem I am noticing, it's that if any sunlight directly hits the sensor, it ends up messing with the Arduino's readings. The easiest fix is to apply a cover/casing around the sensor.
Reply 3 years ago
Works great as proof of concept though, each one can implement it and house it to protect it from the elements as they see fit.
Another idea I like is to pulse the IR diode, the detector becomes more complex but it is more effective at filtering out ambient light. Google Lock-in-amplifier if you're not already familiar with the concept.
3 years ago
generally, an interresting project. But not really usable. there are a lot of cables hanging, no water, dust proofness... today you can buy a bicycle computer for 15€ and it has more functions and is smaller :) I bought a few months ago a computer (it was much more expensive), and it has no sensors and is really small :)
another thing... do you really need the voltage regulator ? the Arduino can get an input voltage of 7-12V, because it has a built-in regulator (at least the UNO)
3 years ago
How are you going to weather proof it?
Reply 3 years ago
I haven't really got to this part yet, although I am thinking of 3D-printing a case for most of the components. I'll update this instructables with those CAD models when they are completed.