Stepper motor tachometer /speedometer

I know it has been asked here many times over but I have never really found the answer.

I want to build a speedometer/ tachometer using a switec X25 instrument stepper motor.

found examples of a pot making the motor needle move but never a true up and functioning model

The circuitry for me is no problem.The code is for me is a challenge. I need a starter code that I can use and make minor adjustments from there. Being a stepper it would need to auto zero to put the needle in the 0 position. input frequency is both sine and or 5 volt square wave as low as 165 HZ at 6000 rpm for a tach and as high as 2000HZ for a speedometer at 100 MPH I need 2 separate gauges one tach and one speedo and would like to use the same program and possibly just adjust the parameters in the program. have seen some examples of the Arduino running steppers with the needles jittering and jumping. Not acceptable. needs to be rock solid. The Arduino is capable of driving the instrument stepper. some say still use a stepper driver???. I need a code does, anyone have a good working code. or is there someone that is willing or writes codes. I would not expect it to be done for free,

I want to feed an analog or digital signal into an Arduino and get a stepper motor movement with a minimum amount of parts.

is there someone in the Arduino community that writes programs as a business.

Thanks Dougs

A servo is probably a better option. A servo doesn't step, it knows where it is so it doesn't have to be zeroed, and it comes with a built-in driver circuit.

Being a stepper it would need to auto zero to put the needle in the 0 position.

You'll need a "home" sensor (and possibly a "maximum" sensor if the needle can't rotate 360 degrees). Then, your software will have to rotate the motor at start-up/reset to find zero.

...as low as 165 HZ at 6000 rpm for a tach and as high as 2000HZ for a speedometer at 100 MPH I need 2 separate gauges one tach and one speedo and would like to use the same program and possibly just adjust the parameters in the program.

So, you need to convert the frequency of both signals to speed/RPM? Are you able to do that? It might be tricky to read two frequencies with one Arduino.

What's the voltage? (You can't put more than 5V into the Arduino without potentially damaging it.)

have seen some examples of the Arduino running steppers with the needles jittering and jumping.

Stepper motors have 200 steps per revolution (1.8 degrees per step). That's a noticeable step. You can micro-step, but I can't tell you how to do that with the Arduino, and I don't know if you can micro-step and read the input frequency at the same time since micro-stepping requires extra processing power. (You may run into the same issue with a servo which requires continuous pulses.)

Once the motor is locked-into a step-position, it will be "rock-solid" and won't move/jitter unless your software sends-out a step.

I can totally understand your want (and love!) of analog gauges - but just something else you might want to look at this project linked below. I followed his guide, and quiet simply was able to resize/build my own dash that has analog like properties. the mph ring "sweeps" with analog qualities, and you can also have (or have not!) the digital values. I know its not what you asked, but maybe another road to look at for your project - pretty cheep too.

Hi All

It will be 2 seperate gauges one program per gauge. one uses a 5 volt square wave the other a sine wave the sine wave will generate more than 5 volts I can take care of that in the circuitry.
The stepper motors must be the switec x 25 the software must zero out the needle on power up. and the software must know the steps of the motor for a 270 degree sweep. I can get microstepping with the addition of a driver if needed. I did build a prototype using a frequency to voltage converter and the knob stepper motor sketch. worked ok but had no auto zero and easily got confused with quick frequency changes

Doug

You might take a look at this.
https://www.tindie.com/products/TheRengineer/analog-gauge-stepper-breakout-board/?pt=ac_prod_search.
It also has reference to a stepper library on GitHub.

Hi Doug,

Did you ever pursue this? I'm very interesting in tackling the same task. Restoring my entire dash of 1971 Holden from old broken and unreliable gauges.

Dougsauto:
I want to build a speedometer/ tachometer using a switec X25 instrument stepper motor.

Post a link to the datasheet for the motor.

I think what you want should be straightforward.

I suspect either that the motor has a HOME or ZERO detector or the standard procedure is just to drive it N steps in the HOME direction where N is big enough to ensure it gets to the HOME position no matter where it may start from.

Then you need to figure out how many steps are appropriate for the different angles you want it to move to.

...R

Hi rguid1,
Welcome to the forum!

I was following this with interest also. It seems that Doug ended up paying one of the experts here to finish the code for his project. Fortunately he allowed it to be shared.

You can find the continuation of this thread and links to the github with the code here: Tacho