Automotive alternator: zero crossing detection (frequency)
using an op-amp as a comparitor often ends badly, some op-amps (not OPA340) can be damaged by this. and performance almost always suffers.

no you won't have 0V out the negative half cycle if you are comparing with automobile ground, only while that phase is less than automobile ground (1/6 cycle) that's probably enough.

the simplest solution is a 100K resistor to a the logic input (or Schmitt gate)  and just rely on the protection diodes to clip the over voltage - 150uA is most unlikely to damage anything, de-glitch in software 

that will give you about 1/6th of the cycle low and the rest high.







simulate this circuit &ndash; Schematic created using CircuitLab

if you add  a series capacitor will auto bias via the protection diodes and give about 50% duty cycle 

this seems good, but the automibile is a surprisingly rough environment for electronics, load dumps and altenator faults can prioduce spikes of hundereds of volts

so add a transistor to buffer the current instead of letting it reach your logic a small transistor can handle tens of milliamperes base current so fault voltages over one kilovolt will be safely handled with this setup.







simulate this circuit

the diode handles the current for the negstive half cycle and the capacitor allows the bias to self-center giving approximately 50 percent duty cycle. at the output.