Introduction: Bicycle Speedometer Display

About: Student Maker - Design Technology @ UWCSEA East Singapore - Brown Design Workshop

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
  1. 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.
  2. 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.
  3. 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.

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.