I have a circuit like this:
The part on the left generates AC signal. The part on the right detects whether AC is running through the branch when S1 is closed. I use a resonating LC circuit which is tuned to the frequency generated on the left. This induces AC which is then amplified by the op amp and read by the scope.
There are some limitations to what I can do, hence such a complicated detection of a switch. Don't try to improve that, everything works fine and I'm getting what I need. But only when the left and right parts are on a different battery! When I connect them together like you see here, I'm getting a constant AC sine signal of about 20mV even when S1 is not closed. This is about 80% of the signal I'd ideally receive so it dramatically decreases my resolution. When I connect my scope to the + and - in red section though, I don't see any ripples or fluctuations (or perhaps they are too small, my scope has only 20mV sensitivity).
The problem IMHO is that a small AC is somehow spreading through the circuit and making the detector coil resonate when it shouldn't. When I split the generator and detector parts and put them on a separate battery, everything works fine, hence I assume this is not happening due to some wireless transmission.
When I remove the C2 cap, the coil stop resonating and the parasitic signal disappears (along with what I want to see, of course). When I remove the coil itself, the signal disappears too. That's why I'm assuming this is caused by an unwanted resonation.
Do you have any ideas how to get rid of this? I really can't have it on two batteries, it must be just one. (I tried putting caps – large and small – across the power source, across the generator branch, and to various other places of the circuit to smooth the DC, no luck.)