I am looking to enhance my home security with audio detection.
For starts i would like to listen through a microphone and when there is audio then trigger an action, eg switch on a led. I have a load of esp8266 nodemcu and i would like to make use of them, one in each room.
I would like advice on what mic (something cheap, but reliable) and how to interface it, please
There are (at least) 4 different kinds of microphone boards or "sound sensors" They all have a microphone and a preamp, and the ones with analog output are "biased" because the ADC input on a microcontroller can't read the negative-half of an AC audio signal.
Note that with quiet sounds noise is a common problem, both acoustic and electrical noise. I've got a microphone board and with this particular board and the TV at "normal quiet volume" I get about the same readings whether the TV is on or off (it's just reading noise). If I turn it up a bit louder than normal I start to see a difference. It's mostly electrical noise and it's better with a separate power supply than when USB powered. (USB power from a computer is notoriously noisy, which isn't a problem with digital but it can be a problem if the noise gets-into analog circuits.)
This is the most common type of microphone board. It puts-out an analog signal (like you would send to an amplifier) except that the audio rides on top of a DC bias voltage. There are versions with automatic gain control, or a gain control pot.
There are some that have a pot to adjust sensitivity, and then they put-out a digital "1" if the sound is above the loudness threshold, otherwise a digital "0".
There are some that put-out a varying DC voltage proportional to the loudness.
And some boards have combinations of the above.
There are digital microphone boards that interface to the microcontroller via I2S.
P.S.
This isn't exactly what you want to do and the software is a little more complicated than what you want to do, but I made The World's Simplest Lighting Effect, which blinks an LED on when the sound is louder than average and off when lower than average. It works with a regular analog microphone board, and if you're using the built-in LED that's the only other hardware you need. (It was made with an UNO. I don't know if the ESP board has a built-in LED, and the ADC might be 12-bits instead of 10-bits, etc.)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.