Documentation

ShillehTek KY-006 Passive Piezo Buzzer Alarm Module for Arduino Projects | ShillehTek Product Manual
Documentation / ShillehTek KY-006 Passive Piezo Buzzer Alarm Module for Arduino Projects | ShillehTek Product Manual

ShillehTek KY-006 Passive Piezo Buzzer Alarm Module for Arduino Projects | ShillehTek Product Manual

manualshillehtekSound Module

Overview

The KY-006 is a small, breadboard-friendly passive piezo buzzer module that lets your microcontroller generate beeps, tones, and simple melodies. Unlike an active buzzer (which plays one fixed tone whenever it's powered), a passive buzzer needs an oscillating signal — so you control the frequency from code with tone() on Arduino or PWM on any other platform. That's what makes it useful for alarms, timer chimes, button feedback, success/error sound effects, and basic music.

The module exposes three pins on a 0.1" header — Signal (S), Power (+Vin), and Ground (-) — and works with both 3.3V and 5V microcontrollers. It draws very little current and can be driven directly from a single GPIO; no transistor needed for typical sound levels.

Pair it with an Arduino, ESP32, Raspberry Pi, or Pico to add audible status feedback to any project: a soil moisture alarm, a button-press click, an oven timer, or a simple keyboard.

At a Glance

Type
Passive piezo buzzer
Operating Voltage
3.3V - 5V
Operating Current
~10-30 mA
Frequency Range
~1.5 - 5 kHz (best 2-3 kHz)
Pin Count
3 pins
Pins
S (Signal), +Vin, GND

Specifications

Parameter Value
Module Type KY-006 passive piezo buzzer
Operating Voltage 3.3V - 5V DC
Operating Current ~10-30 mA (depends on signal level)
Resonant Frequency ~2 kHz (loudest)
Usable Frequency Range ~1.5 kHz - 5 kHz
Sound Pressure ~85 dB at 10 cm
Drive Direct from GPIO (no transistor needed)
Signal Type Square wave / PWM
Pin Count 3 (S, +Vin, GND)
Mounting 2 x M2 holes
Operating Temperature -20 degC to +70 degC
Dimensions ~18 x 15 mm

Pinout Diagram

KY-006 passive piezo buzzer module pinout diagram showing the three pins: Signal (S) for the PWM tone input, Power (+Vin) for 3.3V or 5V supply, and Ground (-)

Wiring Guide

Arduino Wiring

Wire S to a digital pin that supports the tone() function (any digital pin works on AVR Arduinos). +Vin to 5V, - to GND. The middle pin (between S and -) is the same as +Vin internally.

KY-006 Pin Arduino Pin
S (Signal) Digital Pin 8
+Vin 5V
- (GND) GND
Tip: The on-board middle pin is duplicated +Vin for convenience. You can leave it unconnected; only S, +Vin, and GND are needed for operation.

ESP32 Wiring

The KY-006 is happy at 3.3V. Use the ESP32's ledcWriteTone() (or tone() in newer cores) to generate frequencies on any GPIO.

KY-006 Pin ESP32 Pin
S (Signal) GPIO 5
+Vin 3V3
- (GND) GND
Info: Loudness scales with supply voltage. 5V produces the loudest tone; 3.3V is quieter but still clearly audible.

Raspberry Pi Wiring

The Pi can drive the buzzer directly with software PWM, or use hardware PWM on GPIO 18 / 19 for cleaner tones. Use 3.3V supply.

KY-006 Pin Raspberry Pi Pin
S (Signal) Pin 12 (GPIO 18, hardware PWM)
+Vin Pin 1 (3.3V)
- (GND) Pin 6 (GND)
Tip: The gpiozero library's TonalBuzzer class is the easiest way to play melodies on the Pi without managing PWM frequencies manually.

Raspberry Pi Pico Wiring

The Pico's hardware PWM works on every GPIO. Pick any free GP pin for the signal.

KY-006 Pin Pico Pin
S (Signal) GP15
+Vin 3V3 (OUT)
- (GND) GND

Code Examples

Arduino - Play a Two-Tone Beep

ky006_arduino.ino
// KY-006 Passive Buzzer - alternating two-tone beep on Arduino
// Wire S to D8, +Vin to 5V, - to GND

const int buzzerPin = 8;

void setup() {
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  tone(buzzerPin, 1000);   // 1 kHz tone
  delay(250);
  tone(buzzerPin, 2000);   // 2 kHz tone
  delay(250);
  noTone(buzzerPin);       // silence
  delay(500);
}

Arduino - Play "Mary Had a Little Lamb"

ky006_melody.ino
// KY-006 - Play a simple melody using note frequencies

const int buzzerPin = 8;

// Note frequencies in Hz
#define NOTE_C5  523
#define NOTE_D5  587
#define NOTE_E5  659
#define NOTE_G5  784

int melody[]   = {NOTE_E5, NOTE_D5, NOTE_C5, NOTE_D5, NOTE_E5, NOTE_E5, NOTE_E5};
int durations[] = {300, 300, 300, 300, 300, 300, 600};

void setup() {
  pinMode(buzzerPin, OUTPUT);
  for (int i = 0; i < 7; i++) {
    tone(buzzerPin, melody[i], durations[i]);
    delay(durations[i] + 50);
  }
  noTone(buzzerPin);
}

void loop() {}

Raspberry Pi Pico - MicroPython

ky006_pico.py
# KY-006 on Raspberry Pi Pico - PWM tone (MicroPython)
# Wire S to GP15, +Vin to 3V3 (OUT), - to GND

from machine import Pin, PWM
import time

buzzer = PWM(Pin(15))
buzzer.duty_u16(32768)        # 50% duty cycle

for freq in [1000, 1500, 2000, 2500]:
    buzzer.freq(freq)
    time.sleep(0.3)

buzzer.duty_u16(0)            # silence
buzzer.deinit()

Raspberry Pi (Python)

ky006_rpi.py
#!/usr/bin/env python3
# KY-006 on Raspberry Pi - play a tone with gpiozero
# pip install gpiozero

from gpiozero import TonalBuzzer
from gpiozero.tones import Tone
import time

buzzer = TonalBuzzer(18)        # GPIO 18 (hardware PWM)

for note in ["C4", "E4", "G4", "C5"]:
    buzzer.play(Tone(note))
    time.sleep(0.4)

buzzer.stop()

Frequently Asked Questions

What's the difference between a passive and active buzzer?
A passive buzzer (like the KY-006) needs an oscillating signal from your microcontroller — drive it with PWM or tone() and you control the pitch. An active buzzer has its own oscillator and just plays one fixed tone whenever you apply power. Use passive when you want musical notes or variable beep pitches; use active for a simple "is it on or off?" alert.
Why is no sound coming out when I just power it?
That's expected — the KY-006 is passive. It needs a square-wave / PWM signal on the S pin to make sound. Run a basic tone(pin, 2000) sketch to confirm it's working.
Can I drive it directly from a GPIO without a transistor?
Yes. The piezo element draws very little current (~10-30 mA) and can be driven directly from any digital pin on Arduino, ESP32, Pi, or Pico. No transistor or driver IC needed for typical sound levels.
What frequencies sound best?
The KY-006 resonates around 2 kHz, so tones near that frequency are loudest. It can play roughly 1.5 kHz to 5 kHz comfortably; lower or higher tones will be quieter and may sound thin. For musical notes, this means most useful pitches sit in the 5th and 6th octaves of standard music.
Can I make it louder?
Yes — power at 5V instead of 3.3V for higher SPL. To go louder than that, drive a larger external piezo through an N-channel MOSFET, or use a dedicated audio amplifier IC. The on-board piezo can't be made significantly louder than its rated ~85 dB.
Why does the middle pin exist?
It's just a duplicate +Vin pin, provided for convenience when wiring with 3-pin Dupont cables. You can leave it unconnected; the buzzer works with just S and -, plus power on the outer +Vin pin.
Can I play multiple buzzers at once for chords?
Sort of. Each buzzer plays one frequency at a time, so for a chord you need multiple KY-006 modules each driven by a separate PWM-capable GPIO at different frequencies. The result is more "two voice" than rich harmony, but it works for simple melodies.

Related Tutorials