The KY-012 is a passive piezoelectric buzzer module that produces sound when an AC signal is applied. Unlike active buzzers, which generate sound on their own, passive buzzers require an external signal to produce sound. This makes the KY-012 versatile for various applications where different tones or frequencies are needed.
Parameter | Value |
---|---|
Operating Voltage | 3.3V - 5V |
Current Consumption | < 30mA |
Sound Output | 85dB at 10cm |
Frequency Range | 1.5kHz - 2.5kHz |
Dimensions | 18.5mm x 15mm x 11.5mm |
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V - 5V) |
2 | GND | Ground |
3 | I/O | Signal input (PWM or square wave) |
Arduino UNO KY-012
----------- ------
5V --------------> VCC
GND --------------> GND
Pin 9 ------------> I/O
/*
* KY-012 Passive Buzzer Example
* This code generates a tone on the KY-012 buzzer using PWM on pin 9.
*/
const int buzzerPin = 9; // Pin connected to the I/O pin of KY-012
void setup() {
pinMode(buzzerPin, OUTPUT); // Set the buzzer pin as an output
}
void loop() {
tone(buzzerPin, 2000); // Generate a 2kHz tone
delay(1000); // Wait for 1 second
noTone(buzzerPin); // Stop the tone
delay(1000); // Wait for 1 second
}
No Sound Output:
Low Sound Volume:
Intermittent Sound:
Q1: Can I use the KY-012 with a 3.3V microcontroller?
Q2: What type of signal does the KY-012 require?
Q3: How can I change the tone of the buzzer?
Q4: Is the KY-012 suitable for continuous operation?
By following this documentation, users can effectively integrate the KY-012 passive piezoelectric buzzer module into their projects, ensuring reliable and optimal performance.