Skip to content
A

Audio

Interfacing Sound Sensor Audio with Arduino Uno

What is the Sound Sensor?

Sound Sensor practical reference

The KY-038 is a small electret-microphone breakout that provides both a digital and an analog output for detecting sound. The digital output flips when volume crosses an adjustable threshold set by an onboard potentiometer, ideal for simple clap-switch or knock-detector projects, while the analog output tracks the raw waveform/envelope for more nuanced sound-reactive builds like level meters or beat-triggered lighting.

Key specifications

  • Sensor type: Electret condenser microphone with onboard LM393 comparator
  • Operating voltage: 3.3V–5V DC
  • Digital output (DO): Goes LOW when detected sound exceeds the threshold set by the onboard potentiometer, HIGH otherwise (some boards invert this)
  • Analog output (AO): Continuous analog signal proportional to the microphone's raw audio envelope
  • Sensitivity adjustment: Onboard trimmer potentiometer sets the digital-trigger threshold
  • Detection range: Best for close-range sounds (claps, knocks, voice) within roughly 0.5-1m
  • Interface: 1 digital pin (threshold trigger) + 1 analog pin (raw signal)

Pinout and connection notes

Turn the onboard potentiometer clockwise/counter-clockwise while testing with a clap to tune the digital trigger sensitivity — too sensitive and it fires on background noise, too insensitive and it misses claps. For beat-detection or volume-level projects, use the analog output instead and do the thresholding in software.

  • VCC: Power, 3.3–5V DC
  • GND: Ground
  • DO: Digital output — threshold-triggered HIGH/LOW sound detection
  • AO: Analog output — raw microphone signal, read with analogRead()

Integration checklist

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.

Troubleshooting and reproducibility

Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.

Setting Up Sound Sensor with Arduino Uno

Library

None — built-in analogRead/digitalRead by —

No library needed; uses core Arduino functions only.

Wiring

Component pinArduino Uno pinNote
VCC5V
GNDGND
AOA0Analog envelope of the mic signal — read continuously.
DOD2Digital threshold output, set by the onboard potentiometer.

Swipe sideways to see every column →

C++
  • Turn the onboard potentiometer to set the DO trigger threshold — it does not affect the AO reading.
  • AO is noisy and has no fixed units; treat it as a relative loudness level, not a calibrated dB value.
  • For actual clap/sound-detection projects, debounce DO in software — a single loud sound can trigger multiple pulses.

Related Components

Related Guides & Projects