Go Down

Topic: Microphone into Arduino? (Read 64377 times) previous topic - next topic

mellomutt

I'm coming from programming, very new to electronics.

I need help getting usuable data from an analogRead of an electret microphone (or condenser mic, even).

I've seen threads on here discussing this, but there are assumptions made in the explanations that themselves need explanations for someone with little experience.

Also, a popular thread that discusses using a mic has links to a forum that not longer exists.  The links that do work go to an audio project that is well outside what I want to do.  Do not need or want full-on real-time audio-processing, and I know that there must be a way to get simple microphone data because I see the projects people make, though they do not provide instructions on how to copy their efforts.

I was wondering if it was possible for someone to post a simple schematic with clear labels on the basic components needed to pull in usuable data from an electret mic.

Ya know, Arduino+Microphone for Dummies.  A simple bit of code would be nice, too. :)

I've been reading all sorts of books and pdfs to get my head around some of the concepts.  Been buying capacitors and resistors, pots and op amps, trying all sorts of configurations, but it's just not clicking for me.  Btw, I do not have a 'scope.

Other projects I've found are too complex, outside my ken, and even then they'll often fail to provide a schematic and simply show photos of their breadboard taken at obfuscating angles.  There are some schematics that say 'here is how to do it' and though I match everything onto the breadboard and the arduino, the only results I get in the Serial Monitor are a serious of numbers that do not fluctuate except slightly.  Either all are 71-72, or 348-349, or 936-937, etc.  Sounds do not make them change.

I've been beating my head against the wall, and finally broke down to risk ridicule and scorn by begging for help in the forums.

Thank you,

mellomutt

zoomkat

Quote
I was wondering if it was possible for someone to post a simple schematic with clear labels on the basic components needed to pull in usuable data from an electret mic.


You will need to explain what you consider "usuable data" and in general what you want to accomplish.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

retrolefty

Indeed again. Unless we know your expectations of what you expect to be able to do with the microphones output it's hard to know if we should encourage you or discourage you. If you just want to know if there is sound Vs no sound (think clap lights on and off, which is pretty simple to accomplish) that is one thing, but if you expect to be able to store and replay music then that is pretty much off the table without a lot of external help. If you rather have something in mind between those two examples then tell us and lets us comment.

Lefty

Grumpy_Mike

There is a limited ammount you can do with audio and an arduino. See this link for perhaps the most that anyone has pushed audio processing.
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

mellomutt

Quote
(think clap lights on and off, which is pretty simple to accomplish) that is one thing,


Yes! Something like this.  Just to be able to register sound at all would be a step forward for me, but was definitely thinking along these lines.

Quote
See this link for perhaps the most that anyone has pushed audio processing.


That's the real-time link I mentioned.  That is well beyond what I was looking for, which is why I tried to stress simplicity.  It's just difficult for me to articulate because, as is typical of people who are new to a subject, I just know don't enough to ask the right questions.

Thank you for the responses!

mk3

I have used the microphone breakout board for electret microphone from sparkfun.  The schematic for the board shows you how to move the signal to a 2.5V average so that the 0V to 5V analog input of the arduino can read the signal.  The board does this for you so it will only require jumper wires and an optional solder-less breadboard to get you going.

Your next step would be to connect the output of that board to an analog input pin of the arduino and read it.

mellomutt

Then this sounds exactly like what I was looking for.

Thank you!  I'd seen that product before and thought it was just another fancy microphone for me to fail to hook up. :)  (Plus, I only noticed the word 'retired' and moved on before reading that they have a replacement).

Ordered it!  They should give u a commission. :D

Grumpy_Mike

Quote
It's just difficult for me to articulate because, as is typical of people who are new to a subject, I just know don't enough to ask the right questions


Yes asking the right question is 80% of finding the answer. Don't worry it will come if you stick at it.
Best of luck.

mellomutt

#8
Dec 19, 2010, 02:44 pm Last Edit: Dec 19, 2010, 02:45 pm by mellomutt Reason: 1
The breakout board finally arrived.

I wanted to point out a couple of things for others who may be looking for working info and not finding it.

For this item (Breakout Board for Electret Microphone
sku: BOB-09964):

http://wiring.org.co/learning/basics/electretmicrophone.html

It does NOT work as they show it.  The comments for the product will attest to others having the same experience.

If you wire it up according to the wiring guide they give you (click here for guide and code), you do NOT receive any usable values.  

I thought maybe I had done something wrong (which would be likely).

Except...then I got it to work. If you put a resistor on the ground (GND), the microphone will start responding to sound.  I don't know why this works, though I'm sure someone could explain.  It's just a mystery why no one has yet bothered.

I put a 5K resistor coming off the ground, and voila!  I can clap and an analogRead serial display will show it jump from ~400 to ~1000.  

If you DO NOT use a resistor, the data being read will stay and hover at a certain number.  That number seems to change every time you power up the arduino, but it does NOT respond to sound.

I'm guessing different resistors will give it different sensitivities and/or ranges.

I hope this info will save you from crushing some delicate electronics beneath your heel.

mk3

thanks for coming back and posting your results.

You put one end of a 5K resistor on Ground.  What wiring point is the other end of the resistor attached to?

mellomutt

I just put the resistor inline with the ground.

Here's a modified schematic:

http://img172.imagevenue.com/img.php?image=75108_ElectretMicrophone_breakout_board_with_resistor_122_128lo.jpg

Sorry I don't have anything fancy to draw with yet.  This was done in Gimp. :)

mellomutt

#11
Dec 19, 2010, 05:25 pm Last Edit: Dec 19, 2010, 05:26 pm by mellomutt Reason: 1
Can you recommend an alternate way to get usable values from the microphone?

mellomutt

Any solution that would change the values based upon ambient noise would be perfect, but would also be something that you *would* recommend.

As it is, the mic will now pick up the sound of a clap in the same room.  I have no clear project in mind at the moment, but let's assume that all we wanted the circuit to do is light up an LED when a clap is detected which is possible w/ the current setup.


mellomutt

The current setup with the resistor provides the functionality I want.  I just wondered if there was alternate way to make the breakout board provide the same responsiveness, as you said the resistor connected to the ground was 'not recommended'.

raron

#14
Dec 19, 2010, 09:57 pm Last Edit: Dec 19, 2010, 10:05 pm by raron Reason: 1
Well in that case I'd say its the result that counts? ;)

But I would think something is wrong with that breakout board, it should have worked as per the schematics, without your resistor via ground.
(I'd at least check the current/power consumption of it, just to be sure there are no shorts or something. I guess not, but better safe than sorry).

BTW, do you also get sensible readings if you put that resistor at the + 5V line instead? Your setup looks kind of like how one normally use a 2-terminal electret microphone by itself (without amplifier, but it really needs amplification!).

Like described here: http://www.epanorama.net/documents/audio/electret.html

Also, I'm guessing this is the breakout board you have? http://www.sparkfun.com/products/9964


I recently used something similar, except I just used a transistor (most any small-signal transistors should do I think). I used it for getting audio into a morse decoder program.



EDIT: Another schematics, basically the same as from the sparkfun link, just to show how the electret is usually connected to the preamplifier, which is an OP-AMP here: http://www.newcircuits.com/circuit.php?id=aum002

Go Up