The Active Buzzer Module (RC-A-551) by Robocraze is an audio signaling device that is capable of generating a tone when powered. Unlike passive buzzers that require an AC signal to produce sound, active buzzers have an internal oscillating source and thus will generate sound with a DC voltage. This makes them particularly easy to use in various electronic projects, including alarms, timers, confirmation of user input, and other applications where audio feedback is required.
Pin | Description |
---|---|
VCC | Connects to the positive supply voltage (3.3V to 5V) |
GND | Connects to the ground of the power supply |
I/O | Input/output pin; when driven HIGH, the buzzer sounds |
// Define the buzzer control pin
#define BUZZER_PIN 8
void setup() {
// Set the buzzer pin as an output
pinMode(BUZZER_PIN, OUTPUT);
}
void loop() {
// Turn on the buzzer
digitalWrite(BUZZER_PIN, HIGH);
// Keep the buzzer on for 1 second
delay(1000);
// Turn off the buzzer
digitalWrite(BUZZER_PIN, LOW);
// Wait for 1 second before repeating the cycle
delay(1000);
}
Q: Can I use the active buzzer with a 9V battery? A: No, the active buzzer is designed to operate within a 3.3V to 5V range. Using a 9V battery can damage the component.
Q: How can I change the tone of the buzzer? A: The active buzzer produces a fixed tone due to its internal oscillator. To create different tones, you would need a passive buzzer and generate varying AC signals through the microcontroller.
Q: Is it possible to control the volume of the buzzer? A: The volume of the active buzzer is not directly controllable. However, you can indirectly affect the perceived volume by changing the distance or enclosure around the buzzer. For precise volume control, an external audio amplifier with volume adjustment would be required.
Q: Can I drive multiple buzzers with one microcontroller pin? A: Yes, as long as the combined current does not exceed the microcontroller pin's maximum current rating. It's recommended to use a transistor or a MOSFET as a switch if you need to drive multiple buzzers or if the buzzer's current exceeds the microcontroller's capability.