gps analog speedometer

Hi Everyone

Im new to programming and want to learn more.

Im looking at replacing the cable drive in my speedometer and was going to place a hall sensor to pick up the incoming speed from the cable then use arduino and stepper motors to control the milometer and speed reading.

Then i thought could i replace the cable drive altogether and use gps to calculate the speed and use arduino to control the motors accordingly

Thank you all

Ben

How will you know when to change the oil?
I wonder if the car will pass a safety inspection like that, or an insepection where they plug into OBD II or similar for car health analysis.

You can certainly get readings from any number of GPS modules and determine your speed from them, if the speed is not reported directly.

The car is from 1960 so the most advanced thing is the radio. So as for obd and anything else that needs a speed signal they do not exist on this car.

I see no reason to worry about this. While a GPS positional report can be off by 10 - 15 feet, the error is due mostly to slow ionospheric variation. Near any one spot, the positional readings will all have almost the same error.

So what that means is that readings of speed, using positions taken a known time apart, are very highly accurate.

ullisees:
Hi Everyone

Im new to programming and want to learn more.

Im looking at replacing the cable drive in my speedometer and was going to place a hall sensor to pick up the incoming speed from the cable then use arduino and stepper motors to control the milometer and speed reading.

Ambitious.

Then i thought could i replace the cable drive altogether and use gps to calculate the speed and use arduino to control the motors accordingly

I don't know: would it be able to respond quickly enough to changes in speed? I mean: if you floor the accelerator or the brake, how many seconds until the GPS notices what is happening? You want to know your speed right now, not what it was a moment ago.

Also, note that it makes a colossal difference what software you use. The Arduino is not really built for keeping track of numbers with as many decimal places as you probably require for a position measurement. It can be jerry-rigged to do this, but you have to know exactly what you are doing, and not every software author knows what s/he is doing.

GPS needs a clear view of the sky. Doesn't work in tunnels, unreliable when surrounded by tall buildings.
At startup the "lock" time can be several seconds during which you will have no speed data.

GPS modules can output at up to 20 Hz rate. If limited data sentences are being sent out at a faster rate, updated speed should be able to be calculated pretty quick.
https://www.sparkfun.com/pages/GPS_Guide
Maybe upgrade to a Teensy if processing speed is too slow.
Add an IMU type unit (accelerometer/other) to track speed changes when GPS is temporarily lost.

Ok so to use gps would not be a good way to go.

So what im trying to replace is a magnet that spins next to a aluminium disc. Due to the lenz affect the disc turns and that shows you the speed on the face.

So is i was to keep the magnet and replace the disc with a hall sensor and arduino could i get this to drive a stepper to display the speed

mikb55:
At startup the "lock" time can be several seconds during which you will have no speed data.

Only "several" seconds?

ullisees:
So is i was to keep the magnet and replace the disc with a hall sensor and arduino could i get this to drive a stepper to display the speed

Maybe better to use a servo than a stepper, I don't know.

I know this might be a basic question but how do i get the arduino to count a pulse and interpret the speed of that pulse to tell a stepper motor where to turn to

I know this might be a basic question but how do i get the arduino to count a pulse and interpret the speed of that pulse to tell a stepper motor where to turn to

Those are two different operations 'connected' by software.

I'd suggest working on the input & output separately. i.e., You can start with reading the speed and sending it to the serial monitor. Then write the code (and connect the electronics) to show a pre-programmed speed with the stepper motor (totally under software control with no actual speed sensor). When both of those test-programs work, combine the code.

If you can get a pulse that's proportional to speed, you can find the appropriate factor and multiply or divide to get the speed. You'll probably need to calibrate (or confirm) that setup by having someone drive at a known speed along side you.

With a stepper motor, there are typically 200 steps per revolution (1.8 degrees per step) so it's a matter of finding "home" (zero-speed in this case) with an [u]optical sensor[/u] and then counting the steps (back-and-forth) from there.

BTW - I've had a Garmin navigation unit for a couple of months and it shows my speed. I haven't used it that much (I usually know where I'm going) but I'm not sure if it responds quickly enough to be used as a speedometer. It might be OK when you're driving at a constant speed no the highway, but when you accelerate up to (or slightly over :wink: ) the speed limit, you want to know when to stop accelerating. Over a period of time, I trust the GPS speed more than my speedometer. I have two vehicles (both with analog speedometers). My Honda's speedometer reads maybe 1/2 MPH slower than the Garmin. I haven't had the Garmin in my van yet, but I think the van's speedometer is about 5MPH "optimistic" and it will be interesting to check that out.

DVDdoug:
My Honda's speedometer reads maybe 1/2 MPH slower than the Garmin. I haven't had the Garmin in my van yet, but I think the van's speedometer is about 5MPH "optimistic" and it will be interesting to check that out.

You don't need a GPS, just mile markers and a stopwatch.

Oh, wait, it's the 21st century. Nobody has stopwatches anymore except as apps on their phone.

You might take a look at this.

Hi,
I don't know where the OP is located, but doing something like this to the odometer could effect the registration/roadworthy condition of your vehicle in law.

Speedo readings up to 10% higher than actual is also legal, in fact here in Australia it is encouraged in the build regulations.

Which leads to an interesting and confusing speed camera ticket they quote permitted, alleged, detected speeds.

Tom..... :slight_smile:

TomGeorge:
Speedo readings up to 10% higher than actual is also legal, in fact here in Australia it is encouraged in the build regulations.

What about the odometer readings?

If you drive at what your speedometer says is 90 km/h for 2 minutes (i.e. 1/30 hour), will your trip odometer go up by 90/30 = 3.0 km, or by some other number?

Besides the possible legal issues mentioned by Tom.
I think Ben's(theOP) idea is a good one.

There are plenty of aftermarket gps speedometer's on the market.
Though there are issues such as start up delay's and loss of signal in tunnels most of the reports I've seen are favorable.

It would be easy to test by using one of the phone app's for awhile to see if
coverage is acceptable in your area.

It has been done and here is one example to get you started : Building a Arduino Digital Speedometer

You will have to figure out how fast to spin the cable to give the correct speed and figure out a conversion factor.

I test old speedometer's with a drill and can control the speed quite well with one so a dc motor may work.

Oh, being an Old Carnut I have to ask what kind of car are you working on?

Hi,

What about the odometer readings?

Just the speedo, odometer accuracy is better.

Tom..... :slight_smile:

Hutkikz:
You will have to figure out how fast to spin the cable to give the correct speed and figure out a conversion factor.

I test old speedometer's with a drill and can control the speed quite well with one so a dc motor may work.

Rube Goldberg would be proud.

odometer:
Rube Goldberg would be proud.

Yes well old car guys are like that , they would rather not trash the original look of their cars if they can help it. and the OP requested it.

here is the (expensive) aftermarket version : Cable-X
which I have installed in several cars for customers.