[Note: the initial text of this thread was edited]
I'm trying to do the simpliest circuit possible for muting tpa class-D amp boards (tpa3118, 3116, and so) in the absence of input sound/music - yeah, a workaround to avoid that hiss background sound. I readed a lot of stackEx questions, and isn't hard to achieve that with proper signal (+0.7v). But found almost nothing that works for very low voltage signals. I don't want to detect a specific frequency or pwm, my goal is detect any music frequency (20hz~20khz) audio above +-2mV (or 5mV, at least).
For making the circuit, I have both 5v (isolated) and 21v (5s) lipo-power WITHOUT GROUND available (plastic chassis - only if I make the "virtual ground").
My input is a bluetooth headset, what delivers no more than 300mV. My intention is detect 5mV and below signals - to catch even signals streamed in low volume by cellphone to the bt headset.
The "whole thing" looks like this:
Note that the mute positive (always 6.9v) and audio negative are with "?" because maybe they don't need to be used.
I mapped 2 main approachs: opamp and arduino.
On arduino, I would be able to clip negative voltages (to not damage analogInput) OR dcBias the audio, and detect a resolution of almost 5mv (5v/1024). A script could be runned to detect variations above and below reference (2.5v), and do the desired mute action (sending a H signal from arduino to mute pin of tpa board, i.e.).
But would be interesting doing this only electronically. Seems so obvious that I'm deeply distressed about it. With an opamp what amplifies the soundwave amplitude like 500 times, a 2mV signal (now 1v) could make a bjt transistor to work. The complementary circuit would be a capacitor-resistor-zener one, to limit the output voltage (for the reading) and make a "buffer" of the sound peaks (slower switching).
Based on Bruce Abbott and Tony Stewart answers, I (we all) got nice suggestions of opAmp circuits to it.
My "dream" simpliest circuit for achieving this objective: "Dream circuit".
The led emulates mute negative pin draw. With ground, works as intended. Using virtual ground, all the circuit oscillates, and the cap "got drained", not holding his charge. It's another simulation error (read more about Falstad circuit simulator below)? Or it's "right"? Of course, why this occurs is trivial for who knows, but unfortunately, not to me :/
Now I'm in doubt if the Falstad nice'n-easy javascript circuit simulator (www.falstad.com/circuit/circuitjs.html) is faulty on "real opAmps" or not. Maybe it's just a ground or "virtual ground" thing, as we'll see below. The fact it's I'm unable to achieve, in the simulations, the results of an ideal opAmp with a real one, on lipo power. All what I got is the output voltage of the soundwave equal in mV to input one, not amplified like I want - the "wave voltage fluctuation" of the output is equal of the input.
After Bruce and Tony valuable feedbacks, two important questions appeared:
1) I'll need to use audio's negative? (Isn't a problem, but note by my above draw that are two "different" powersources); and
2) I'll need to add "virtual ground" to the circuit? Or I'll need to achieve the "ground function"? How? From my simulation above, seems I'm unable to use "virtual ground" in the idea.
In mine main idea, and also in Bruce's answer, only "positive" of the audio is used.
[Please correct me if I'm wrong, but in the bluetooth headset outputs, only the "positive" will conducts the soundwaves and the (positive and negative) voltage, right? In multimeter readings, comparing with a ground, the audio negative didn't showed any voltage.]
Also, in Bruce's circuit, the negative pole of the battery is "grounded", what, from my point of view (probably wrong one), makes it equal to ground. That's why I simulated the circuits "without ground", Tony.
I simulated Tony's answer circuit without grounds and powered by a 5v batt. Worked ok, thank you very much. BUT, simply by removing the noise source (dragging aside, and even if untoggled), the circuit FAILS in simulation. I tried some arrangements with resistors values, tried to add some diodes and caps, to rebalance the circuit, without sucess. In this scenario, would be impossible to add my unipole audiosource. And using the negative from audio, if needed, deserves some attention, to not burn (another) bluetooth headset with the returning current.
Bruce's circuit what Tony adapted from my simulation also looks terrible without ground. And with ground, doesn't seems to work 100% as intended. I just didn't abandoned Falstad's simulator yet because it's sooo intuitive...
Also I got LTspice, Multisim (web - National Instruments), and TINA (Texas Instruments). But they use and simulation aren't intuitive, and some basic components needs to be specified/imported, what makes it more difficult yet.
Besides nice Bruce and Tony answers, looks that I still need advices, both on grounding issue (plastic chassis) and on "real opAmp" issue (on Falstad simulator with 5v batt, it basically "forwards" 80% of Vcc received, completely out of the expected).
Ideas? Suggestions? Tip of any working web "real opAmp" simulator?