[SOLVED] Weird behavior reading speaker level input

Hey guys! I'm trying to detect when speaker starts playing audio, my speaker is connected with a 10uF 50v in series with the positive (red) cable coming out of my receiver, and negative to ground.

Speaker (+) ----- || ----- A0

Speaker (-) -------------- GND

I was reading values from around 200 I believe. I had something like input > 210 and it worked(to detect audio). Now at some point and I'm sorry to say I have no clue what changed the reading changed to 100, it looked weird but at that moment I didn't care much and changed my control value to 110.

Now this happened again and I'm reading 36. I'm kinda worried now I'm doing something horribly wrong. Any ideas?

2 problems - Your readings are unstable because the Arduino's analog has a "floating" DC value. You can fix that with a high-value resistor (maybe 100K) between the Arduino's input and ground.

Your other problem is that you are feeding an AC signal into the Arduino and that signal is positive half the time and negative half the time. And, the Arduino can be damaged by negative voltages.

There are two ways to fix that - You can [u]bias[/u] the input at 2.5V, or you can add [u]protection diodes[/u] to the input, or both. (I'd recommend changing the series resistor for the protection diodes to 1K or more.) If you use the bias resistors, that also takes care of the floating-DC problem.

If you have a speaker output of more than a couple of watts, it's a good idea to add the protection diodes.

With components I have around until I wait till tomorrow, can this work?

Edit: I noticed with that circuit (without speaker) I'm reading 36 on A0, 15 on A1, 514 on A5. Is that normal? I read here that with a divider I should read around 510.