[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.
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 :/
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?