Go Down

Topic: Electret microphone without breakout board (Read 2421 times) previous topic - next topic

IronCake

Hi guys.

So, i got a arduino board recently, and I've been playing with a lot of things, but one thing I want to do is with a mic. I have an electret mike without a breakout board, but I can't find anything on how to use it like it is, or how to make a board. I just need the arduino to be able to read a signal from the mic that I could use for something (like how an LDR give a integer between 0 and 1023) It is possible? Either how to use it as is, or how to make a board would be appreciated.

Thanks!

jremington


IronCake

HAHA

I tried that, but all I got from trying any of those results was a random number repeated that did not change on the volume level.

jremington

#3
Mar 30, 2014, 07:05 pm Last Edit: Mar 30, 2014, 07:10 pm by jremington Reason: 1
Well then, your first post was very misleading. This is not a good start.
If you want help, please read "how to use this forum" and post your code, using code tags. Also describe or post a picture of your circuit.

Grumpy_Mike

Also say what you actually want to measure, is it the waveform or the envelope.
Quote
but all I got from trying any of those results was a random number repeated that did not change on the volume level.

It sounds like you are measuring the waveform because that is what you get.

DVDdoug

#5
Apr 01, 2014, 11:18 pm Last Edit: Apr 01, 2014, 11:35 pm by DVDdoug Reason: 1
You can check the A/D converter and your software with a pot.  There is some information here.

Testing you mic & preamp circuit is a little trickier.    It's probably best to get a pre-built breakout board for testing purposes.  When you get everything working with the breakout board, you can try your own mic & preamp circuit if you want.

If you have a multimeter (which you probably should have) you can measure the DC output bias as well as the AC signal.    (You may not be able to measure the un-amplified AC signal from the mic, because it's only a few millivolts.)  You could also test your mic/preamp by plugging it into your stereo system or line-in on your computer's sound card...   But, I really don't recommend it because there is a small chance of damaging your stereo or soundcard if there's something wrong with the circuit.

Quote
I tried that, but all I got from trying any of those results was a random number repeated that did not change
What does that mean?   If it's repeated and doesn't change, I wouldn't call that "random".

When you read/sample audio the numbers normally "look" random because you are reading "random" places along the waveform.       The breakout board normally has it's output biased 2.5V.   With silence, you should get readings around 512.    As the sounds get louder, the numbers should "spread out" and you should get some bigger numbers and some smaller numbers with lots of "random" values in-between.    The average should remain around 512.

This isn't necessary if you just want to get the "loudness", but with "normal" digital audio the waveform is sampled at a constant-known rate (44,100 times per second for a CD).   The values look random, 'till you plot them at the same constant-rate.  Then you can "connect the dots" and re-create the waveform.    And in fact, real-world sound/audio is quite "random".   If you've ever seen a VU meter, the readings would look random if you are not listening to the sound.

bosleymusic

You can hookup an electret, but odds are you will need to amplify it by a factor of up to 100 depending on the microphone itself. You will also need to DC bias the input because the electret is most likely putting out an AC waveform and the A/D will not read negative voltage swing. Additionally, and I think I said this if you're the guy who just posted the other microphone post, make sure to low pass filter your input to avoid aliasing. The "randomness" could also be coming from the fact that you are undersampling the signal. Obey Mr. Nyquist, and he shall give you workable results.

bosleymusic


Testing you mic & preamp circuit is a little trickier.    It's probably best to get a pre-built breakout board for testing purposes.  When you get everything working with the breakout board, you can try your own mic & preamp circuit if you want.


I was thinking about this yesterday, and while knowing something works is a good thing,, the prebuilt preamps from Adafruit are not that good. They do not  bias at VCC/2 as they claim - it seems they drift heavily depending on the gain setting and I'm talking anywhere from 20-50% off.  If you go that route, only use it for testing to ensure you are getting signal. Also, ensure the output matches the proper impedance for the ADC you are using. Most ADC sample and holds contain a capacitor which needs to charge properly in order for a value to be properly read. Loading down the ADC too much, or too much interaction between the amplifier and the ADC will give you strange results, or very low results.

Go Up