Need help? Call us:

+356 27443236

No products in the cart.

Menu 2 Menu

KY-038 Small Microphone Sound Sensor Module

0.80 inc vat

In stock

Estimated Delivery Time: Within 24 hours

or

Have any Questions?

Feel free to Get in touch

Pay safely with Visa Pay safely with Master Card Pay safely with PayPal Pay safely with Maestro
Guarantee Safe and Secure Payment Checkout

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
5V +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-038 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);
}
KY-038 Small Microphone Sound ...

0.80 inc vat

In stock