Microphone Sound Detector (Arduino Compatible)
Detect sounds above a certain dB / loudness using this Microphone Sound Sensor. Easy to use with just 3 Pins: Power, Ground and Output! Amplifier built in!
Categories
Newsletter
Detect sounds above a certain dB / loudness using this Microphone Sound Sensor. Easy to use with just 3 Pins: Power, Ground and Output! Amplifier built in!
Use this Microphone Sound Sensor to detect sound above the adjustable threshold. Useful to trigger something to happen whenever a sound is heard! Hook up Power to 5V, Ground to 0V and the output to your circuits. Super simple to use and with an amplifier and microphone right on the board, you don't need anything else to detect sound quickly and easily. Arduino compatible.
Specifications:
For an analog microphone + amplifier module check out our Electret Microphone Amplifier.
/*
Sample code for TS-919 Microphone Sound Detector
Pin VCC to Arduino 5V
Pin GND to Arduino GND
Pin OUT to Arduino pin 3
*/
int ledPin = 13 ; //prepare Arduino on-board LED for use
int sensorPin = 3; //set sensor pin
int val = 0;// define a variable to store the current sensor value
void setup ()
{
pinMode (ledPin, OUTPUT) ;// define Arduino on-board LED as output
pinMode (sensorPin, INPUT) ;// define sensor as input
}
void loop ()
{
val = digitalRead(sensorPin);// read the sensor value
if (val == HIGH) // When the sound detection module detects a sound the LED on the Arduino board with light up
{
digitalWrite (ledPin, HIGH);
}
else
{
digitalWrite (ledPin, LOW);
}
}