
Product Introduction #
The buzzer module is an integrated electronic sound emitter that is powered by a direct current source and is widely used in toys, alarms and other electronic products. Buzzer devices are classified into passive buzzers and active buzzers; passive buzzers do not have an oscillation source inside and require a 2K to 5K square wave to drive them; active buzzers are an integrated electronic sound generator driven by a direct current voltage and equipped with an internal oscillation circuit, capable of emitting natural-frequency sounds.
Parameter Specification #
| Parameters | Value/Description |
|---|---|
| Operating voltage | 3.3V~5V |
| Operating temperature | -20°C~+70°C |
| Output signal | Digital signal |
| Size | 3.16cm*2.38cm |

Wiring Diagram #
Note:Expansion board is attached to esp32 controller board.

| Active Buzzer | ESP32 |
|---|---|
| VCC | 5V |
| GND | GND |
| Sign | Pin 5 |
Sample Code #
#define BUZZER_PIN 5 // Active buzzer signal pin (S -> GPIO5)
void setup() {
pinMode(BUZZER_PIN, OUTPUT); // Set buzzer pin as output
void loop() {
digitalWrite(BUZZER_PIN, HIGH); // Turn the buzzer ON delay(500); // Beep for 500 ms
digitalWrite(BUZZER_PIN, LOW); // Turn the buzzer OFF delay(500); // Silence for 500 ms
}
Test Results #
After the program is uploaded successfully, the active buzzer will start to operate, emitting sound in a cycle of 0.5 seconds on and 0.5 seconds off.

Related Resources #