Hi over Amplify the sine wave and run it through a comparitor Something like this. Experiment with the circuit values to find the best for your application. The adjustment vr1 allows you to set the point that the circuit changes state, from slightly before to slightly after true 0 r2 r5 .--\/\/\/\--.-------------\/\/\/\--. | | | r1 | |\ | | Sine in -\/\/\/\--^----| \ | r4 |\ | | >---^--\/\/\/\---| \ | Gnd -\/\/\/\----| / | >------+---- output r3 |/ .-\/\/\/\---| / | | r6 |/ | | r7 | +---\/\/\/\-----------' | r8 V r9 +vcc ---\/\/\/\----\/\/\/\----\/\/\/\--- -vcc vr1 r1 = 1k r2/r1 sets the gain in this case 100 adjust as necessary r2 = 100k r3 = 1k 1/(1/r1+1/r2)=990 ohm 1k is close enough r4 = 10k r5/r4 sets the gain in this case 10 adjust as necessary r5 = 100k r6 = 10k 1/(1/r4+1/r5)=9090 ohm 10k is close enough r7 = 5m (5000k) r8 = 4k sets trigger range adjust as necessary r9 = 4k sets trigger range adjust as necessary vr1= 4.7k allows you to adjust the trigger point ahead or behind true dead center op1= any op amp, the lm324 comes to mind it is a quad package NOTES: If the input sine wave is large enough the first op amp, r1, r2 and r3 may not be needed r7 this resistor adds positive feed back to so that a noisy signal does not create multiple triggers. Experiment to find the best value. More noise needs a lower resistor r3 and r6 are used to null op amp offset. If absolute precision is not needed replace these resistors with a wire > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Bruce Turrentine > Sent: Thursday, June 25, 1998 7:40 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Zero crossing dection circuit. > > > I am working on an automotive timing circuit that uses a toyota > reluctor pick > up. It's output is a pseudo sine wave that changes in frequency > and amplitude > as the rpm changes. The ideal point to in the wave to send a position > interrupt is as the wave passes zero. I've tried running it > through an op amp, > letting the wave swing from a 5v pedestal, and computing the > midpoint between > the two peaks but this eats up too much time is an "after the > event has come > and gone" solution. Anybody have a suggestion? > > Bruce >