Hi! I'm working with an Arduino Leonardo and a classic mic like this one. I would like to "read" the noise in an enviroment (like a clap or a shout), but as I could understand it's a capacitance and so I can't just read the value though an Analog inpunt. Do you have any suggestions on how to read it? I thought of insering it like the capacito of a RC filter, but I don't know if it's a good idea and how to practically do it. Do you have any schematic close at hand?
Thanks a lot!
No its a microphone, not a capacitance. Internally the sensor is an electret diaphram (electrets
have a permanent electric dipole) forming one of the plates of a capacitor. The internal FET
buffer provides a simple output voltage if the device is correctly biased, but its very small indeed.
You'd normally use a microphone amplifier as in this breakout: Adafruit Electret Microphone Amplifier - MAX9814 with Auto Gain Contro — Pi Supply or Adafruit Electret Microphone Amplifier MAX4466 with Adjustable Gain — Pi Supply
Thanks Mark! I have to insert it into a PCB, so I can't use modules. Am I obliged to amplyfy it? Since I don't need a very accurate measure I can read the rough value I think... IN thery I think that the sound wave moves the membrane and increase the capacity, but since the energy in the electric field has to remain the same the voltage will increase. Isn't arduino capable of reading this value? Could you please draw a little shematic?
Thank you very much ![]()
Hi! I've just seen this on internet, can this work for you? At the moment I can't try with a capsule since I don't have one near me...
Thanks again! ![]()
No, firstly that microphone wants a 2k2 pullup resistor to 1.5V, and secondly you must amplify
the signal to see it, its at microphone levels (about 1mV or so).
Ok... Would a simple BC847 be enough? It's SMD and it can be used like an amplifier. But I don't know how to calculare the resistor to amplify the signal... Could you advise me a way to calcualte it?
Thanks again!
Google "electret microphone amplifier NPN circuit" perhaps?
Would a simple BC847 be enough?
No.
You need to use an operational amplifier.
mmmm... Ok! I've just researched something and I think I can use an lm358, 101 of gain (I saw some scope's graphs and found out that usually a microphone works on 0.02V).
So, have a recap: Mic connected to GND and to 5V by a 0.005*(5-1.5V)=700 Ohm (0.005 is the input sure to of the opamp and 1.5 the operative voltage.) and from the 5V side after the resistor there's also the non inverting input of the opamp. Output connected to arduino analog pin and that should be all.
Is that thinking right?
Thanks!!
Your choice of op-amp isn't too critical although if you are running from a single +5V power supply a "rail-to-rail" op-amp will get closer to the full 0-5V range of the Arduino.
The gain is determined by the ratio of the input resistor and feedback resistor, and a gain of about 100 is about right but we can't know exactly how much gain you need without knowing the loudness of the sound and the sensitivity of the microphone. It's helpful to have variable gain and/or you may need to experiment.
You also need to bias the op-amp or arduino input at 2.5V because the Arduino can't handle the negative-half of the AC audio waveform.
[u]Here the schematic[/u] of the SparkFun microphone breakout board. It's got the bias built-into the design, and it's a good design to copy. Or just buy the board, which comes complete with the microphone for $8 USD. The only thing the SparkFun board is missing is variable gain.
Hi! Thanks for the schematic DVD! Basing on the sparkfun one I've made mine, I'll tell you as soon as I'll have the PCB and solder it!
Thanks!
P.s. I've omitted C2 and C3, could you please confirm me that it will work? I based this decision on the datasheet, in many typical application there's not those capacitors. In others R2 is connected with Vout instead of Vcc, but I think it doesn't change a lot.
I've omitted C2 and C3, could you please confirm me that it will work?
It will function, the noise might be higher and the amplifier less stable without these capacitors.
It seems an odd thing to do, to just omit components when you don't know what they do. Someone put them in for a reason and unless you understand that reason and decide it is not applicable then why do it?
C3 may be essential for stability and if you leave out C2 you'll pick up more supply rail noise.
You could try changing R4 to 0 ohms and R5 to 220k and it may be less noisy - 10k
series resistance will create thermal noise, yet the source already has a well-defined
impedance of 2k2 that can be used for calculating the gain.
@Grumpy yes it's odd as long as you stay on the breadboard, but when you have to put the circuit on a very small PCB with lots of components already mounted it's difficult not only to find place for a small SMD capacitor but also to solder it.
@Mark I'll try your solution, and I'll put C3. Since I'm using smd components I don't have 12 pF capacitor and I don't buy 100 only to use one. I hope the stability will not be so changed. But I think it'll be OK, keep in mind that I only have to detect a clap out a shout, I don't need any high audio capabilities out of this circuit.
Thanks!!
Why would you buy 100 12pF caps? Why not get a selection pack with many different values so
you can experiment in the future?
Whatever capabilities you need out of the circuit require it not to be an oscillator though - you
may find its stable with a smaller feedback resistor anyhow (the original 1M value acts as a
low-pass filter together with stray capacitance, compromising the phase-margin of the opamp,
the small 12pF capacitor is a device to prevent this by providing a high-frequency feedback
path)
but when you have to put the circuit on a very small PCB with lots of components already mounted it's difficult not only to find place for a small SMD capacitor but also to solder it.
Physics is no respecter of your personal difficulties. If you can't fit the circuit into a specific size then you can't build the circuit.
Hi! So sorry for this late reply! I've done the PCB and I, waiting for it! However, I don't fully agree with you. Circuits don't just work or not, they might work in berry different conditions, and I think a designer has always to keep in mind the purpose of the circuit. If there's a component that improves the performance form 90 to 94%, but you need only 90, that component is useless, is something that can fail one day and makes also more expansive the board (no matter how much). Said that, I hope I won't have so much noise ![]()
Thanks for all your help!!!
Circuits don't just work or not,
Yes they can.
Or do you regard an amplifier that oscillates as working because it is doing something.
If there's a component that improves the performance form 90 to 94%, but you need only 90, that component is useless,
You have a very lot to learn. There is something known as margin in a circuit. How many do you want to make, how repeatable do you want to make your design? So if by missing out a component then say 5 out of every 100 boards you make fail do you consider that component to be useless? If you do then you are some what of a poor designer and should be kept away from electronics or go to work in China.
If you embrace irresponsible design then keep out of my way.
Subsea:
Circuits don't just work or not, they might work in berry different conditions, and I think a designer has always to keep in mind the purpose of the circuit.
But that is exactly why safety margins are built in. A good designer tries to ensure that the circuit will work within a well specified range of conditions. But knowing full well that the world has randomness built into it, should admit that he or she cannot imagine all the possible conditions. Thus it is extremely unwise to "walk the edge" of a design. It's fine for prototyping, but not for real products.
What if your 90% suddenly becomes 88% because it never occurred to you that anyone would leave their GSM phone lying next to the device, and it RF burps into it? Or their cat likes to lie on it because it's warm? ... and so forth?
It's not so much the actions as the attitude that will get you into trouble with this sort of thing.
Sometimes increased part count can impact reliability. But you are grabbing at straws with that. One SMT cap isn't going to do that. Did you at least leave pads for it on the PCB? ![]()
@Grumpy I don't doubt that I have so much to learn, but I don't think (if I've not misunderstood) that the missing of a component make some boards to work and some other don't. But as I said, I'm surely a "new buy" in comparison with you.
@aarg Well explained your point! Sincerely, I haven't considered external interferences. Make fail-proof devices is of course the target of every designer and you are right, there's might be something that shouldn't be there in theory but practically it is. And, yes, I might be a NooB but I've left the place in the PCB, even if I don't have the SMT cap ![]()
However guys, thank you very much for your time and effort in replying to me! In those days should arrive at home the PCB and I'll be able to tell you both the "version".
THANKS!!