Using an Arduino, it is easy to make a speedometer/tachometer for virtually any man-powered vehicle. I made one for my skateboard that used a small magnet to count revolutions and utilized an LCD display screen. This Instructable will show you how you can do the same step by step.
You will need a few things before we get started.
1) A man-powered vehicle (I will be using a skateboard)
2) An Arduino
3) A plastic Arduino protective box (pictured)
4) A small magnet (mine is 1/4 inch in diameter and about 0.2 inches tall)
5) A magnetic relay switch
6) A 9V battery and an adapter that connects this battery to the Arduino plug (pictured above plugged into an Arduino)
7) A small LCD screen (16 x 2 character display)
8) 10K and 47 Ohm resistors
10) A soldering iron and solder
11) Gorilla glue, super glue, crazy glue, or some adhesive of the sort
12) 10K Potentiometer
Step 1: Putting the Magnet on the Wheel
The first thing I did was embed the small magnet in my rubber skateboard wheel. I drilled a small hole (1/4″ diameter to fit the magnet snugly) on the inside of one of my back wheels toward the edge of the wheel. I then dropped some gorilla glue in this hole and fit the magnet in it so about half of the magnet’s height was imbedded in the wheel and half was sticking out of the wheel. Later this magnet will allow the magnetic relay switch to count the wheel’s revolutions when the relay switch is near the spinning magnet.
Step 2: The Electronics
The next step is to get all the electronics functioning. The circuit diagram can be seen here. The red connections indicate attachment to the Arduino’s +5V pin and the green connections are to the Arduino’s ground pin. You will want to solder (and probably also heat shrink) your connection points to ensure that the circuit doesn’t short itself out. This will also ensure that the connections (and thus speedometer) don’t fail while it is being used. You may want to wire everything up through a small piece of board separate from the Arduino. You can wire the pot, ground and +5V components to this board to minimize the connections into the actual Arduino pins. This will keep your electronics more organized and easier to work with. It is also important to consider where you will be mounting the LCD before you wire it all up. Depending on where you choose to mount your display, it may be necessary to take steps to ensure this connection is possible once the LCD is wired up. For example, since I mounted the LCD in my board and had the wiring go through a small hole I had to put the LCD in place and run the wiring through the hole to the LCD before I connected everything.
Step 3: The Arduino Code
With the electronics all wired up and secured, the next step is to code the Arduino. There are tons of codes out there for Arduino tachometers, so it shouldn’t be hard to find. The code I used for my speedometer/tachometer is attached.
One thing to note is the line that says “Serial.print(rpm*0.0080622311).” This line will be different for everyone. This line of code calculates the speed in MPH from the RPM value the relay and Arduino read. To do this you take:
For more detail: Arduino Skateboard Speedometer