Pandabyte Buzzer Module
Pandabyte Buzzer Module is a simple actuator module used for learning digital and analog(pwm) output control with microcontrollers such as Arduino compatible boards, ESP32, or Raspberry Pi Pico.
This module uses an active buzzer, meaning it can generate sound directly using a simple HIGH or LOW digital signal without requiring external oscillator circuitry. It can also use PWM signals to generate modulation effects.
A key feature of this module is that it supports two connection methods:
- Traditional 3-pin header for standard jumper-wire connections
- OR
- 4-pin Grove connector for quick plug-and-play prototyping without complex wiring
In this guide, you will learn:
- Module pin configuration
- Digital output control
- PWM output effects
- Tone generation testing
- Circuit connections and Arduino programming examples
Supplies
Hardware:
- PandaByte Buzzer Module
- Development Board (We will use PandaByte xC3m ESP32C3 Dev board)
- Grove Shield/Expansion Board
- Cables: Dupont, USB, and Grove
Software:
- Arduino IDE
Circuit Connections
Perform the connection based on the table.
Programming
Program 1: Simple Beeping Sound
Turn the buzzer ON and OFF repeatedly using a digital signal.
int buzzerPin = 0;
void setup() {
pinMode(buzzerPin, OUTPUT);
}
void loop() {
digitalWrite(buzzerPin, HIGH); // Buzzer ON
delay(500);
digitalWrite(buzzerPin, LOW); // Buzzer OFF
delay(500);
}
Program 2: PWM Beeping Effect Generate a changing buzzer intensity effect using PWM.
int buzzerPin = 0;
void setup() {
pinMode(buzzerPin, OUTPUT);
}
void loop() {
for(int i = 0; i < 5; i++) {
digitalWrite(buzzerPin, HIGH);
delay(100);
digitalWrite(buzzerPin, LOW);
delay(100);
}
delay(1000);
}
Program 3: Tone Function Test
int buzzerPin = 0;
void setup() {
}
void loop() {
tone(buzzerPin, 1000); // 1 kHz tone
delay(1000);
tone(buzzerPin, 2000); // 2 kHz tone
delay(1000);
tone(buzzerPin, 3000); // 3 kHz tone
delay(1000);
noTone(buzzerPin);
delay(1000);
}
Output
Program 1: Simple Beeping Sound
- The buzzer will produce a continuous beep pattern:
- 500 ms ON
- 500 ms OFF
Program 2: PWM Beeping Effect
- The buzzer sound intensity or buzzing effect will gradually change.
- Some active buzzers may produce varying click or modulation effects instead of smooth loudness variation.
Program 3: Tone Function Test
- The buzzer will generate different buzzing patterns at different frequencies.
- Depending on the internal oscillator design:
- some active buzzers may produce slightly different tones
- others may sound almost identical at all frequencies
Important Info
- The module uses an active buzzer which is different than a passive buzzer.
- Active buzzers contain an internal oscillator circuit.
- A simple HIGH signal is sufficient to generate sound in the active buzzer but not in passive buzzer.
- You can connect the IN pin to any GPIO pin that supports digital output for Simple Beeping Sound and tone() programs.
- For PWM program, make sure to connect the IN pin to analog GPIO pin. Otherwise you won't get the expected output.
- Active buzzers are best suited for:
- alarms
- alerts
- notification sounds
- warning indicators