Line Level Audio Input

I have scoured the internet and have not found an answer for what I want to do without building a circuit from scratch. I am not opposed to doing so, but would prefer to use a pre-assembled breakout board.

I have a multi-pattern VU meter that I have constructed, and have it functioning well right now using a "Adafruit Electret Microphone Amplifier - MAX4466 with Adjustable Gain" but would like to go to stereo input from a line level source (in my case a computer headphone out).

I believe I need a non-inverting op amp circuit and a DC offset to get everything to work properly with my Arduino, at least that is what I have read.

Can I use something like the "Adafruit Stereo 20W Class D Audio Amplifier - MAX9744" and apply a DC offset to the output from the audio amplifier then feed it in to the Arduino? Is there something that would work better?

I have spend way too many hours trying to figure out what I need to make it do what I want, so instead of continuing to frustrate myself, I thought I would reach out and see if I can pick someone else's brain on this.

Essentially, I want to take line level audio from a computer headphone jack and feed the stereo signal to the Arduino in lieu of using a microphone with only mono audio.

I know, sounds so easy, but it has me pounding my head against a wall at this point.

Any input is greatly appreciated!

You shouldn't need any amplification with a [u]linel level[/u] signal or with a "loud" headphone signal. And within reason, you can adjust the sensitivity in software.

I'd try it with just a [u]bias circuit[/u] first. Then if you need more gain, you can add an op-amp.

... but would like to go to stereo input from a line level source (in my case a computer headphone out).

Of course you'll need to use two analog inputs for stereo.

I believe I need a non-inverting op amp circuit and a DC offset to get everything to work properly with my Arduino, at least that is what I have read.

Yes, you do need offset. Since the audio is AC it doesn't matter if it's inverted or not, you can't invert the bias.

Can I use something like the "Adafruit Stereo 20W Class D Audio Amplifier - MAX9744"...

No. You don't need a power amplifier (designed to power a speaker).

If you need anything, you just a regular op-amp. The [u]Sparkfun Microphone Breakout Board Schematic[/u] shows an example of an op-amp circuit, complete with the bias. (It might be the same as the Adafruit board). You would need to lower the value of the feedback resistor for less gain (you probably only want a gain of 5 or 10).


For my sound activated lighting effects (including a VU meter effect) I use a [u]peak detector circuit[/u] at the Arduino input. The peak detector converts the audio signal to a relatively-slowly varying DC signal. (This simple version simply ignores the negative half of the waveform.)

The advantages are that I no longer need the bias. And without the bias I can automatically switch to the 1.1V ADC reverence when the signal is low. And, I can read the DC voltage about 10 times per second instead of reading the audio waveform thousands of times per second.

The disadvantages are that you loose any audio-frequency information and it requires an op-amp (and the op-amp works best with bipolar power supplies).