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
9) Wires
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.  
Hey guys, <br>Sorry I was really slow on getting the arduino code back up. I've re-uploaded a pdf with the code, so everything should be good now. Enjoy!
<p>Good evening,</p><p>this application was published a long time ago but the concept triggered a new project. Check speed, distance for my model railroad. Model scale is H0 (1:87), the wheels are smaller than the one on your skateboard but with a reed relay and the attached magnet, it worked (mechanically). I still have a problem with the sketch:</p><p>After a compilation, an error message was shown:</p><p>exit status 1</p><p>stray '\342' in program</p><p>and the following line of code was highlighted:</p><p> if(millis()-last&gt;=milisegundos){</p><p>If you can spend a minute, I would appreciate any tipp. Thanks a lot, Walter</p>
<p>Hello,</p><p>i am workind on something similar, he differences are:</p><p>- i have a line follower sensor on digital pin 2</p><p>- i have a black and white stripe with 20 mm between 2 white stripes</p><p>- i need the output on the serial monitor, and not on the lcd.</p><p>i have put up a sketch, but i have some issues with the time.</p><p>i need to:</p><p>- start the counting every time the pin 2 changes (the sensor has moved) and count the millis until next pin 2 changes, and have the speed. at the end, if the pin 2 does not changes for 1 sec, the program stop's</p><p>can someone help me?</p><p>i have this sketch until now:</p><p>// Constante:</p><p>const int buttonPin = 2; // pinul digital pentru senzorul de linie</p><p>// Variabile:</p><p>int buttonPushCounter = 0; // counter numar impulsuri (1 sau 0)</p><p>int buttonState = 0; // starea actuala a senzorului de linie (1 sau zero)</p><p>int lastButtonState = 0; // starea anterioara a senzorului de linie (1 sau zero)</p><p>long time = 0;</p><p>void setup() {</p><p>// inititalizeaza intrarea pentru senzorul de linie:</p><p>pinMode(buttonPin, INPUT);</p><p>// initializeaza comunicatia seriala:</p><p>Serial.begin(115200);</p><p>Serial.println(&quot;________________________&quot;);</p><p>Serial.println(&quot;Program test&quot;);</p><p>Serial.println(&quot;________________________&quot;);</p><p>}</p><p>void loop() {</p><p>// citeste intrarea senzorului de linie:</p><p>buttonState = digitalRead(buttonPin);</p><p>time = 0;</p><p>// compara starea butonului actuala cu cea anterioara</p><p>if (buttonState != lastButtonState) {</p><p>// if the state has changed, increment the counter</p><p>if (buttonState == HIGH) {</p><p>// if the current state is HIGH then the button</p><p>// wend from off to on:</p><p>buttonPushCounter++;</p><p>time++;</p><p>}</p><p>Serial.print(&quot;Deplasare [mm]: &quot;);</p><p>Serial.println(buttonPushCounter*20);</p><p>Serial.print(&quot;Timp [s]: &quot;);</p><p>time = millis();</p><p>//prints time since program started</p><p>Serial.println(time/1000);</p><p>Serial.print(&quot;Viteza [mm/s]: &quot;);</p><p>Serial.println((buttonPushCounter*20)/(time/1000));</p><p>Serial.println(&quot;________________________&quot;);</p><p>// Delay a little bit to avoid bouncing</p><p>delay(1);</p><p>}</p><p>// save the current state as the last state,</p><p>//for next time through the loop</p><p>lastButtonState = buttonState;</p><p>time = 0;</p><p>}</p>
<p>Hi Leonardor, would your code that you posted (speedometer.pdf) change in any way for using a hall effect sensor? Not entirely sure what the point for int milisegundos = 500 is? Also, as a matter of interest what does the value represent in serial.begin(9600)?</p>
<p>Looks like you have both of the backlight wire grounded (LCD display)</p>
heyy leonardor I'm still trying, what brand type 16x2 lcd did you use, I'd appreciate it if you commented on my email eddy_gringo@hotmail.com thanks a lot :)
can some one please help me find the relay switch he is using! please thank you
Here's another: <br> <br>http://www.amazon.com/Directed-Electronics-8600-Magnetic-Switch/dp/B0009SUEZY/ref=sr_1_2?ie=UTF8&amp;qid=1386311244&amp;sr=8-2&amp;keywords=magnet+switch
Look for reed switches or hall effect sensors. Here's an example: <br> <br>https://www.google.com/shopping/product/18050359336623449179?q=reed+switch&amp;client=safari&amp;rls=en&amp;bav=on.2,or.r_cp.r_qf.&amp;bvm=bv.57752919,d.cGU,pv.xjs.s.en_US.JVi-ZN0rCA0.O&amp;biw=1371&amp;bih=745&amp;tch=1&amp;ech=1&amp;psi=dm2hUtv4DYn2oATs9ICwCw.1386311030542.3&amp;ei=g22hUqSHK5DroATb6oDABQ&amp;ved=0CMECEKYrMAs
hey leonardor I'm trying to do it, I connected everything I used your pdf arduino code and my lcd display turns on but it doesn't show mph or anything do u have any idea what could be the problem?
The lines <br>lcd.print(&quot;RPM&quot;); <br>lcd.print(&quot;MPH&quot;); <br>towards the bottom of the code are the ones that dictate what the LCD should display. More generally, the bottom of the code after <br>void LCDPrint () <br>is the part of the code that you should look at. Make sure you have this part exactly as written. Also make sure you haven't accidentally commented out any lines of code. But if your code is identical to the pdf file, then I'm not exactly sure what the problem could other than a wiring problem. Sorry I can't be of more help
Hey guys, <br>How i can convert RPS to M/S &amp; MPH to KMH? <br>Thanks!
it isn't that hard al you have to do is rpm*(circumference of your wheel in cm)*(60 min/hr)*(1/100000 miles/inches)=speed in KMH <br>and change everey MPH to KMH in the code and why change RPS?
Hi link for code (word file) is not working. Can you fix it? Thanks!
You mentioned a 10K Potentiometer. I didnt see it anywhere in the write up, what did you use it for? And can you please re post that word doc. It is blocked by admin.
hello, I love, but does not work the link to doc to download the code. I would like to try. thanks
link for skateboard speedometer code.doc is down ... please re-up
Hello I wanted to download the word file containing the code for this project. The link is not working. Can you please fix it. Thank you.
I am unable to access the code file shown here. <br> <br>Can you provide an alternate source to obtain a copy? <br> <br>Richard
hey urs was the easiest and the cheapest speedometer...and can u mail me the picture of the magnet and the relay attached to the wheel so that i can attach it to my cycle compared to it ........please mail it to me as fast as u can..u can mail me at panchavanparivendhan123@gmail.com or wimpykid492@yahoo.com or noelisawimpykid@hotmail.com.......please reply to me as fast as u can.please please PLEASEE <br> <br> <br>Thank you!
Please, for your own sake, do NOT post your email address in public comments! It will attract spammers. Instead, send a personal message to the creator of the instructable.
how do you test for sens value and milisegundos value? thanks.. also could someone explain why use a analog input not a digital input since its counting on (1023) and off(0) values?
Hall effect sensors always &quot;seem&quot; to be better until you look at all the supporting hardware you'll need to setup to make sure they get a clean digital signal. Trust me its not as easy as it sounds.
I think you mean Arduino LONGBOARD Speedometer. Anywho, this is an awesome project, and I love skate/longboard mods. I did notice though, that the box is kinda bulky, and seeing you're only using 1input and 6 outputs, maybe switch out that uno for a pro mini: <br>http://www.sparkfun.com/products/9218 <br> <br>Not as easy to code, but I think worth it for your project.
where did you get the plastic case for the arduino?
You can find them right here... <br>http://www.amazon.com/Arduino-Box-for/dp/B003ZKJNVY/ref=sr_1_1?ie=UTF8&amp;qid=1336795573&amp;sr=8-1
I agree with Technochicken. A few thousand clicks and it is done for. Plus, it would probably miss a few clicks at high speeds...<br> <br> However, a reed switch <em>will</em> give you easier coding.<br> <br> Very cool.
Good project. Rater than using a mechanical relay (was it a reed switch?), it might be more reliable and longer lasting to use a solid state Hall Effect sensor, which does not rely on moving mechanical contacts to sense the magnetic field.

About This Instructable




More by leonardor:Arduino Skateboard Speedometer 
Add instructable to: