"Analog" Bicycle Speedometer

by brunoip in Outside > Bikes

13482 Views, 101 Favorites, 0 Comments

"Analog" Bicycle Speedometer

DSCN7432.jpg
DSCN7426.jpg
"Analog" Bicycle Speedometer

In this instructable I'm going to show how to make an easy "analog" speedometer using an arduino nano, a servo motor and a few more extra components.

The analog part of the project is only in the display of the speed, all the sensing, calculus and processing is being done in a digital way inside the arduino.

Materials

DSCN7331.jpg
DSCN7335.jpg
DSCN7337.jpg
DSCN7339.jpg
DSCN7340.jpg

Electronics:

Arduino Nano

Servo motor

Red LED

1 10k resistor

1 220 ohm resistor

Sensor:

1 reed switch from a house alarm

1 magnet from a hard drive ( you can use any magnet but stronger magnets can be place further way from the sensor so a strong magnet is recommended)

Case:

I used the plastic case from an old sega genesis rf box, any plastic box could be used but this one fits the components perfectly. Also I used a bike light, only for the plastic ring in the back so an already broken light would be better.

Electronics

Captura de pantalla 2016-05-29 a las 6.49.13 p.m..png
DSCN7400.JPG

The electronic circuit is pretty easy, just follow the picture below. The resistor used for the LED is a 220 ohm resistor and the one used for pull down in the switch is a 10k resistor.

The servo will be used to mode the needle in the display and the LED will flash when you are going faster than the speed allowed in the scale (see last steps for more details).

Case

DSCN7343.jpg
DSCN7346.jpg
DSCN7348.jpg
DSCN7353.jpg
DSCN7355.jpg
DSCN7357.jpg
DSCN7361.jpg
DSCN7374.jpg
DSCN7362.jpg
DSCN7365.jpg
DSCN7371.jpg
DSCN7376.jpg
DSCN7379.jpg
DSCN7383.jpg
DSCN7390.jpg
DSCN7366.jpg
DSCN7369.jpg
DSCN7393.jpg

Press the sides of the box and it will pop open. Make sure that your arduino and servos fits inside the box. The servo won't fit vertically so the back of it should be outside. Draw and square in the box for cutting, it have to be near the bottom and a bit to the side so the axis of the servo end at the center of the box. For cutting this hole I just made a lot of holes with a drill and finished it up with a file. You should also make a hole for the usb connector of the arduino, for the led and for the reed switch connector. Place everything inside and apply a bit of hot glue for hold everything in place. For finishing cut the back of the light and glue it to the back of the speedometer.

Code

I based this project in the awesome project of Jenna deBoisblanc (https://github.com/jdeboi/pimpMyBike).

I simplified it by only keeping the function that calculates the speed. Added a function for displaying it on the servo, a few line of codes for detecting when you are stopped and the code that will turn on the led when you are going at a faster speed than the supported by you scale.

Here you can download the finished code with the modifications.

Downloads

Scale and Max Speed

Captura de pantalla 2016-05-29 a las 6.20.03 p.m..png
DSCN7420.jpg
DSCN7419.jpg

When you are displaying your speed in digital lcd screen you can just show any speed in there, just write the number and it is, but with an analog speedometer you are physically limited by the size or your scale.

In the code you will find a variable called maxSpeed, this number represent the speed when the needle is at the end of the scale and the display can not show any higher speed. If you go faster than this the led will turn on, meaning that you probably should choose a higher value.

In my case I decided to use 36 km/h, is a speed that I won't usually achieve while riding in the city, and I know that if the needle is in the first mark I am at 9km/h, in the second one at 18 km/h and in the third one at 24 km/h. I didn't include any numbers in my scale so I can change my max speed at any time.

For finishing this project print the scale in the image (of any design of your own), glue it on top and then glue a bright color needle in the axe of the servo.

Last words

I hope you liked this instructable, it is my first project using and arduino.

I am from Argentina and I will be glad if you let me know any grammar mistake you find.

Bruno.