Reading speaker voltages

So I'm trying to program my addressable LED strip to react to music but I'm clueless as to how to read-in speaker voltages. I was thinking of connecting two leads to a speaker (the input for which is coming from the computer) and then connecting those to the Arduino to read the voltages. Any ideas?

Thanks in advance!

You can damage the Arduino if you input a negative voltage, and Audio is AC. So at a minimum, you need to prevent negative voltage of the audio from getting into the Arduino.

There are a few different solutions - The simplest solution is a diode wired across the Arduino's input to "short" negative voltages to ground.* Then, you need a resistor before the diode (1k - 10k) to limit current so that you don't damage your audio circuit when the diode "'turns on"'. While you're at it, another diode wired the other way to the Arduino's 5V supply will "short-out" the current if the signal ever goes over +5V, which can also damage the Arduino.

I use a peak detector circuit (op-amp, diode, capacitor) to change the audio signal to a varying DC voltage. I add a resistor across the capacitor (which is not shown in most peak detector schematics) so that the peak voltage discharges in a fraction of a second, rahter than holding "forever". Following the peak dector is a buffer amplifier (an op-amp) so that the peak-detector's capacitor sees a high-impedance load (only it's resistor). Following that is the resistor & diode "protection" circuit described above. (The peak detector should never go negative, but I need to protect from posiotive over-voltage, and negative protection is just one more diode.)

I was thinking of connecting two leads to a speaker (the input for which is coming from the computer)

Ther are 3 wires in the connector/cable coming from your computer's audio jack. Left signal, right signal, and ground. You need to connect the ground to the Arduino's ground and one (or both) signal wires to one of the Arduino's inputs.

FYI - The signal coming out of the computer is called an output. At the other end of the wire where the same signal goes into the speaker, or into the Arduino, we call it an input. Your soundcards input is for getting sound into the computer. :wink:

And, the audio output from a soundcard is not a "speaker" output, and you cannot directly connect a 4-ohm or 8-ohm speaker. It's a line-level, or headphone level signal. It puts-out about 1V at full volume. Computer speakers have an amplifier built-in, and this is why they need a power supply. It's a good signal for the Arduino's analog inputs.

If you connect the speaker-outputs from a power amplifier, you may get too high of a signal, so you might need a voltage divider (2 resistors) to knock-down the signal before connecting it to the Arduino.

  • A diode wired the other way to simply "block" negative current, doesnt work as wekk, because the diode doesn't turn-on 'till it gets about 1/2 volt across it, and that will block low-level signals. The diode voltage-drop also means you'll get about 1/2V negative if you do it the way I suggested. But, a very-small negative voltage won't hurt the arduino.

DVDdoug:
There are a few different solutions - The simplest solution is a diode wired across the Arduino's input to "short" negative voltages to ground.* Then, you need a resistor before the diode (1k - 10k) to limit current so that you don't damage your audio circuit when the diode "'turns on"'. While you're at it, another diode wired the other way to the Arduino's 5V supply will "short-out" the current if the signal ever goes over +5V, which can also damage the Arduino.

I was wondering the same thing, and wanted to make sure I interpreted the schematic correctly. I sketched a quick one in paint, could you tell me if that was what you meant?