High Level Speaker Signal Output into ESP32/Arduino

TLDR:
I want to get a Signal from the speaker output of an Amplifier into an ESP32 to process it for a VU meter and visualization stuff. How? What About the high level?

Long Version:
I bought an 100 Watt Bluetooth amplifier (Fosi Audio ZK-1002T) and I want to tap into the Audio-Chain at some point to get a mono or optional stereo signal from the audio to process it for visualization in an LED Lamp I built. The Amp has line and bluetooth inputs and no headphone outputs, only high level speaker outputs.

Of course the easy way would be to just split the line input of the amplifier and get that into the ESP32. I saw some tutorials on line input to Arduino. Seems to be no big problem.

But then I would totally miss every signal that gets over the bluetooth into the amp. I would love a way to get a signal no matter what input I choose.

Most logical to me would be the speaker output.

Problem there is speaker outputs are high level and probably up to 100 watts (hence the 100 watt amplifier) but I am no expert in audio signal processing. My guess is the ESP32 would just start to smoke if I input the signal right away.

Do you have an idea what I can do to get the signal into the ESP32? Or if I miss another way to tap into the audio stream before the speaker output? Maybe I can grab a signal somewhere on the Amplifier.

Thanks in advance.

PS: Further question. Does anybody know how a speaker signal behaves if you just split the output? Does it lose power? Will the speaker be less loud? Sorry again - no expert in audio electronics.

hrm... you might be able to get away with something like this circuit.. perhaps swap out the resistors for potentiometers so you can get fine-control of the signal levels
opto-isolated

As always.. be sure to measure the circuit's oputput to the ESP32 OI BEFORE hooking it up to the ESP32
(also.. i can't remember.. is the esp 3v3, or 5v? adjust accordingly XD)

That sounds very promising. Thank you very much @ArcAiN6 . I will try that.

best of luck

What do you have connected to the speaker output of the amplifier? That is important for calculating the peak output voltage to your circuit.

By the way. ESP32 runs on 3.3 V as you mentioned.

@herbschwarz Oh okay, thats interesting. I have two passive speakers connected. They are quite old and I am not really sure about the impedance, since I cant find anything on the Chasis. But I think its 4 Ohm.

It is important to know that load impedance not only for your circuit but also for the proper operation of your amplifier. Some solid state amps do not respond well to loads of less that 4 ohms or greater than about 8 ohms. Two 4 ohm speakers connected in parallel present a 2 ohm load. Be careful of that.

Sorry I think that was a misunderstanding. Two speakers stereo so two outputs - one speaker each. I dont think that counts as parallel.

By the way I looked it up. The speakers are indeed 4 Ohm.

An opto-isolator is completely "safe" but they are not linear.

You need a voltage divider (2 resistors) and a protection circuit to protect against negative voltages. It "wouldn't hurt" to also protect against "unexpected" high positive voltages. The protection circuit requires a current-limiting resistor but the voltage divider can also serve that purpose so it's just one or two diodes.

Another handy circuit is a peak detector (if a peak meter is OK). Otherwise you are "sampling" a waveform (or half a waveform) and you'll have to find the peak, average, or RMS, in software.

The basic power calculation is Watts = Voltage x Current. But it can also be calculated as
Watts = Voltage squared / Resistance.

So, 100W into 4-Ohms is 20V RMS = 28V peak = 56V peak-to-peak.

The resistance of your voltage divider isn't critical... It's the ratio that's important. But the resistors should be high-enough that they don't dissipate too much power and burn-up. The resistors can sum-up to around 10K and everything should be fine.

You probably will need a pot (or something) unless you want the "top" of the meter to always represent 100W.

I made a "giant VU meter effect". It works at audio line-level and it's just a visual effect and totally useless as a "meter". The software automatically and continuously (slowly) adjusts so the top of the meter is about the maximum. I can adjust the volume or play loud & quiet songs and I always get lots of "meter action".

My World's Simplest Lighting Effect has two concepts that you might want to copy - It finds the waveform peak every 50ms and then it calculates a 20-second moving average of peaks so it can automatically adjust the sensitivity.

My real-world effects us another "trick" of switching to the 1.1V ADC reference with low-level signals but I don't know if the ESP has that. (The lower reference also doesn't work with a biased input like I use in the Simple Effect example.)

Well if the amp is 100W maximum mean power into 4R the maximum rms voltage at the speaker output should be ~20 volts or ~30v peak. What you then need is an potential divider to divide that down to a safe voltage for the arduino which would be say 1v peak. So a 1 k to ground fed through a 27k to the amp output. That would be ground referenced so then a coupling capacitor to an analogue input with a bias circuit to put it at half rail. So actually perhaps 2 2k2 resistors in series, one end of one to positive Arduino rail the other to negative with the 27k connected to the junction through a coupling capacitor - probably 10 microfarads would do it. Standard audio practice. Make sure the amp ground and the Arduino ground are connected.

I also found this:
Speaker to Line
Might this be an easy way?

Exactly as I suggested except a DC block capacitor is needed to connect to an Arduino analogue input amnd something to bias it at about half rail voltage.