KY-038 Mini Voice Sound Detection Sensor Module – Microphone Sound Sensor for Arduino & ESP32
The KY-038 Mini Voice Sound Detection Sensor Module is a compact and easy-to-use microphone sensor designed to detect sound, noise, claps, and other acoustic events in electronic projects.
Featuring an electret condenser microphone and LM393 comparator, the module provides both analog and digital outputs, allowing microcontrollers to monitor microphone signal variations and detect sounds that exceed an adjustable threshold.
The KY-038 is ideal for Arduino, ESP32, Raspberry Pi, sound-activated switches, robotics, interactive lighting, alarm systems, and DIY electronics projects.
With its adjustable detection threshold and simple 4-pin interface, the module is particularly suitable for educational experiments and basic sound-triggered automation.
Key Features
-
Model: KY-038
-
Sensor Type: Microphone Sound Detection Module
-
Microphone: Electret Condenser Microphone
-
Comparator IC: LM393 or Equivalent
-
Output Types: Analog (AO) and Digital (DO)
-
Operating Voltage: Typically 3.3V–5V DC, Module Dependent
- Adjustable Sound Detection Threshold
- Onboard Adjustment Potentiometer
- Digital Sound Detection Indicator LED
- Compact PCB Design
-
4-Pin Interface: AO, GND, VCC, DO
- Low Power Consumption
- Suitable for Arduino, ESP32, and Microcontroller Projects
Technical Specifications
| Parameter |
Specification |
| Model |
KY-038 |
| Product Type |
Mini Microphone Sound Detection Sensor |
| Sensor Technology |
Electret Microphone |
| Microphone Type |
Electret Condenser |
| Comparator IC |
LM393 or Compatible |
| Operating Voltage |
Typically 3.3V–5V DC |
| Output Types |
Analog and Digital |
| Analog Output |
AO |
| Digital Output |
DO |
| Digital Output States |
HIGH / LOW |
| Detection Threshold |
Adjustable |
| Adjustment Method |
Onboard Potentiometer |
| Number of Pins |
4 |
| Pin Configuration |
AO / GND / VCC / DO |
| Indicator |
Onboard Detection LED |
| Typical Board Dimensions |
Approximately 32 × 17mm, Variant Dependent |
| Interface |
Analog ADC / Digital GPIO |
| Communication Protocol |
None |
| Calibrated dB Measurement |
No |
| Audio Recording |
Not Recommended |
Pin Configuration
| Pin |
Function |
| AO |
Analog Microphone Signal Output |
| GND |
Ground |
| VCC |
Positive Power Supply |
| DO |
Digital Sound Detection Output |
Note: The physical pin order may differ between manufacturers. Always follow the labels printed on the module.
How It Works
The KY-038 uses an electret microphone to convert sound waves into small electrical signals.
When sound reaches the microphone, the generated electrical signal changes according to the acoustic vibrations.
The module provides two different output signals.
Analog Output (AO)
The analog output provides a varying voltage associated with the microphone's electrical response.
A microcontroller with an analog-to-digital converter (ADC) can sample this signal to observe changes caused by sound.
However, the analog output is not calibrated and may have a limited signal amplitude.
Digital Output (DO)
The onboard LM393 comparator compares the microphone signal with a reference threshold.
The threshold can be adjusted using the onboard potentiometer.
When the microphone signal crosses the selected threshold, the digital output changes state, allowing the microcontroller to detect a sound event.
The onboard indicator LED typically changes state when the comparator output is activated.
Arduino Connection Example
| KY-038 |
Arduino Uno |
| VCC |
5V |
| GND |
GND |
| AO |
A0 |
| DO |
D2 |
This connection allows the Arduino to monitor both the analog microphone signal and the digital sound detection output.
Arduino Example Code
const int analogPin = A0;
const int digitalPin = 2;
void setup() {
pinMode(digitalPin, INPUT);
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(analogPin);
int digitalValue = digitalRead(digitalPin);
Serial.print("Analog Sound Value: ");
Serial.print(analogValue);
Serial.print(" | Digital Detection: ");
Serial.println(digitalValue);
delay(20);
}
Expected Behavior
- The analog reading may change as sound reaches the microphone.
- The digital output changes when the microphone signal crosses the adjusted threshold.
- Turning the potentiometer changes the digital sound detection threshold.
- The onboard indicator LED helps identify detection events.
Important: The digital output polarity depends on the module version. Test the sensor before assuming HIGH or LOW represents sound detection.
Applications
- Arduino Sound Detection Projects
- ESP32 Sound-Activated Systems
- Clap-Activated LED Experiments
- Sound-Triggered Alarm Systems
- Interactive Robotics
- Noise Event Detection
- DIY Home Automation
- Electronic Control Projects
- Educational STEM Experiments
- Sound-Reactive Lighting
- Electronic Prototyping
- Microcontroller Sensor Learning
Important Notes
-
The KY-038 is a sound detection module, not a voice recognition module.
- It cannot identify spoken words or recognize voice commands.
- The module does not directly measure calibrated sound pressure levels in dB or dBA.
- The analog output is an uncalibrated microphone-related signal, not a precise sound intensity measurement.
- The onboard potentiometer adjusts the comparator threshold; it does not necessarily amplify the microphone signal.
- Background noise and electrical interference may affect detection reliability.
- A single clap may generate multiple digital pulses, so software filtering or debouncing may be required.
- The module is not intended for high-quality audio recording.
-
For ESP32, ensure the output voltage does not exceed the 3.3V GPIO and ADC limits.
- Raspberry Pi GPIO pins are not 5V tolerant. Use suitable level shifting when required.
- Raspberry Pi boards require an external ADC, such as the MCP3008 or ADS1115, to read the analog output.
- For speech recognition, audio recording, or advanced sound processing, use a dedicated digital microphone module.
Package Includes
1 × KY-038 Mini Voice Sound Detection Sensor Module