Hello! Before I start I would just like to apologize in advance if I poorly understand how some of these components or circuits are supposed to function. Being relatively new to this wonderful field of electronics, it's suffice to say that this is inevitable. Please feel free to correct me on anything incorrectly stated!
So... my ultimate project is to create my own "clapper" that you can plug any appliance into and simply turn on by clapping twice. My first plan of attack was handling the capture of the sound, using a microphone and an Arduino UNO (which would consequently trigger a relay once the appropiate analog response from the mic was reached).
I like using some components from older appliances that are collecting dust in my house, so I took apart an old at&t answering system (model 1739) and pulled out this microphone (couldn't find any datasheet for the circuit board, so no idea the exact characteristics of the mic):
Not knowing too much (i.e. anything) about mics, I did research... and came to the conclusion that this must be an electret microphone. Now I am not 100% sure, but given the overall look and widespread use of these I feel confident about it (hopefully this is not the part that I am wrong in... :o :o ) Also I see a little bit of what I believe to be a green PCB layout on the back, which is where I assume the FET impedance converter would be located if it was electret.
So here is my simple circuit drawn out (as well as breadboard connections) without any gain amplification that I connected to the A0 analog pin of the arduino UNO.
I used 2k resistance as this seems to be roughly the value used for biasiing the electret's JFET. As the way I understand it, the capacitor allows the AC voltage from the electret microphone to pass (within mVs range) while blocking the DC current to the analog input.
Powering this from a a 5V wall adapter, the circuit seems to work. On my oscilloscope, I see low voltage waveforms from clapping, speaking, music etc.
However, the issue comes from inputting these signals into the ADC of the ATMega328
(datasheet)
Here is my simple code for checking the analog voltage:
void setup() {
Serial.begin(9600);
}
void loop() {
int reading = analogRead(A0);
Serial.println(reading);
}
What I get on the serial monitor are much higher voltages that slowly decline over time. Removing the A0 input and grounding the capacitor and plugging back the A0 connection brings the reading to roughly ~30, which then increases with time (video link: VID 20190805 170618 342 - YouTube)
Suffice to say... I am a bit perplexed.
I know that the ADC datasheet recommends a low impedance source with a slowly varying signal, but I figured the impedance conversion circuit already included in the electet capsule provides this, and as for slowly varying signal... I tried an RC low pass filter and the same effects occur. I feel like I am missing something obvious here... I even tried an OP amp buffer to have an even smaller source impedance but it didn't have an effect.
I don't get why the S/H capacitor would charge up to almost 4.5V...and then very slowly trickle down. It should only see mV's from the mic. Perhaps it's because I'm powering the mic with +5V from the arduino? Still, by looking at the analog input circuitry I still don't quite understand why that would matter...
Would anyone like to shed light on this mystery? I'd really like to understand the circuitry behind why this is happening. Or just a nudge in the right direction so I can search more on my own. I feel like what I'm looking up isn't very useful. If it's just a simple overlook sorry!!
Thank you!
-Justin