A buzzer is an audio signaling device that produces sound when an electric current passes through it. It is commonly used in applications where audible alerts or notifications are required. Buzzers are widely utilized in alarms, timers, electronic toys, and various consumer electronics. They are available in two main types: active buzzers, which generate sound when powered, and passive buzzers, which require an external signal to produce sound.
Below are the general technical specifications for a typical buzzer. Note that specific values may vary depending on the manufacturer and model.
The buzzer typically has two pins, as described in the table below:
Pin Name | Description |
---|---|
Positive (+) | Connect to the positive terminal of the power supply or signal source. |
Negative (-) | Connect to the ground (GND) of the circuit. |
For active buzzers, simply applying a DC voltage to the pins will produce sound. For passive buzzers, an oscillating signal (e.g., PWM) is required to generate sound.
Below is an example of how to connect and control a passive buzzer using an Arduino UNO:
// Example code to generate sound using a passive buzzer with Arduino UNO
int buzzerPin = 9; // Pin connected to the buzzer
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
}
tone()
function generates a square wave at the specified frequency (2kHz in this case) on the buzzer pin.noTone()
function stops the sound.delay()
function is used to alternate between sound and silence.No Sound from the Buzzer:
Low or Distorted Sound:
Buzzer Overheats:
Buzzer Does Not Respond to PWM Signal:
Can I use a passive buzzer without a microcontroller?
What is the difference between an active and a passive buzzer?
Can I control the volume of the buzzer?
Is it safe to connect a buzzer directly to an Arduino pin?