Microphone sensitivity and noise

I had not put example code as it is very simple. As you might notice microphone circuit is attached to pin 0
I also had implemented FFT, it works, no problem. I also not putting here LED-realted part, in order keep the code as simple as possible
I also can repeat once more- this is not whistle or clap style implementation, just microphone somewhere in a room, which should differentiate silence/sound in the room

  1. cannot found threshold value to be sure here is a silence in room
  2. no way to filter out noise in sw level.
    Again I do not have issues with programming, I think, these are in circuit level and my initial post was about it - I had asked for better mic. circuit hint.
#define MicPin A0
#define SILENCE_THRESHOLD  256   // no value that works
void setup() {
  Serial.begin(9600);
}

void loop() {
  int i = analogRead(MicPin);
  Serial.print(i);
  if (i < SILENCE_THRESHOLD) Serial.print("Silence");
}

Grumpy_Mike:
You can also use a free program on your computer ( all operating systems ) called Audacity.
https://www.audacityteam.org/

It will sample signals from your computer's built in microphone and plot the waveform and perform analysis on it like an FFT. If you know what you are looking for, then you can see if you can implement this on an Arduino.

I know, and I had expressed it very clear. no reason to do it on pc, it is NOT experimental assembling to verify is it works.

wolframore:
Do you have this microphone near the ground attached under a table that's basically acoustically connected to a floor? Have you done any sort of FFT analysis? You may be picking up all kinds of noise through the floor... cars, buses, walking, 60 cycle hum, machinery... all kinds which may be drowning out the relatively weaker signal you're trying to capture.... it's about signal to noise. Especially since you've hidden this mic from the targeted source.

  1. you may need to mechanically decouple the mic from the table/floor
  2. you may need to create some sort of high pass or band pass filtering to capture what you're trying to capture..

You can put a $10,000 mic and preamp in that same situation and have the same or worse problems...

it's not the equipment it's the operator/engineer... that mic amp is not bad for what it is.

floor is carpet-style, I had tried to power mic from batteries and shielded anything. Still too much noise

Check the frequency of the noise. Carpeting helps a little but low freq can still be coupled. Plus the sensitivity of the mic falls dramatically as you get farther away. Think about how you voice sounds on the phone when you’re not talking into it.

wolframore:
Check the frequency of the noise. Carpeting helps a little but low freq can still be coupled. Plus the sensitivity of the mic falls dramatically as you get farther away. Think about how you voice sounds on the phone when you’re not talking into it.

Yes it is working if source is closer. In this way I had verified FFT, LEDs, but this is not a case.
I need more sensitive microphone and already had received one suggestion for such.
Its all.

It's not the mic... a more sensitive mic will just pick up more ambient noise as well:

In a recording studio the most sensitive mics pick up sound from across the sound stage like it was next to you... but pickup pattern is different (polar pattern) and it's also prone to picking up noise like someone smoothing their clothes and other annoying sounds... But you can't use this mic with these kinds of amplification in other settings... too much noise!...

If conversational speech is what you're after it's about 70dB... super quiet room may be 40-50dB.... this is probably very rare... more like 50-65dB is normal with some activity.

You are looking at 5-15dB difference you're trying to capture.... except your source 70dB gets lower with distance (see below).... when you amplify this you are going to get a lot of noise...

Perhaps a hypercardoid mic would help if you could point it exactly where you want to pick up sound... it has a narrow angle of pickup. Therefore you can boost gain more to pickup more of what you want and less of what you don't want.

