11 posts / 0 new
Author
Message

I am trying to monitor a line level signal (sound card 3.5mm stereo out) using an AVR ADC to assign values to the varying amplitude curve over time.

I don't understand how to get the signal. If I monitor it with a voltmeter, I see nothing. If I use a software oscilloscope looped back into the soundcard input, I see the wave from -1 to +1V. There is obviously something going on in between.

Can someone help out? Thanks.

Are you measuring AC voltage with your voltmeter? That should show something, especially if the frequency of the signal is low enough. If you have the Voltmeter set to read DC volts, then naturally it will show nothing as the audio signal is referenced to ground.

To get back to the AVR ADC thing. The ADC handles positive voltages only. So you'll need to set up a virtual analog ground, eg. 1.2 Volt DC, and AC couple the audio signal to that so the audio signal is riding on the 1.2 Volt bias. You can then use the ADC on that signal, with the 1.2 V as reference voltage.

If you think education is expensive, try ignorance.

Well, it's hard to tell without seeing your schematic and software.

But at least a voltmeter should indicate there is something on the output pins. Do you measure DC or AC and what frequency? Normal multimeters can only measure 50 or 60 Hz AC, and the DC portion may be low-pass filtered so basically the output revolves around 0VDC so the multimeter will show 0VDC.

So how do you connect the audio to AVR? A capacitor in series in the input to block DC and resistor divider to rebias the signal to half of the VCC? Can you read anything with the ADC like a potentiometer?

- Jani

I was using a normal multimeter on DC, expecting to see the voltage on the positive side.

Quote:
So you'll need to set up a virtual analog ground, eg. 1.2 Volt DC, and AC couple the audio signal to that so the audio signal is riding on the 1.2 Volt bias. You can then use the ADC on that signal, with the 1.2 V as reference voltage.

I'm kind of following you on this, but not really sure how to set it up.

Again, still fuzzy on the hookup from the 3.5mm, which I simply tried hooking up the tip to the ADC0 pin, ground to ground. Also tried using the AVR internal 1.1V reference.

Also, if I am correct the ADC is set to 125kHz (1Mhz freq. setting in AVR studio config and ADC prescaler set to 8 ).

Use 2 100k Rs in series from 5V to gnd.... there is 2.5V in the center for a/d bias.... put a 1uf cap on input

Imagecraft compiler user

Thanks, I'll try it when I get home, and thanks for your help earlier too.

Yes you can think of the audio signal like sine wave, it has positive peaks and negative peaks (+1 and -1 volts for example) and the average voltage is 0. And you can't feed negative voltages to AVR ADC.

```
VCC (or AREF)
|
[ ] 100k
1uF  |
|
[ ] 100k
|
GND

```

Audio in example: 1VAC+0VDC

then ADC pin has 1VAC + 2.5VDC

- Jani

hmmmm, still not a success. Is this anywhere near the right track? (see attached image) I'm still trying to wrap my head around virtual ground. Is it moving my 0 ground to 2.5 in this case so that a -1 to +1 volt source hovers in the 1.5 to 3.5V range? If so, does that mean I need to narrow the window a bit to take advantage of the full range of ADC? :shock:

Attachment(s):

just somehow missed your schematic on top of mine :) . I'll try rewiring like that.