Saturday, January 7, 2012

Make an Android powered speedometer for your car

One of the things I noticed right away when we got our new van was that the speedometer was slightly off. The car is used and probably had bigger tires put on at some point, so whatever, it didn't bother me. It felt like a little problem I could live with.

But the more I tried to nail down exactly how much the speedometer was incorrect, the more I realized just how wacky speedometer problems can be. This particular problem would get worse the faster the car would go. So if you wanted to go 20mph, for example, you had to point the needle at 25. But if you wanted to go 65mph, you had to point the needle at almost 80. I tested the speed using speedometer apps on several phones, and by driving past those "your speed is" signs at various speeds.

This obviously made it really hard to ever know exactly how fast you were going. Real speedometer calibration is very expensive, standalone GPS speedometers are expensive, and simply learning to live with it was not an option for me.

The solution? A homemade Android powered speedometer for $35.

Today's smartphones have super-accurate GPS chips which, combined with the right speed app, can tell how fast you're traveling to within 1 or 2 mph. With those standalone GPS speedometers being upwards of a hundred dollars, the option of using a cheap phone was pretty appealing.

I took to eBay and found lots of options in my for less than $40, many even cheaper. Some were working phones with cracked screens, some were Verizon or Sprint phones with bad ESNs (which means the phones have been blacklisted and won't be allowed to be activated on the network), and some were just old phones. All I wanted it for was GPS, which does NOT require a data connection. Even one with a cracked screen would have worked fine.

I ended up getting a Verizon Droid Eris with a bad ESN for $35. When the phone arrived, I installed two apps, Tasker and Speedview. Then I turned on airplane mode and headed out to the car. Many people don't know that the GPS chip in your phone needs no active data connection. For simple coordinates or speed use, it does not need to be connected, so using one in airplane mode or with a bad ESN works just fine.

Once out in the car, I took apart the dashboard and rigged up a USB charging cable behind it. I added a secondary cigarette-lighter charging plug behind the dash and plugged the cable into it.

The cable ran behind the dash up to the speedometer area where I attached the phone with peal-and-stick Velcro:

Tasker takes care of keeping the phone in the proper mode and turning it on and off with the car. Power to the USB cable shuts off when the engine is off, so Tasker is set to wake up the phone and launch SpeedView whenever power is connected. When power is turned off, Tasker is set to exit SpeedView and set the screen timeout to 7 seconds, effectively disabling the speedometer when the engine shuts off:

It works way better than I expected it to. The phone gets a solid GPS lock before I finish backing out of a parking space and it holds it without fail through everything except long tunnels.

If you are looking for a cheap and easy solution to an innaccurate speedometer, I highly recommend this option. It takes some time, hacking, and willingness to take apart parts of your car, but the end result is a very accurate digital speedometer that can even do things like speed logging, odometer, graphing of past speeds, etc. Ours works great and has yet to give me any trouble.