Teensy + Hall sensor + Stepper motor = working mechanical speedo...

Status
Not open for further replies.

DarkMatter

New member
Hi all, first post on here so be gentle!

Right some background: I am a web developer, I haven't played with the likes of Teensy / Arduino etc before though.

I am currently rebuilding a classic MG Midget with a Zetec engine and want to find a way to drive the original speedo, for those who are not into cars, the older speedos were connected via a spinning cable to the gearbox which transmits a turning motion into the gauge.

As I am putting in a later style gearbox which has no way to connect this, I want to make up a little device that can turn this cable electronically.

So my plan is:
- Hall-effect sensor somewhere on one of the wheel hubs with a magnet on (for example) the brake disk.
- connected to a Teensy (how?)
Given I can calculate the speed from the rolling radius of the tyre, I can instantly know the speed of the car in code.
- Teensy then drives a stepper motor at a speed (speedo input rpm to displayed speed will need to be investigated, but it is linear)

So, What I need is to:
A: Get the Teensy to accept a signal from a Hall sensor.
B: Figure out the current speed in code
C: Figure out what speed the stepper needs to be spinning
D: Power a low-power stepper.

I can of course adjust the measured road speed to stepper speed calculation as needed, but first I want to see if this is feasible and what I'll need to get going.
I could actually use a variable resistor to change that on-the-fly, to tune via GPS.

Voltage-wise in the car it will be variable as engine off will be about 12.5-12.8v and running will be around 13.8, so I will probably use a 5v output regulator (a USB car charger circuit for example)

The aim is to build this into a small box that can be mounted in the dashboard or even better (if small enough) into/onto the gauge itself.
 
Last edited:
Hi and Welcome

The overall project is certainly achievable, but cars are a very hostile environment for electronics due to the power variations so that may take some work to get things running stably.

A. hall effect sensors are normally easy enough to interface, especially with just one, you probably want the freqmeasure library: https://www.pjrc.com/teensy/td_libs_FreqMeasure.html and some input signal condioning to keep things clean
B. if using the library easy enough, otherwise you do things like wait for pulse, time to next pulse or stationary time out, average a couple of times and convert time to rpm to distance
C. depending on how fast this needs to be you may find a stepper cannot achieve the needed speed, possibly end up needing a DC motor with it's own pulse per RPM counter and code that drives PWM up/down to match needed speed.
D. Stepper power can be tricky so make sure you get a good driver if using one, preferably from a supplier who offers examples with code to test with.
E. suggest at least version one of this rig include a LCD of some sort to show what it thinks is going on - makes fault finding in car much easier.

Other options here depending on how you want to do this, does your engine management harness have a gearbox output RPM in it? The new engine probably has a hall effect sensor setup already you can snoop on, or look at the outputs from engine management for a speedo signal and read that via Teensy. Would be cautious adding a random weight to a sprung part of the car, and getting the signal back from a weather exposed and moving location will take work.

With the actual speedo, inside it is probably a generator driving a volt meter - you can probably direct drive the needle using PWM and a driver transistor for much higher precision, though do check the design to limit current at 100% duty cycle to something that will not blow the wiring.
 
Thanks for the reply,
Ah yes the freqmeasure library looks spot on for my needs.

Regarding the stepper itself, your point had actually crossed my mind, I will need to find out what the input speed is at the max reading and go from there.

I'm not sure if the box has an output speed sensor, that would be ideal, it has 2 definite electronic "things" on it, one is definitely a reverse light switch, the other could be a speed sensor, temp sensor, or just a neutral switch - must investigate.

To your last point, im not exactly sure how they work, but they are purely mechanical, no power is needed to show a reading.
Another reason that I want to run the mechanical input from a motor is that it also powers the odometer
 
Re finding out what shaft speeds you need may be informative to build a proof concept hall effect sensor on a the speedo input and spin the shaft with a drill or similar and see what you get.

An electric speedo could work purely on mechanical input if the shaft is generating electricity, though there are presumably centrifugal ways to do get rate information into some form of fixed deflection. Regardless if you want the odo to work then some form of rotary drive will be needed.
 
Hi,

I have several vintage British motorcycles and am somewhat familiar with Smiths tachometers and speedometers. There is often a calibration number printed above the "mph" on the face of the speedo indicating the input shaft rpm corresponding to 60 mph. I believe that 1152 is common for many British sports cars of the 60's and 70's.

Here's a link to a doc that does a pretty good job of explaining how these speedometers work and how to calibrate and repair them: http://obswww.unige.ch/%7Ewildif/cars/docs/Smith-jaeger_speedo_repair.pdf

Hope this helps, sounds like a fun project.
 
Completely off topic but, @ dgranger, thanks for the link - really clever (and cheap) way to get rotary motion into deflection with magnetic coupling like that, and the author's method to calibrate the speedo with a drill by first using it on the tacho to determine drill RPM is pretty clever to.

Not something amenable to conversion to digital drive without pretty much gutting the internals though so looks like motor drive may be the way.
 
Status
Not open for further replies.
Back
Top