-
I'm trying to figure out how to wire up a basic electret microphone element from Radioshack:
http://comingsoon.radioshack.com/electret-microphone-element-with-leads/2700092.html
I'm not sure how to wire it up to A5 on my Espruino Pico to monitor audio. I'm using a 9V battery as a power source on a breadboard and placing the output on the A5, and then also supplying BAT_IN with the same power source and GND to the negative terminal on the battery. When wired up, I get constant values so I must be doing something wrong.
Here's the code I'm using:
console.log("BEGIN"); var on = false; setInterval(function(){ var a = analogRead(A5); console.log(a.toFixed(2)); if(a > 0.5){ on = !on; LED1.write(on); } }, 100);
@RandyHarmon thanks for the detail on the proper voltage for the ADC inputs. I didn't realize they were limited to 3.3V on the Pico. On this page the diagram doesn't actually label the ADC ports as 3.3V tolerant like the legend would suggest they should. But I just looked at the standard Espruino board page and that label is indeed there.
Would you be able to offer any guidance on how I can test the mic with a voltmeter to help me better understand its operation? I looked at the specs, but being new to these small electronics I wasn't able to completely understand what voltages to expect coming out of the mic.
Thanks for the quick tips!
Cheers.