Hi Folks...
I am planning to make a project with Servo Motors and Microphones, in which Servo Motors rotate approximately in the direction of sound ,based on which mic had larger output.
This idea was inspired by seeing Light/Solar tracker projects, in which they used LDRs and based on their outputs rotated servo motor...an if statement was used to determine which LDR had more light fall on it(Left or Right) and rotate Servo Motor(s) accordingly(Left or right) to point to direction of maximum light...
I was planning to use the same concept but with sound instead of light...
I found these MAX4466 Microphone Modules, whose output pin can be connected to an Analog pin in Arduino and visualized in serial plotter.
So I was wondering whether I can connect like 2 of them on 2 sides(left and right) and to two analog pins and compare the outputs with an if statement and rotate servo motor accordingly to reach a position where difference between them is minimum..which must be direction of sound source I assume!
Thank you so much for your time and any help is highly appreciated!
These are the wrong kind of sound sensors for this project. They output the high-frequency sound waveform. What you want to measure is the sound volume/level/amplitude/envelope.
There are sensors available which output the amplitude or envelope, I would recommend you get a pair of these.
Other options would be to make a sound level/envelope circuit to turn the output from the microphone modules into the signal you need. It may also be possible to do this in code. But these options will be much more difficult than using a sound level/envelope sensor.
The microphones will also have to be far-apart (relative to the sound source) to get a significant difference, or highly directional And it will be more difficult indoors where sounds reflect.
Or if you have short-duration sounds (like a hand clap) you may be able to detect the time-difference (about 1ms per foot).
Keep in mind that you can sample only one microphone at a time with the built in ADC. Sampling two introduces a time delay, which depends on a lot of different factors (ADC settings, MCU clock speed, code execution delays, etc.).
Also the gain or threshold on the two boards must be set at exactly the same point in order for you to stand a chance. You are best measuring the wiper of the pot with a volt meter to get as close as you can. Especially on the ten turn pot of the envelope detector.