Audio input via Headphone Jack

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. Overview | Tiny Arduino Music Visualizer | Adafruit Learning System. 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: Electret Microphone Amplifier - MAX9814 with Auto Gain Control : ID 1713 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits. 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.

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.

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.

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?

have the signal come from a phone/laptop and then split it to the arduino and some speakers that are separate.

OK got you.

I'm assuming the 2 resistors and the capacitor are in parallel?

No connected like this:-
Audio input.jpg
This is for stereo, just use half for one channel.

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.

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. :wink:

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.

DVDdoug:
No... The resistors are for DC bias and they need to be equal. :wink:

I would disagree, the bias level does determine the clipping level

DVDdoug:
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.

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?

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.

Audio adjustable bias.jpg

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.

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?

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

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

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.

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?

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.

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.

Ok so something like this should work: SA305E105MAR KYOCERA AVX | Capacitors | DigiKey

It's a ceramic capacitor of 1uf +- 20% and rated up to 50v. Plus it's through hole so I can easily solder it.