Suggestions for testing a magnetic tach sensor.

roarkhen

Active member
Full disclosure: This is my first project on the teensy, so very new to micro controller land. I am an experienced software guy though.

I'm developing a twin engine panel (for a boat), that displays oil pressure, water temp, voltage, and rpm from engine sensors on a 7" TFT via a teensy 4.1. I currently have the pressure, temperature, and voltage parts working on the bench (temp in hot water pan, voltage from battery, pressure rigged to a 'T' and bike pump).

However, I'm at a point where I need to develop the code for the rpm sensor. It's (as I understand it) a magnetic pickup sensor that counts the teeth on the flywheel as the engine runs. I believe it sends increasing voltage pulses down a two wire connection to the existing tachometer.

Since I'm a couple of states away from the boat, I'd like to get the code working for the rpm gauge(s) before next season. I'd like to setup a bench test that would emulate the rpm sensor to allow for me to create and test the code.

Looking for some advice/guidance on what I can use to simulate this? Would a hall effect sensor effectively do the same thing? Meaning would the code be roughly the same except for some minor change to variables, ie. the number of pulses to rpm? Anyway, just hunting for some ideas from the mind share here...

Thx in advance. Here's a pic of the sensor out of the manual. This is an old motor (yanmar 2gm20fc) by the way.
 

Attachments

  • Screen Shot 2022-08-02 at 2.34.27 PM.jpg
    Screen Shot 2022-08-02 at 2.34.27 PM.jpg
    82.9 KB · Views: 59
However, I'm at a point where I need to develop the code for the rpm sensor. It's (as I understand it) a magnetic pickup sensor that counts the teeth on the flywheel as the engine runs. I believe it sends increasing voltage pulses down a two wire connection to the existing tachometer.
A variable reluctance sensor (commonly called a VR sensor) is a transducer that measures changes in magnetic reluctance.

Interface circuits
VR sensors need waveform shaping for their output to be digitally readable. The normal output of a VR sensor is an analog (AC) signal, shaped much like a sine wave. The frequency and amplitude of the analog signal is proportional to the target's velocity. This waveform needs to be squared up, and flattened off by a comparator like electronic chip to be digitally readable. While discrete VR sensor interface circuits can be implemented, the semiconductor industry also offers integrated solutions. Examples are the MAX9924 to MAX9927 VR sensor interface IC from Maxim Integrated products, LM1815 VR sensor amplifier from National Semiconductor and NCV1124 from ON semiconductor. An integrated VR sensor interface circuit like the MAX9924 features a differential input stage to provide enhanced noise immunity, Precision Amplifier and Comparator with user enabled Internal Adaptive Peak Threshold or user programmed external threshold to provide a wide dynamic range and zero-crossing detection circuit to provide accurate phase Information.

I did use NCV1124 from ON semiconductor on Teensy 3.0 once.
greenhulk.net/forums: Oval MFD #3280252 voltage range of the AC RPM signal on the Yellow wire ?
 
Thanks Chris for that info. That NCV1124 looks good for my setup. I was curious about the 1.2 ac nomenclature on the diagram, now I understand. I like what you did on that ski console!

So, given that I implement the NCV1124 in between the mag sensor on block to the teensy. I still have the conundrum of what to mock up for a bench test of this stuff? Any suggestions?

I know I could rig up a Hall Effect sensor and magnet on small fan, and an ISR routine in code. That would get me part way there. But, I'd like to test the NCV1124 on my board sooner rather than later :). What can I use to drive the ncv?

Thanks again!
 
So, given that I implement the NCV1124 in between the mag sensor on block to the teensy. I still have the conundrum of what to mock up for a bench test of this stuff? Any suggestions?
You can use old stepper motor from old printer or floppy disk drive head track position and cordless drill:D
Only use the two wires out of the four on stepper motor.
 
I finally got around to trying the NCV1124. I moved from a breadboard to a prototype board. I'm getting sporadic results.

I've wired up the 1124 with 5v to vcc pin 8, gnd to pin 4, stepper to pin 2 (in1), pin 7 (out1) to teensy pin 4, other stepper wire to gnd.

The input pulses are all over the place. sometimes nothing. sometimes if I touch the wire at either the ncv1124 or at teensy I get some pulses. Sometimes It works ok (meaning running the stepper produces pulses).

I think I have either a bad solder connection, but it ohms out ok all around. The other thought is I'm supposed to do something with pin 1 (INadj) on the 1124? Edit:(I just looked at your schematic Chris. You have that pin pulled to ground w/ two 10k resistors?). Maybe that pin floating is causing a problem? I'm not really sure.

To completely embarrass myself here's a pic of the board top and bottom:
 

Attachments

  • proto.jpg
    proto.jpg
    257.5 KB · Views: 31
  • protoBtm.jpg
    protoBtm.jpg
    265.3 KB · Views: 29
  • NCV1124.jpg
    NCV1124.jpg
    174 KB · Views: 27
Last edited:
Do you have a pullup resistor on Teensy pin 4? The OUT1 pin of the NCV1124 is an open-collector output so Teensy pin 4 needs a pullup to 3V3.

Capture.PNG

Or use "pinMode(4,INPUT_PULLUP);".

Paul
 
I noticed I had a bit more than 4v on OUT1. I put a small divider on it before going to teensy to bring it down to 3.3v. I notice that when I pull the trigger on drill, that the voltage goes from 3.3v to 1.5ish. Then stays at that voltage unless I let off, which it then goes back to 3.3.

I don't get any pulses on the teensy. Does it matter whether I trigger on RISING or FALLING? I would think it wouldn't?
 
Well, it works now. I get 0 to ~2800 rpm off the drill driving the stepper motor! Thx for the help. I can't wait to hook a scope to this to make sure it's doing exactly what I think. Next big learning curve is moving this from a proto board to a real board. I'm playing with KiCad, Fritzing, and Diptrace. Have no idea what i'm doing but its fun!

Thx for the help, i really appreciate it.
 
Back
Top