As sound travels it radiates out and loses pressure. At some point it will be at the level of your background noise... except for out in space there is always some noise (since sound can't travel in a vacuum) ... studios control this noise and get better recording through better signal to noise ratio.

A sound that is twice as far spreads out 4 times the area so it becomes 1/4 the intensity. (inverse square law of sound)

You have to control the noise and the signal... we used to always say it's not the instrument it's the musician while recording... don't blame the mic or the preamp... it does what it's suppose to do and does it very well... what you're trying to do might not be possible without some sort of noise cancelling... (which is near impossible to determine from what is noise) or hyper focused pickup if you know exactly where this sound is picked up from.

It doesn't appear that the OP has ever supplied a circuit diagram, or photo of their setup. So, it seems, assumptions are being made as to the veracity of the OPs "electronics". This could, simply, be some sort of error in the circuitry, or a power issue [such as a noisy supply, or insufficient power, or a long, poorly shielded mic cable run, a grounding issue, noise being feed back to the more sensitive front-end of the circuitry [i.e. inadequate power supply filtering], a biasing problem--who knows.

The fact that the OP withheld the code they are using, because "it's so simple", indicates they don't understand how often "The Devil Is In The Details".

So, OP, if you're listening, do us a favor, and first read How To Use This Forum, then do your best to comply with what it requests, because it will layout what you need to do to supply sufficient information to not waste the time of those of us who take time out to help such as you.

ReverseEMF:
It doesn't appear that the OP has ever supplied a circuit diagram, or photo of their setup. So, it seems, assumptions are being made as to the veracity of the OPs "electronics". This could, simply, be some sort of error in the circuitry, or a power issue [such as a noisy supply, or insufficient power, or a long, poorly shielded mic cable run, a grounding issue, noise being feed back to the more sensitive front-end of the circuitry [i.e. inadequate power supply filtering], a biasing problem--who knows.

The fact that the OP withheld the code they are using, because "it's so simple", indicates they don't understand how often "The Devil Is In The Details".

So, OP, if you're listening, do us a favor, and first read How To Use This Forum, then do your best to comply with what it requests, because it will layout what you need to do to supply sufficient information to not waste the time of those of us who take time out to help such as you.

Sorry, I assume I had met all Forum requirements.(yes, I had checked them again) Yes I initially had not posted code as my assumption was - question is so simple. that everybody who knows Arduino a bit is able to understand issue. I also not posted circuit diagram as assume- everybody understands how to attach microphone circuit to pin A0. (and ground and power). If smbdy needs it, I doubt, he would be able to provide answer. All this works. Sw compiles and uploads. Microphone detects sound, which means all is wired correctly. NP. Also issue is stated clearly - in "average" living room with microphone "somewhere" I need to distinguish silence from sound. I am unable to do it due to low amplitude and much "noise".
I even had published code, in a case. if smbdy cannot understand my simple statements, What else? I did all requested steps, used serial monitor to visually verify readings, even changed ADC ratio (anlogReference()). I had mentioned several times - I do not have issues with programming, In my "official" life I am programmer with long experience, including C. Question is very simple and I can repeat it again - what is a best microphone electronic circuit for arduino for such task. What I should clarify more? What information here is missed? At the same time I do not have much experience in electronics, not ready to solder circuits from scratch. Also do not have time for it. Till now I received only one useful hint. All other stuff was generic recommendations or considerations, how my posts look like. Better would be not to answer instead of answering smth "around"
My intend was not to rise "ad homenium" style discussion, but get advice in my situation, had no idea, that this might warp smbdy personally. But anyway, sorry, if it is so.

wolframore:
Check the frequency of the noise. Carpeting helps a little but low freq can still be coupled. Plus the sensitivity of the mic falls dramatically as you get farther away. Think about how you voice sounds on the phone when you’re not talking into it.

I did also experiments on table. Microphone circuit was hanged on air - not touching anything. The same. This is not outside noise, this, most likely, is due to bad circuit and is coming from Arduino power supply. Tried to shield microphone wires, circuit, powered microphone circuit from battery- the same. I cannot power whole assembling from batteries as I need to "command" LEDs, which are several hundreds - batteries will be dry quickly..

wolframore:
It's not the mic... a more sensitive mic will just pick up more ambient noise as well:

In a recording studio the most sensitive mics pick up sound from across the sound stage like it was next to you... but pickup pattern is different (polar pattern) and it's also prone to picking up noise like someone smoothing their clothes and other annoying sounds... But you can't use this mic with these kinds of amplification in other settings... too much noise!...

If conversational speech is what you're after it's about 70dB... super quiet room may be 40-50dB.... this is probably very rare... more like 50-65dB is normal with some activity.

You are looking at 5-15dB difference you're trying to capture.... except your source 70dB gets lower with distance (see below).... when you amplify this you are going to get a lot of noise...

Perhaps a hypercardoid mic would help if you could point it exactly where you want to pick up sound... it has a narrow angle of pickup. Therefore you can boost gain more to pickup more of what you want and less of what you don't want.

As sound travels it radiates out and loses pressure. At some point it will be at the level of your background noise... except for out in space there is always some noise (since sound can't travel in a vacuum) ... studios control this noise and get better recording through better signal to noise ratio.

A sound that is twice as far spreads out 4 times the area so it becomes 1/4 the intensity. (inverse square law of sound)

You have to control the noise and the signal... we used to always say it's not the instrument it's the musician while recording... don't blame the mic or the preamp... it does what it's suppose to do and does it very well... what you're trying to do might not be possible without some sort of noise cancelling... (which is near impossible to determine from what is noise) or hyper focused pickup if you know exactly where this sound is picked up from.

Thank you, you are fully right, including logarithmic perception of sound by human air. You also right about capturing of "low volume sound". BUT- my setup works only if sound source is very close- detects load whistles, claps or speaker , if it is in close distance to microphone. Also in my case sound capturing quality is not so important, as,in fact, I am reducing sound to 3 frequency bands -low, medium and high for showing result in RGB strip (by using Fourier transformation). Here is alot of approaches how to do it. NP here. But as I have 2 problems - very little range of input signal and much "technical" noise, what, in fact, replaces detection of sound, I even cannot detect is the room silent or not, for example, TV box is switched on. So, this is not a question of sound quality, this is more question about noise reduction.
This might not be pure microphone issue, I think, noise is coming from power supply, most likely is from arduino uno as such. My understanding- signal (analogRead() )should be close to bias and stay relatively stable, if no sound at all. But it is not so. Serial monitor shows it is "jumping" a lot. If I cannot resolve this, microphone sensitivity - detection of low sound becomes irrelevant. This is why I have suspected hw. I think, if microphone circuit would produce good output signal in range 0..5v, then Arduino should be able to do good tranfer it to digital representation. But, I assume, mentioned circuits produces output in 0..3 volts or even less, and therefore noise "eats up" valid signal. Changing transfer ratio (analogReference()) does not help, as this changes "stairs" length, not amount of steps in it. In other words - I would be able to do a lot, if I have valid input signal. Theoretically good ADC & preamp would help, I ordered such and will be back to experiments as soon I receive it
I also might be bad quality of UNO, not tried much manufactures to compare.

1Pats:
Sorry, I assume I had met all Forum requirements.(yes, I had checked them again) Yes I initially had not posted code as my assumption was - question is so simple. that everybody who knows Arduino a bit is able to understand issue. I also not posted circuit diagram as assume- everybody understands how to attach microphone circuit to pin A0. (and ground and power).

It's not about what "everybody" understands, it's about what you think you understand. And we can't know that until you show us your version of how you think it works. You might think you're hooking that mic up properly, but the very fact that you're posting here, asking for help, is a demonstration that something is amiss. And that something could easily be a wrong assumption, on your part. Nothing to be ashamed of. It happens to all of us. When I was a kid, I thought "ascend" meant to go down, and "descend" to rise.

1Pats:
If smbdy needs it, I doubt, he would be able to provide answer. All this works. Sw compiles and uploads. Microphone detects sound, which means all is wired correctly. NP. Also issue is stated clearly - in "average" living room with microphone "somewhere" I need to distinguish silence from sound. I am unable to do it due to low amplitude and much "noise".

And yet there's a problem. For us to get to the bottom of what that problem is, we need to scrutinize all aspects of your "setup" -- including your semantics, and your interpretation of circuitry/software/documentation/etc. So often, the problem involves a conceptual distortion, like that "Ground" can only involve the negative side of a supply, or that the Collector, on a PNP transistor is synonymous with the Emitter on an NPN transistor, or that only negative current can flow in black wires, and that red wires are for positive current, or that a Power Supply rated for 3 Amps, can only deliver 3 Amps [and won't it fry my Arduino?!?].

We need to see, and hear, your complete story [or at least complete enough], so we can ferret out such misconceptions. For instance, getting clarity on what you mean by "Noise". And what in the X-Y you're actually trying to achieve.

Also, it's not about complying with some regiment so you can get an audience with the Anointed Ones. It's merely about you supplying us, with enough information, for us to figure out why you're not having wild success in your endeavor.

1Pats:
. . . Microphone detects sound, which means all is wired correctly. NP. Also issue is stated clearly - in "average" living room with microphone "somewhere" I need to distinguish silence from sound. I am unable to do it due to low amplitude and much "noise". . . .

I expect the max9814 modules will address the "low amplitude" issue.

It's less clear how to interpret the description "much noise" without further quantification. Deviations on the order of +/- 10 around the "quiet" mean are indicative of normal power supply/ADC noise assuming the microphone is powered from the Arduino regulated output. In this case just getting more signal amplitude will probably be good enough.

If deviations are much higher or the mean wanders around you may have an issue that won't be fixed by a higher gain microphone module alone. That your system apparently works as intended with a loud sound or sound source close to the microphone suggests that the problem is simply low signal amplitude and "much noise" is a bit of a red herring. Hence the suggestion up thread to provide a plot of the serial data output so we could see the characteristics of the "noise".

Audio is tricky. There are a lot of variables... saying there's noise is like saying my engine is making a weird sound... what's wrong with it, can you fix it and how much and how long will it take...

We really need more information. I did the best I could to explain some of the possible issues with no information... you need to provide more.

Circuit diagram whether you think it will help or not can help. Even a picture of your set up...

A reading of the noise from a oscilloscope and spectrum analysis would help immensely.

Other than that we can keep poking in the dark and get no where...

Ok, you all convinced me. Will provide all details as soon as will have time to get back to this.
BTW what is your suggestion for drawing schematics? Tool? ( never did it before)

There are all kinds of free EDA tools... this is a blueprint for you and will become useful while you're building and troubleshooting. It's an essential step so worth learning and spending time on.

There are so many you may want to try a few and decide what works for you. If you did a search I'm sure you'll find ones I haven't seen yet.

kicad
eagle (free version)
fritzing
circuit maker

1Pats:
what is your suggestion for drawing schematics? Tool?

1Pats:
BTW what is your suggestion for drawing schematics? Tool? ( never did it before)

Also, the free version of DipTrace.

Lorris007:
Friends, which microphone is the best?

No microphone is the best. You have to be a lot more specific.
Price?
Performance?
Frequency response?
Dynamic range?
Flatness of response?
Sensitivity?

And directivity is very important for microphones - cardiod v. omni is a big difference.