Go Down

Topic: Audio input via Headphone Jack (Read 3197 times) previous topic - next topic

Ccope19

I have plans to make a cheap soundboard and also saw Adafruit's plans for the audio visualizer with an LED matrix and a microphone. https://learn.adafruit.com/piccolo/overview. I was wondering if there is an easy way to take one of their amplifiers or take the microphone off of the assembly and solder the left or right of a headphone jack in its place.  I'm looking for it to be relatively cheap.  Maybe like this: https://www.adafruit.com/products/1713. I know audio is AC while the analog is 0-5 VDC and what I've read is I need some sort of op amp.  If you could help, thanks.

Grumpy_Mike

Quote
I was wondering if there is an easy way to take one of their amplifiers or take the microphone off of the assembly and solder the left or right of a headphone jack in its place.
I don't understand this. Headphones are devices for pluging into outputs where as a microphone is a device for plugging into an input.

 You only need an op-amp on the input if your signal is low, like it is from a microphone. If you have a volt or two peak to peak there is no need to amplify.

Quote
I know audio is AC while the analog is 0-5 VDC
Yes, you need to bias the analogue input. That is two 10K resistors connected to the analogue input, with the other ends connected to +5V and ground. Then take a capacitor about 1uF and connect it to the same analogue input with the other end to your audio signal. Don't forget to connect the audio ground to the Arduino ground.

Ccope19

Right.  Headphone, microphone... they use the same jack.  Anyways what I was trying to do was have the signal come from a phone/laptop and then split it to the arduino and some speakers that are separate.  This way I could have an audio visualizer of only the audio signal and not everything the mic picks up.  You say I just need some resistors and a small capacitor, is there anyway to have this adjustable to fine tune for minimal clipping and I'm assuming the 2 resistors and the capacitor are in parallel?

Grumpy_Mike

#3
Dec 01, 2016, 03:15 pm Last Edit: Dec 01, 2016, 03:16 pm by Grumpy_Mike
Quote
have the signal come from a phone/laptop and then split it to the arduino and some speakers that are separate.  
OK got you.

Quote
I'm assuming the 2 resistors and the capacitor are in parallel?
No connected like this:-

This is for stereo, just use half for one channel.

Quote
is there anyway to have this adjustable to fine tune for minimal clipping
There is no need this produces exactly symmetrical clipping but if you want you can replace the two resistors with a 20K ( ish ) pot.

DVDdoug

Quote
There is no need this produces exactly symmetrical clipping but if you want you can replace the two resistors with a 20K ( ish ) pot.
No...  The resistors are for DC bias and they need to be equal.  ;)

You can add a pot (on the "audio side" of the capacitor), but you're probably   not going to clip with a headphone signal (or with a line-level signal) so I'd try it first.    

Grumpy_Mike

No...  The resistors are for DC bias and they need to be equal.  ;)
I would disagree, the bias level does determine the clipping level

You can add a pot (on the "audio side" of the capacitor), but you're probably   not going to clip with a headphone signal (or with a line-level signal) so I'd try it first.     
I agree that a pot on the audio side is not going to do anything other than perhaps blow up the device driving it.

Ccope19

#6
Dec 01, 2016, 09:57 pm Last Edit: Dec 01, 2016, 11:11 pm by Ccope19
So let me get this straight, the resistors after the capacitor adjust the clipping so if it's variable, then it chills get the bias as close to 2.5 volts assuming I adjust it right.  I also read that the resistors need to be equal so could I have a connection between the capacitor, pot, and the arduino and then after the pot have 2 wires, one for ground and one for 5 volts?   The ground wire would also connect directly to the audio ground. Also, does the capacitor have to be 1uf or can it vary slightly?  If so, how much and at what voltage?

Grumpy_Mike

#7
Dec 01, 2016, 11:17 pm Last Edit: Dec 01, 2016, 11:17 pm by Grumpy_Mike
Quote
So let me get this straight, the resistors after the capacitor adjust the clipping so if it's variable, then it chills get the bias as close to 2.5 volts assuming I adjust it right.
Yes but if you have fixed resistors of the same value it is at 2.5V anyway, much closer than you can get by adjusting a pot. An audio waveform is basically symmetrical so you want the clip level at the middle of the range.



Quote
Also, does the capacitor have to be 1uf or can it vary slightly?  If so, how much?
I would say the minimum value should be 1uF, it can be as big as you like. The bigger it is the more low frequency gets through.

Ccope19

So 2 10K resistors and a 1uf capacitor, now what about the voltage of it.  Based on what I've read, the voltage rating is the max of the capacitor so I can be at 5 volts on a 16 volt capacitor and be fine because it still is releasing the same voltage as it was charged with.  Right?

Grumpy_Mike

Yes, as long as your capacitor has a working voltage about 20% higher than the maxi voltage it will see then it is fine.

Ccope19

Thanks for helping! I had already looked at past forums and other websites but still didn't really understand it. 

Ccope19

#11
Dec 04, 2016, 04:53 am Last Edit: Dec 04, 2016, 05:01 am by Ccope19
Ok, one last question and I'm done.  Capacitors in series add their capacitance together right?  Because 1uf capacitors are hard to get a hold of, could I just use 10 0.1 uf capacitors. www.adafruit.com/products/753 They say they are rated for 50v -20%+80%. Otherwise I could try to find some 1uf 6v capacitors in small quantities on amazon.

CrossRoads

Resistors in series are added.
Capacitors in parallel are added.

1uF and 10uF are readily available:
http://www.dipmicro.com/store/C10E10-16-105
http://www.dipmicro.com/store/C6E10-50.C

Where are you located?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Ccope19

#13
Dec 04, 2016, 06:49 pm Last Edit: Dec 04, 2016, 08:14 pm by Ccope19
I'm in Indiana, USA.  Thanks for that link, I kept finding capacitors that were SMT/SMD and in minimum packs of 10-100. In the schematic above, could the negative voltages of the audio affect the polarized capacitor or should a non polarized capacitor be used?  Tantalum and aluminum capacitors are polarized while most ceramic capacitors aren't.

CrossRoads

Heck you're not far from Digikey.com in MN also, all kinds of resistors in all kinds of packages are available.
Sometimes too many choices can be overwhelming, dipmicro.com has done a decent job of simplifying the selection.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up