0
\$\begingroup\$

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?

\$\endgroup\$
  • 2
    \$\begingroup\$ I dont think the Arduino likes neg voltages .It might latch up or give false readings.Do something about this . \$\endgroup\$ – Autistic Nov 15 '15 at 2:48
  • \$\begingroup\$ Something like what? xD, I'm noob with electronics =/ \$\endgroup\$ – Ceps Nov 15 '15 at 2:50
  • \$\begingroup\$ Maybe a diode ,could be shottky ,you could use two diodes in a half wave voltage doubler. \$\endgroup\$ – Autistic Nov 15 '15 at 2:53
  • \$\begingroup\$ I have a couple of 1N4007, can I use those? \$\endgroup\$ – Ceps Nov 15 '15 at 4:22
  • \$\begingroup\$ Yes you can ,but remember the breakover volts of the diode .It wouldnt detect very quiet sounds which may or maynot be a good thing .If your radio is low power then the answer from jasen will work and i think you should try it .If its a high power thing then limit the input whatever you do . \$\endgroup\$ – Autistic Nov 15 '15 at 4:31
0
\$\begingroup\$

The amount of charge on the capacitor will change the value you see on the ADC.

change the circuit to this.

schematic

simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I'll give it a try asap, I don't have 10k ohm at hand, gonna try to get a couple tomorrow. \$\endgroup\$ – Ceps Nov 15 '15 at 4:37
  • \$\begingroup\$ You can use other values as long as they are the same. Anything larger will do. \$\endgroup\$ – Robert Stiffler Nov 15 '15 at 4:56
  • \$\begingroup\$ what! no 10K resistors? in a survey I did of all the junk electronics that came my way in the 1980s I determiend 10K to be the most common resistor in the world! :) but yeah, as Robert says the values arent very critical as long as they match, and the capacitor can be the 10uF you already have. \$\endgroup\$ – Jasen Nov 15 '15 at 6:33
  • \$\begingroup\$ @Jasen : you obviously haven't worked anywhere 11k was insanely popular ... because nobody bothered to refill the 10k drawer! \$\endgroup\$ – Brian Drummond Nov 15 '15 at 11:39
  • \$\begingroup\$ I have a ton of 220ohm... hahahaha \$\endgroup\$ – Ceps Nov 15 '15 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.