I'm trying to read the voltage going to the speaker from the Adafruit board. I know that I can't directly read the audio signal because it is AC, so I biased it with a 2.5V offset using a voltage divider and I put a capacitor in there to block the DC signal. The issue occurs when I connect the (-) negative terminal to the ground of the arduino. It pulls the entire signal low and I don't know why. Can someone help me. The schematic is attached and this is the shield:Overview | Adafruit Music Maker Shield | Adafruit Learning System
It took a little digging but as I expected it's a bridge amplifier* so the + & - speaker outputs are both driven (neither is ground).
You can use the 3.5mm line-output or just connect one of the speaker outputs to the Arduino's analog input. (And connect the audio shield ground and the Arduino ground together if they are not already connected.)
A bridge amplifier doubles the voltage to the speaker giving you 4 times as much power (wattage) compared to a regular single-ended amp with the same power supply voltage.
Sorry, I wasn't clear. The line output needs bias. The speaker outputs are already biased, but it doesn't hurt to leave the bias circuit in place.
My main point was: Don't connect the negative speaker output to anything (except the speaker). (Or connect the negative speaker terminal to the Arduino and don't connect the positive speaker-output to anything except the speaker.) You do need a common ground between both, which you probably already have.
A [u]bridge amplifier[/u] is essentially two amplifiers operating with "push-pull" connection to the speaker. If you ground one of the outputs you are shorting-out one of the amplifiers and bad things can happen.
If you have a "regular" amplifier with a single 5V power supply, the output is biased at 2.5V and it swings between (nearly) zero and (nearly) +5V at maximum volume (5V peak-to-peak). A capacitor is used to take-out the bias before it gets to the speaker, so you get -2.5V to +2.5V at the speaker.
If the amplifier has positive and negative supplies the output can rest at zero and swing positive & negative and you don't need the output capacitor. (This is the most common way to build an audio power amplifier.)
A [u]bridge amplifier[/u] is essentially two amplifiers operating with "push-pull" connection to the speaker.
With a single 5V supply both outputs are biased at +2.5V so with silence there is no voltage across the speaker terminals, no current flows and you don't need a DC blocking capacitor.
Either speaker terminal can be driven to +5V with the other terminal driven down to zero and by "reversing" the polarity to the speaker on the negative half-cycle we are getting 10V peak-to-peak across the speaker. When you double the voltage you also double the current so you get 4 times the power.
Thank you both but I tried both methods and neither worked. Still not sure why
I assume you are getting sound?
What are you reading on the analog input?
The ADC readings (and voltage) may be a lot lower than you expect unless you are "blasting" speaker at full volume?
Are you reading the bias (about 512) with silence?
With a signal the raw ADC readings should "look random", but they should average around 512 with larger up & down deviations when the sound is louder and smaller deviations when the sound is quieter.
You didn't say what you want to do with the results but typically, you'll want subtract-out the bias and then find the peaks, or take an average of the positive peaks, or an average of the absolute values or maybe you want to calculate the RMS? (The true average is zero after subtracting the bias.)
...If you don't understand why the readings are "random", it's because you are sampling a continuously-changing waveform that's positive half the time, negative half the time, and crosses-through zero twice per cycle. (Although there are no "pure cycles" unless you're playing test tones.) The [u]Audacity website[/u] has a nice-easy little tutorial about how digital audio works.
The amp is inductor-less class-D, so there is a full-swing HF signal on the speaker terminals.
Leo..
Yikes!!! Don't use the speaker outputs! I kinda' thought about checking that but I didn't.