Maker Pro
Maker Pro

Audio Signal ADC

Naphtali

May 29, 2013
5
Joined
May 29, 2013
Messages
5
Hi everyone, I'm making my college project and I'm stuck with ADC. My project is about taking audio signal (especially speech audio) is converted to digital. It starts from microphone which is connected to pre-amp module. Pre-amp module output then connected to basic envelope detector circuit (just using normal diode, resistor 1M, capacitor 100nF) after that I connect to basic voltage divider (using R1 = 1k and R2 = 8,2k) then to ADC of ATMega 8 Arduino NG.

The problem I have is the result from ADC which I displayed to Serial Monitor is far more lower. The longer I speak, the result is getting lower until near zero. Does ADC result always getting lower? My prediction is the envelope detector that causes the problem. Can anyone help me? I'll provide more information if needed. :)

I'm sorry if my post is not clear enough.
 

poor mystic

Apr 8, 2011
1,074
Joined
Apr 8, 2011
Messages
1,074
Hi :)
Have you checked the audio signal being presented to the ADC with an oscilloscope?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Running the audio signal through an envelope detector will not sample the audio signal, only it's peak value over a time period. Is that what you want?

Show us the circuit. It seems to me that the voltage divider is overwhelming the 1M resistance across the capacitor.

Bob
 

Naphtali

May 29, 2013
5
Joined
May 29, 2013
Messages
5
Hi :)
Have you checked the audio signal being presented to the ADC with an oscilloscope?
I haven't tried it yet. I'll try to check it tomorrow.

Running the audio signal through an envelope detector will not sample the audio signal, only it's peak value over a time period. Is that what you want?

Show us the circuit. It seems to me that the voltage divider is overwhelming the 1M resistance across the capacitor.

Bob
I've already got the peak value and now I want to make the peak value into digital so I can store the value.

This one is my pre-amp module


This one is my envelope detector


The result from my envelope detector


From envelope detector, I tried to connect it to ADC channel. But the result I got is always 0 and when I speak to microphone, the value suddenly rises to 1023 and if cut the connection for ADC, it start to decrease slowly. Thanks.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Your envelope detector has a 1M resistor to provide an RC time constant to drain the capacitor. Connecting this to a voltage divider drastically changes this resistance. You need to put a high impedance buffer (op amp voltage follower) between the envelope detector and the ADC.

Bob
 

Naphtali

May 29, 2013
5
Joined
May 29, 2013
Messages
5
Thanks for your quick reply Bob. So basically there's nothing wrong with my envelope detector? My connection should be : Pre-Amp -> Enveolpe Detector -> Buffer -> then ADC? There's no need for voltage divider then?

For the buffer, which IC Op-amp would you recommend? I tried using LM324 quad op-amp but the buffer output always 0 and 1023. Is it because I left the rest of unconnected op-amp open? For LM324, I'm using single supply line power supply which is 9V battery. Thanks.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Did you connect the output of the op-amp to the - input? This is how you make a voltage follower.

Bob
 

Naphtali

May 29, 2013
5
Joined
May 29, 2013
Messages
5
Did you connect the output of the op-amp to the - input? This is how you make a voltage follower.

Bob

Yes, I have connected the output to - input of op-amp. But the output that I got is always 0 and 1023. I thought it's because of other unconected op-amp.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Well, it sounds like you have too much amplification. Have you looked at the voltage out of the op amp buffer (of course, it should be the same as the input). If it is greater than the range of the ADC, you would need a divider, or to reduce the gain of the preamp.

Bob
 

Naphtali

May 29, 2013
5
Joined
May 29, 2013
Messages
5
I have found the solution. All I need to do is connecting the output of buffer to 820k resistor and to ADC (parallel connection). Thanks for all your help Bob.
 
Top