# Sound detection from stereo plug?!

**URL:** <https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611>\
**Category:** Interfacing\
**Created:** [May 18, 2008, 10:42pm UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611 "2008-05-18T22:42:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 18, 2008, 10:42pm UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/1 "2008-05-18T22:42:51Z")

</div>

I am trying to connect a stereo plug to Arduino that will light up an LED when sound(s) is coming in. I am not sure if I need to amplify the signal considering it is coming from computer speakers... Can I connect the stereo cable to an Arduino input?

Any help will be appreciated!

Thanks,  
Gervais

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 19, 2008, 4:40am UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/2 "2008-05-19T04:40:20Z")

</div>

You probably want an audio transformer to isolate to circuit from the speakers. Connect that to an amplifier. You can then connect that to either the A/D on the arduino or use a comparator to connect to the Arduino.

Transformer -\> Amp-\>Comparator -\> Arduino

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 19, 2008, 4:41am UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/3 "2008-05-19T04:41:17Z")

</div>

For the amp look at the LM324 amplifier. They are pretty simple to use and there is a lot of tutorials online.

---

<div class="post-metadata">

**Author:** ![kg4wsv](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kg4wsv](https://forum.arduino.cc/u/kg4wsv)\
**Post date:** [May 19, 2008, 11:48am UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/4 "2008-05-19T11:48:28Z")

</div>

I know at least one device that uses a simple DC blocking capacitor (0.1uF) plus a pot (5k, I think) to attenuate, and tied the resulting audio directly to a digital input pin (of a Motorola 68HC, not an ATmega). Look at X1 pin 5, C3, and R9 [here](http://www.argentdata.com/support/opentracker1-schematic-rev4.png).

I suspect you can get by without comparators and amps, especially since you're using a headphone/speaker out instead of a line out.

-j

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 19, 2008, 9:02pm UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/5 "2008-05-19T21:02:43Z")

</div>

I recently tried to connect an audio line directly.  
(I wanted to use the arduino as a led synthesizer.)  
The analogue in couldnt really read much change in voltages directly.  
I have yet to try it, but my next plan is to use a simple op amp and maybe a few band filters/attenuators.  
If all you want to do is detect sound on, then a simple attenuator like kg4wsv suggested might work.  
Thing is, there seems to be a current flowing through the line out permanently, so just measuring if there is any voltage won't do.  
It's the frequency(or change in frequency) that I think you should be trying to isolate and detect.  
Take what I say with a pinch of salt though (I don't know much), only I tried something similar 🙂  
Good Luck!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 6:49pm UTC](https://forum.arduino.cc/t/sound-detection-from-stereo-plug/10611/6 "2021-05-06T18:49:30Z")

</div>

Closed on May 6, 2021, 6:49pm UTC


