KY-037 Microphone Sound Sensor (high Sensitivity) - SensorKit X40

The microphone sound sensor with high sensitivity emits a signal when the front microphone detects a sound. The sensitivity of the sensor can be adjusted with a controller so that it can react to sounds of different volumes. This sensor is ideal for projects where sounds need to be detected and responded to, such as in voice control, surveillance systems or interactive installations. The adjustable sensitivity allows the sensor to be adapted to different environmental conditions and specific requirements.

User note

This sensor is ideally suited for threshold value measurement. This means that the sensor emits a digital high signal as soon as a threshold value set by the user on the rotary potentiometer is exceeded. It should be noted here that the digital signal is a comparison of the value set on the rotary potentiometer and the measured value on the sensor, which are then compared by the LM393 comparator installed on the board. The set value of the rotary potentiometer is the threshold value, which is used to define a logical high signal.

Digital output: If the sound level is above the set threshold value, a signal is output here

Analog output: Direct measured value of the sensor unit

LED1: Indicates that the sensor is supplied with voltage

LED2: Indicates that the sound level has exceeded the set threshold value

Functionality of the sensor

This sensor has two functional components on its circuit board: The front sensor unit, which physically measures the environment and outputs it as an analog signal to the second unit, the comparator. The comparator compares the measured value of the sensor with the value set on the rotary potentiometer and outputs a logical high signal on the digital pin and LED L1 if the value on the rotary potentiometer is exceeded.

Please note: The signal is inverted. If a high value is measured, this results in a lower voltage value at the analog output.

The rotary potentiometer can be set as follows:

Pin assignment

Arduino Sensor
5 V +V
GND GND
Pin 3 Digital Signal
Pin A0 Analog Signal

Code example

The program reads the current voltage value, which can be measured at the analog output, and outputs it on the serial port. In addition, the status of the digital pin in the console is also indicated, which means whether the limit has been exceeded or not.

To load the following code example onto your Arduino, we recommend using the Arduino IDE. In the IDE, you can select the appropriate port and board for your device.

Copy the code below into your IDE. To upload the code to your Arduino, simply click on the upload button.

// Declaration and initialization of the input pins int analog_input = A0; // Analog output of the sensor int digital_input = 3; // Digital output of the sensor void setup () { pinMode(analog_input, INPUT); pinMode(digital_input, INPUT); Serial.begin(9600); // Serial output with 9600 bps Serial.println("KY-037 Noise detection"); } // The program reads the current values of the input pins // and prints them to the serial output void loop () { float analog_value; int digital_value; // Current values are read out, converted to the voltage value... analog_value = analogRead(analog_input) * (5.0 / 1023.0); digital_value = digitalRead(digital_input); //... and printed at this point Serial.print("Analog voltage value: "); Serial.print(analog_value, 4); Serial.print(" V, \t Threshold value: "); if (digital_value == 1) { Serial.println("reached"); } else { Serial.println("not yet reached"); } Serial.println("----------------------------------------------------------------"); delay(1000); }

Tag » Arduino Ky-037 Sensitive Microphone Sensor Module