I'm looking for some help on a project of mine. I'm trying to build a device for sound testing fans at my job. Basicaly, beyond a certain level of noise, we reject the fan. So I would like to program my arduino so it can listen to multiple fans at the same time and when the fan is to noisy, the led associated with that fan would lit up to indicates it's problematic. I've build a code that can show me on the serial plotter a graph of the noise, but I don't know what to use to build a database to have sound value reference.
I'm using an Arduino UNO and W104 sound sensor for this project
If it's not clear please let me know, my english might be a little confusing.
If you have multiple sound sensors, then it can record data from only one sound sensor at a time. Each sound sensor must be insulated so that it cannot "hear" the other fans.
How do You intend to do the measuring?
One sample when a button is pressed or a high frequency sampling?
To make a database either an SD card or some Pc communication is thinkable.
Don't you just need one reference or one loudness limit?
Assuming you have some kind of sound isolation so one sensor can only 'hear" one fan... There is a circuit called a peak detector that "captures" and holds the peak for a period of time (depending on the R-C time constant). One of those on each analog input will hold the peaks long-enough to read several every time through a loop.
Some sound sensors have this built-in (usually called an "envelope follower" but the built-in one may decay too fast.
Or since I assume the noise is fairly constant, you can probably cycle-through the readings one at a time. But you still need to find the peak or average loudness.
Your sound sensor MIGHT have a digital output so you can set the pot to trigger the output when a certain loudness is exceeded. In that case it can probably drive an LED and you might not even need an Arduino!
...I make sound activated lighting effects and I use a peak detector because it's "easier" than reading a waveform and finding the peaks or the average and it means that I can read the "loudness" about 10 times per second (perfect for my application) instead of reading the waveform thousands of times per second. and it frees-up processor time to run the lights.
One loudness limit could work I think, and when the peak is it, it would light up the led. I only need one sensor to analyse the data to find that peak, but afterwards, if this means that I could plug mutliple sensor on the analog input that would be great. Because once I've got my loudness peak, I don't need to do more analyst, only need the LED to light up when the fan is to loud.
And yes, I need some kind of sound isolation but that part is easier.
So it's little blower fan that goes inside electric fireplace for example. At minimum speed we can clearly here if there's a rattle noise or some other unwanted noise, at maximum speed, the noise made by the air is to strong. I need to test the fan for a minimum of 2 minutes at low speed and test for noise.
Your whole approach is wrong! Attach a sound sensor/microphone directly to the fan motor housing. ALL the sound being produced will also be heard by the fan housing and there will be NO air movement causing sounds.
Then you can measure as many fans at a time as you need to, or can program for.
Yes, one thing at a time!. But that time is VERY SHORT, microseconds. So if you get sound sensors with digital output and adjust the threshold to the sound level you want, then the Arduino can detect the digital output telling you the sound is above your threshold. And you can do that on each of the available digital pins on your Arduino.