Need help on filtering a signal

Hello everyone,

I'm asking some help from you guys because I'm having headaches filtering a signal coming out from an engine CDI to sense RPM.

Basically I'm sensing the +12v (approx) pulses coming in the spark coil (on the low voltage coil) from the CDI and I managed to achieve a good filtering using diodes, zener diodes, resistors, etc ...



As of today, the signal looks like this.
Noise seems to be lower than +1.7v, which is pretty nice based on what the initial signal looked like + I have a beautiful peak @ +5.1v (which is cut off at this voltage thanks to the Zener diode).

Fact is, as the low voltage part of the coil is subject to EMF, feed-back, etc ... there are sometimes very short negative voltages pulses that runs on the signal line and arrive on the µC (Arduino) sensing pin.
µC behavior is not very stable, sometimes it resets itself, etc...

To avoid this situation, I thought of using an optocoupler (4N38), and it worked on the test environement, but as soon as I'm using the same circuit directly on the engine running inside the vehicle, it seems to be rather different.


Actually, pluging the signal to the optocoupler, it looks like this.
It seems that the voltage get down and is unable to trigger the IR led inside the optocoupler (maybe because of not enough current / voltage / duration / IDK >:( )

I must admit that my knowledge and experience on this kind of signal filtering/analyze/etc is limited, so please don't hit me if I'm making a big mistake there :slight_smile:

Thanks for your help guys

Hi,
Are you using a current limit resistor on the input side of the opto?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

This is a fast pulse, I suspect you are using a slow (ie standard photo-transistor) opto coupler, not one
with a fast photo-diode or logic output.

Have you tried cleaning up the pulse with a schmitt-trigger circuit instead - it might be enough
to drive a 74HC14 or similar schmitt-trigger logic gate?