Audio input into PIC ADC

Thread Starter

Synaps3

Joined Jun 5, 2013
99
I have a line level 800mV audio source and I want to use it with a PIC ADC input pin as a very crude VU meter (I know it won't use the full range). Will this pull down the voltage too much? I want to be able to still use the audio afterward without lowering the amplitude.
 

Thread Starter

Synaps3

Joined Jun 5, 2013
99
I only need this to detect an audio signal. It doesn't really 'need' to be a VU meter. I just want to be sure it is not going to effect the audio level.

Do I need to rectify the audio signal or does it not matter?

Can I just hook up directly to ADC pin?
 
Last edited:

Art

Joined Sep 10, 2007
806
I’ve read into a digital pin and rectified it.
I wasn’t sure it was a good idea to supply anything that can swing below zero, and your Pic ADC should read 0-5 Volts.
Prior to rectifying it, you could use a potentiometer to bias the audio signal.
I used LM358 to drive a condenser mic.
 

Thread Starter

Synaps3

Joined Jun 5, 2013
99


I found this posted somewhere. Does this need to be altered for a 800mV audio signal and 3.3V microcontroller? I've seen a version with 3.3uF, 10uF and 100uF caps. What should I use?

Also do you think this will lower the audio volume at all?
 

Thread Starter

Synaps3

Joined Jun 5, 2013
99
Sounds good (no pun intended), but what does changing the value of C do exactly?

I am guessing there is some frequency cutoff. What is it?
 

John P

Joined Oct 14, 2008
2,051
I'd have thought that the best input conditioning would be a "lossy peak detector" with rectification, so that you wouldn't have to catch the audio wave at its peak in order to get a measure of maximum amplitude. As for "I want to be able to still use the audio afterward without lowering the amplitude", that might depend on the output impedance of whatever supplies the signal.

Edited to say somehow I wrote "sample and hold" when I meant "peak detector". Big duh for that one. Fixed now.
 
Last edited:

MrChips

Joined Oct 2, 2009
34,662
Sounds good (no pun intended), but what does changing the value of C do exactly?

I am guessing there is some frequency cutoff. What is it?
Yes there is. It is all about impedance.
The source has output impedance. The ADC has input impedance. In an ideal case you want the output impedance to be low and the input impedance to be high.

Your circuit has two 10k resistors in order to bias the signal to mid point between Vdd and GND. Together this looks like a 5k input impedance. Together with the input C you have a high pass filter. You can determine the cut off frequency for this using fc = 1/(2πRC).
 

Thread Starter

Synaps3

Joined Jun 5, 2013
99
So if the device I'm sending my audio into after the PIC has a rated audio input impedance of 30k, do I need to better match the resistance on the PIC ADC?

Thanks for helping me. I know these are noobish questions :)
 

MrChips

Joined Oct 2, 2009
34,662
No matching required. A high input impedance means that it will not take too much current from the source.
You will be ok.
 

Art

Joined Sep 10, 2007
806
Make R1 & R2 a potentiometer where the ADC and other side of the audio cap connected together are the potentiometer centre pin.
 
Top