From analog to digitial tach

My boats analog tach failed the other day (actually it is the third unit that fails) and I was thinking to replace it with a digital RPM indicator (possibly using 4 7-segment LED's fitted inside the original tach housing). For this I would much appreciate some advice on the interface to the engines ignition system.

The original analog tach connects to the negative side of the coil and uses induction to create a voltage proportional to the ignition frequency/engine RPM which drives/positions the gauge needle.

The ignition signal looks as follows:

Imgur

At time t1 there is a 10 kHz voltage waveform that starts out at 200V and settles between 40V and 50V after 1ms. At time t2 the spark extinguishes and we get a sudden change in waveform. This signal peeks at around 60V and settles at the voltage output from the alternator (14+ volts). Frequency is now 2.5 kHz.

I would like to condition this signal in such a way that I reliably can capture above as a single digital pulse on an Arduino IO pin. The circuit I envisioned would be as follows:

http://www.flickr.com/photos/40341629@N08/3705436664/in/photostream/

The signal coming from the coil is rectified by the diode and passed on to a 10/1 voltage divider (range of 20V to 5V). The capacitor is added to stabilize this voltage at around 5V. To be on the safe side, I also added the zener in order to limit the voltage to a maximum of 4.9V. Basic idea here is to produce a sharp rising edge at t1 that stays high until sometime after t2 when it starts to slope down below the digital high threshold (I will be measuring elapsed time between the rising edges of successive pulses).

Analog circuitry however is not my strong side so I wonder if above is viable. And if so how would I size the capacitor such that I avoid reading the primary/secondary waveforms on the arduino input pin.

Any thoughts would be much appreciated.

Your circuit has potential (no pun intended) but you've positioned your 4.9V zener backwards. And frankly with that zener there and the 100k resistor you don't need the 10k resistor. The 100k resistor will limit the current (only 2mA at 200V) and the 4.9V zener will clamp the voltage so you should be fine.

On the capacitor sizing issue, your 100k/0.1uF resistor form an RC network with time constant of 10ms, fairly long given the timescale you're looking at. As a lowpass filter, that's a cutoff frequency of 16 Hz, thus you'll be filtering out your 10kHz waveform. I'd go with a much smaller capacitor (0.1nF?)

Your 10:1 division is way too small: you'll get at least 2 pulses (probably several) per spark. I'd go with at least 50:1 (remember that the actual "logic high" threshold is about .6 * Vcc: around 3V).

I also second RC's warning about the capacitor size.

Your input signal is going to have a relatively long (by digital logic) rise time. You might need to condition it using a comparator with hysteresis to square it up.

Ran

Thanks for the advice.

I'm beginning to think that this is not a viable way forward. As pointed out, the 10ms time constant is too long. At 5000 RPM, ignition will fire every 4ms on my engine (V6 4-stroke) and as is - the interface circuit may filter away both waveforms without ever reaching logic high. If I reduce the cap down to 0.1nf, the RC time period is as low as 10 micro seconds and although this will transform to logic high already on the first rising edge after t1, I expect the circuit will oscillate around the logic high/low level and likely trigger multiple pulses on the arduino digital input pin. Resizing the cap will only shift the oscillation point in time, but not solve the issue - right?

Perhaps a digital filter approach is better. Lets say I remove the cap from the circuit and adjust the voltage divider to give me a logic high close to time t1 (e.g. at 150V). I should then be able to capture the low to high transition on the first rising edge from the coil waveform. On the first pulse I would record the time, but ignore subsequent pulses for the next couple of milliseconds. For subsequent ignition cycles, I would calculate the time lap from the previous first edge and calculate RPM accordingly.

Do you see anything wrong with the digital approach? (I may keep the zener in case the ignition pulses peek at higher values than they're supposed to).

At 5000 RPM, ignition will fire every 4ms on my engine (V6 4-stroke)

I'm interested, but not very good on engines - could someone explain the arithmetic there, please?
5000rpm is 83.33Hz ... and then it all goes hazy :frowning:

On 4-stroke engines, each cylinder will fire every other RPM. So for a single turn of the engine half of the cylinders will fire. If we multiply your 83.33Hz (5000/60s) by 3 and take the reciprocal we end up at 4ms.

1/(CylinderCount*5000/60s/2).

I think a combination of analog and a digital lock-out time after the first pulse might work. Here is the circuit I simulated:

And here are the simulation results:

A lockout period of 0.5ms after the initial pulse should be good enough (though I guess it can be as long as you want).

Circuit values were arrived at through the time-honored technique of "fooling around".

Thanks a lot - I'm overwhelmed!

Now it's down to making more subtle decisions - such as deciding whether to use red or blue 7 segment led's. :slight_smile:

The tach signal has a separate ground path so the circuit may be somewhat less challenging than your simulation suggests and perhaps the XD3 will not be needed?

I'll go ahead with a prototype to verify that the signal is indeed what we think it is.