Well, since I speak both analog and digital as my dual native languages....
The circuit you propose looks OK on the surface. You are using an op amp in a comparator mode, and as your inputs are greatly larger then any offset voltages it should be stable, so no other parts needed. A brief look at the data sheet make it look like a good choice (my real concern would be are you paying too much for it, you don't need a very refined pricey amp here).
I am assuming you do not have an oscilloscope to check things (or you would have mentioned what you've seen). I would be interested in how sure you are of the sine wave input, if the DC level changes from what you think it is then you would see the symptom you describe.
One thing to try is to make the sine wave make it's own DC reference: on the left side of your schematic you have a brutally locked in DC divider (10uF is huge for that app). But given your 10K R4 and your 10uF C3 then toss out R7/R5 and replace V1/+5V with the sine wave: this is then a low pass filter that gives you the DC level of the sine wave, and will track slow changes too (it has a cut-off of about 16 Hz).
You don't show any power supply bypassing, be liberal with some 0.1uF ceramic caps and try to sprinkle one on every component IC, especially the PIC and the op amp.
Bookmarks