What would be an efficient way to reshape a car's injector pulses to digital 0-3.3V pulses, so a microcontroller can count and time them? The waveform can be seen on this page under "Example waveform".
This question might be considered a duplicate of Efficient spike detecting Microprocessor or DSP architecture but none of the answers is really clear for me. I wonder if the transistor solution works with Vb >> Vc. The flip-flop solution misses the voltage scaling stage.
Requirements:
- the circuit must present a high impedance to the coil (arbitrarily set at > 1Meg)
- must correctly detect pulses between 5 and 150Hz
- should survive common faults (wire disconnected and reversed polarity)
Assumptions:
- voltage spike amplitude is not constant, and can go anywhere from 30V to 120V (again, somewhat arbitrary).
- voltage spike duration is not constant, and can go anywhere from 200us to 4ms (again).
- Processor is likely to be an Atmel SAM D20 or D21 (3.3V).
- Supplies available: automotive 12V, not regulated; 5V, regulated, 3.3V, regulated.
- the microcontroller has edge-triggered interrupts and input-capture mechanisms
A solution based on the signal levels instead of the spikes could also be acceptable, assuming that it works with a high voltage anywhere between 9 and 16V.
One simple solution would be a 1Meg resistor in series and a 3.3V zener (or even a 3V one, or maybe a shottky diode to Vcc), but the high-value resistor (and thus low current) means that we're in an area that is often overlooked in diode datasheets. In a previous case, I had conduction in an IC's protection diodes, causing incorrect behavior in other parts of the IC. I'd like to make sure that this doesn't happen. I'm also not sure whether the input-compare can deal correctly with such an high input impedance.
Thanks