8 ms·
Building a Raspberry Pi GPS Speedometer
- samfisher83 7y agoYou could just used a cheap cell phone and the speedometer app. It would have been a cheaper option.
- newsclues 7y agoEsp32 based project would be more interesting
- willis936 7y agoThey make esp32 based obd loggers. I have one but I haven’t bothered getting it to work since the obdlink mx+ works well enough for my data logging desires. https://freematics.com/pages/products/freematics-esprit-obd-kit/ https://freematics.com/pages/products/freematics-esprit-obd-...
- gleslie 7y agoYep. I already had the Pi and case sitting around.
- deleted 7y ago[deleted]
- thanksgiving 7y agoI have been playing with my (spare) Android phone and its GPS to record my location and speed when driving. My guess is when using an app on Android, there are too many variables (from the actual GPS hardware, device ROM settings, app settings, etc.) which are not very easily accessible and likely optimized for different goals. In my use case (as in the article) only care about GPS readouts when the car is in motion so I don't really care about energy efficiency (within reason, the cigarette lighter thing should be able to safely power the device). The GPS module manual says it takes about forty seconds for the GPS module to position. https://images-na.ssl-images-amazon.com/images/I/81+jY5X2YrL.pdf https://images-na.ssl-images-amazon.com/images/I/81+jY5X2YrL... > Once the GPS module is powered on, there is data output > It usually takes about 40 seconds to be successfully positioned. > After the positioning is successful, the correct time, latitude and longitude position data will be available. But the article says: > GPS is usually acquired within 15-30 seconds of starting (much faster than the cheap electronic speedometers I tested first). Maybe this does not include the time it takes for the raspberry pi to boot? Maybe the raspberry pi takes an additional thirty seconds to boot and the GPS unit powers on almost simultaneously with the raspberry pi but we don't blame the GPS module for any delay until the raspberry pi boots, logs in, and the Navit application starts? Or maybe the GPS positions way before forty seconds and the manual is written that way to not be overly optimistic (could never get decent GPS signal when walking in areas with tall skyscrapers on my Android phone a few years back). This is also exciting because it is modular. When GPS III[1] (hopefully) becomes operational by the end of the decade (The tenth and final GPS Block III launch is projected in Q2 2023 so it should be fully operational/adopted by 2030), you could simply use a new module (in theory at least). [1] https://en.wikipedia.org/wiki/GPS_Block_III https://en.wikipedia.org/wiki/GPS_Block_III
- gleslie 7y agoYou are right; I didn’t factor in RPi boot time to that figure. I’d guess maybe 60-90 seconds total? By the time I’ve turned the ignition, backed out of the driveway, and put it in drive I have a GPS lock.
- theli0nheart 7y agoNot sure if this is unusual, but it takes me ~10 seconds to turn on my car and pull out of the driveway. What are you doing for 60-90 seconds?
- mcny 7y agoI’ve been watching ChrisFix and Scotty Kilmer in Youtube and while they don’t agree on much both say you should wait a few seconds after starting the car before driving away. Something about engine oil and lubrications. Probably doesn’t harm anything in the short term but if you have time, probably not a bad idea.
- gleslie 7y agoI live on a busy city street.
- theli0nheart 7y agoAh, gotcha. Yeah, that makes sense. :)
- megablast 7y agoLooking out for other cars?
- joshvm 7y agoYou can make a Pi boot much faster than that. The main thing to disable is wait for network available. Other embedded boards I've used eg Rock960 are ssh-able within about 20 seconds or less. Edit - much much faster (4 secs), actually: http://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry-pi.html?m=1 http://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry...
- jmpman 7y agoI want a HUD speedometer for my Model 3. This may be the cheapest solution.
- codazoda 7y agoI think a $30 pay as you go phone might be cheaper. Ditch the service and the GPS should still work fine. Throw on whatever apps and you're good.
- xupybd 7y agoWow that would be so illegal her in NZ. Nice to know some countries give you the freedom to do stuff like that. Here a spot of rust will take your car off the road. A broken spedo would never be allowed. Even if replaced with GPS.
- adrianpike 7y agofreedom does cut two ways
- mattlondon 7y agoSame in the UK - a broken speedo would be an instant illegal get off of the road thing. afterall how do you know you are not breaking the speed limits? I am not sure what you can get away with for DIY replacements - perhaps a police officer might give you the benefit of the doubt if you were polite and explained it was temporary while you are waiting for the real part, but I really suspect this would force your car off of the road at the next annual safety check/inspection (MOT test in the UK)
- tantalor 7y ago> how do you know you are not breaking the speed limits Drive a safe speed for the given road conditions. Match speed of other drivers. Not hard to do.
- mattlondon 7y agoOften the limit is way lower than the "safe" speed - e.g. the variable speed limits on motorways restricting you to 40mph on an empty road in perfect daytime conditions, or the 15mph limit for London - both only exist to manage traffic flow and/or dissuade people from driving. You're welcome to match other drivers - enjoy the speeding tickets you'll both get.
- ur-whale 7y ago>how do you know you are not breaking the speed limits? The brainwash is thorough in this one.
- kayoone 7y agoThis is a cool hack but is it really legal? In the EU speedometers have to be carefully calibrated, have strict regulations to pass and your car is not allowed to drive with a broken one. Just replacing it with a, sometimes spotty, GPS signal sounds impossible here. Like, what do you do when driving through a tunnel?
- ImprovedSilence 7y agoDepends on how friendly your local mechanic is?
- gleslie 7y agoNo speedometer required in Texas.
- ur-whale 7y agoYou're lucky to live in a place where government has still, to some extent, been kept in check. These days are long gone in Europe, where the very pace at which you breathe is regulated.
- sk0g 7y agoI'm sure that's not an exaggeration at all, so do you have a source for that claim?
- JensRex 7y agoIn 2013, instead of solving real actual problems, the EU were upset that danish cinnamon rolls might have too much cinnamon in them. The ban was avoided by a reclassification of the product. Stories like this happen with disturbing regularity. Source (da): https://www.mm.dk/tjekdet/artikel/hvad-blev-der-af-eus-forbud-mod-kanelsneglen https://www.mm.dk/tjekdet/artikel/hvad-blev-der-af-eus-forbu... Translated: https://www.translatetheweb.com/?from=da&to=en&dl=en&a=https%3A%2F%2Fwww.mm.dk%2Ftjekdet%2Fartikel%2Fhvad-blev-der-af-eus-forbud-mod-kanelsneglen https://www.translatetheweb.com/?from=da&to=en&dl=en&a=https...
- asadhaider 7y agoI've seen electronic speedometers that plug into vehicle OBD2 ports, and I know you can read the vehicle speed and other data using a wireless OBD2 adapter. Would that not be preferable to this as it'd be a lot more reliable, granted I don't know which cars support them or not but I've seen them working in modern vehicles.
- grosswait 7y agoNo OBD2 on that model that year https://itstillruns.com/retrieve-flash-codes-1994-ford-7501628.html https://itstillruns.com/retrieve-flash-codes-1994-ford-75016...
- paulgerhardt 7y agoIf you’re a fan of these kind of vehicle hacks you may enjoy the infamous “Zero f*cks given RX-7” build by a 4-chaner: https://youtu.be/ZcjpXbMiCtg https://youtu.be/ZcjpXbMiCtg
- kiddico 7y agoThat thing is a masterpiece of modern engineering. Also, the tach labeling gave me a good giggle. edit: I just noticed the multi-meter glued to the "dash". Nice.
- gleslie 7y agoI can’t tell whether I’m offended or proud you thought of this!
- jedimastert 7y agoHoly hell that thing is absolutely terrifying
- pmiller2 7y agoI think I need a tetanus shot and a Xanax after watching that.
- ablation 7y agoA true hot rod. And absolutely lethal to boot, no doubt.
- adrianN 7y agoAre cars like that street legal in the US? I'm fairly sure you wouldn't be allowed to drive that in Germany.
- tssva 7y agoIn the US each state sets their own requirements for what is street legal. Each state also determines their own vehicle inspection requirements which vary from none to annual.
- spike021 7y agoI'd love to build a HUD for my Subaru BRZ like this, but using some kind of HUD. Even just as a speedometer. But I'm not really able to solder/do much wiring since I have hand tremors. It'd be sweet, though.
- naikrovek 7y agoSo just point the screen up at the windscreen and use the reflection as a HUD. You'll need to source a very bright screen for daytime use, just as with any HUD.
- zxexz 7y agoYou could definitely achieve something like that with a solderless breadboard, and a raspberry pi with some breakout boards! Maybe an external USB or HDMI display? I wonder if you could use something like this [0] and feed info from the pi over OBD using some sort of OBDII breakout board or OBDII <-> USB device. [0] https://www.aliexpress.com/item/32966911948.html https://www.aliexpress.com/item/32966911948.html
- tyingq 7y agoI imagine soldering with tremors is doable with some sort of flexible arm set up to hold the soldering iron. Something like this: https://www.fullcompass.com/prod/541073-aladdin-eye-lite-clamp-20-flexible-arm-with-clamp-for-eye-lite-led-fixture https://www.fullcompass.com/prod/541073-aladdin-eye-lite-cla... I did a lot of soldering as a microwave tech, and used a setup like that just for convenience. I have to have a magnifying glass on a similar flex arm because my eyes are so bad. I suppose there are still some hard parts, like trying to use braid to remove solder, but I bet you can do it. I have a 1991 Mitsubishi Galant VR4 that has a place in my heart that your Subaru seems to have. Cool family compact with 4WD and 500 oversized, at the wheels, turbo HP.
- gleslie 7y agoIt’s probably easier than you think. I bought all plug and play stuff for the RPi, and car wiring is thick gauge and easy to handle.
- oh_sigh 7y agoProblem is you can't tell your speed in a tunnel. I propose training a ML model to be able to estimate the distance a camera moved between two input images. You could probably use google street view as training data. Then, instead of relying on fancy satellites, its just a few billion numerical calculations.
- gleslie 7y agoYeah - I put this together in an afternoon.
- gsich 7y agoThere are chips for that (dead reckoning).
- lolc 7y agoWithoug a speed sensor, dead reckoning is really hard.
- Someone 7y agoI would think Google street view data of tunnels would be a challenge to train on. I’m not aware of standards for distance between lights, and apart from that, they tend to be fairly dark. Also, overtaking often is forbidden inside tunnels, so you can’t easily use the size of road markers, either. Even if that works, doing sensor fusion with a gyroscope and an accelerometer probably is both easier and cheaper.
- joshu 7y agoDoesn't the raspi eventually shit the SD card if you just drop power?
- gleslie 7y agoHasn’t yet but yeah, I’ve had that issue before with the arcade I built. I just take an image of the card every significant change.
- slicktux 7y agoIs Navit necessary for attaining speed?? Or can one get speed with a geometric formula and GPS data?? Albeit having navit running is nice but would be nice to make a simple LED display of speed instead ;)
- jrockway 7y agoYou don't need to do any geometry. Your GPS module will simply output the speed. While you can calculate based on position fixes, it is more accurate for the GPS to do it. It does not do a simple distance/time calculation but can instead look at the phase / doppler shift of the GPS signals. This ends up being much more accurate.
- slicktux 7y agoThanks for the reply; did not think about that and after all that is the crucial characteristic of what allows GPS to work: now does it depend on the GPS module? Or can phase and Doppler shift be accesses regardless of the device?
- dvdbloc 7y agoEvery consumer GPS receiver I have seen and even some aerospace-grade receivers that I have (limited) experience with report data over a serial connection as “NMEA sentences”. You can read about them here: https://www.gpsinformation.org/dale/nmea.htm#nmea https://www.gpsinformation.org/dale/nmea.htm#nmea if it’s a USB GPS receiver, it’s likely internally a USB->serial chip with a GPS receiver communicating over serial. The data that I have seen is always been high-level focused on navigation such as speed in MPH and heading in degrees and of course, long and lag. Not to say that you can’t find a device that reports phase and Doppler shift, this is just how everything I have seen worked. When GPS receivers started getting cheap when I was a kid, I was very excited to experiment with them using Arduinos, etc so hope this helps!
- slicktux 7y agoThank you for the information! I will be giving this a read! Can’t wait!
- 3fe9a03ccd14ca5 7y agoReally cool hack and fun idea! Some ideas if your only goal is to get a speedometer. Firstly, ditch the pi and use something with much less power usage, such as an ESP32 or Arduino or STM32 whatever. The Pi uses a lot of power. Then use a GPS IC such as the Neo 6M[1], which is cheaper and less power usage than a USB GPS dongle. The point of having a low-power SoC is that it can stay on while the car is powered off, taking a GPS sample every 10 minutes or so, so that when the car powers on it can very quickly get a lock. The Neo 6M also keeps a memory of the last location which helps it get a lock quickly. https://create.arduino.cc/projecthub/ruchir1674/how-to-interface-gps-module-neo-6m-with-arduino-8f90ad https://create.arduino.cc/projecthub/ruchir1674/how-to-inter...
- oh_sigh 7y agoEven relying on GPS is overdoing it. Paint a white stripe on a tire using a permanent marker, and then mount an IR emitter and phototransistor in the wheel well. Knowing the diameter of the tire and the time between revolutions lets you easily figure out speed.
- 3fe9a03ccd14ca5 7y agoGreat idea! But I think this is harder than GPS because the chip simply spits out speed and direction.
- pugworthy 7y agoThis would be interesting to have in my old MG Midget. The center radio console is essentially wasted space, with a 4”x7” speaker grill that could be replaced with a nice monitor. Not sure if I need navigation in it but I’d love to instrument the heck out of the old car.