
This circuit consists of a Wemos D1 Mini microcontroller connected to an active buzzer module. The Wemos D1 Mini provides power to the buzzer and controls it through its D1 pin, allowing for programmable sound output.

The Elegoo Passive Buzzer is an audio signaling device that can be used to generate sound waves in a variety of tones. Unlike active buzzers, which have an internal oscillator and generate a tone when powered, passive buzzers require an external signal to produce sound. This makes them more versatile, as they can be used to create different tones and melodies by controlling the frequency of the input signal. Common applications include alarm devices, timers, confirmation or alert sounds in user interfaces, and simple music or sound effects in DIY projects.

This circuit consists of a Wemos D1 Mini microcontroller connected to an active buzzer module. The Wemos D1 Mini provides power to the buzzer and controls it through its D1 pin, allowing for programmable sound output.

This circuit features an Arduino Nano microcontroller that controls a piezo buzzer and a green LED, powered by a 18650 Li-Ion battery through a rocker switch. A pushbutton connected to the Arduino allows user interaction, likely to trigger the buzzer and LED.

This circuit uses a Raspberry Pi 4B to control an LED and a piezo buzzer. The LED is connected to GPIO17 through a 220-ohm resistor, and the piezo buzzer is connected to GPIO27. Both the LED and the buzzer share a common ground with the Raspberry Pi.

This circuit uses an Arduino UNO to interface with two DS18B20 temperature sensors, an HC-SR04 ultrasonic sensor, and an Elegoo passive buzzer. The Arduino reads temperature data from the DS18B20 sensors and distance measurements from the ultrasonic sensor, and it can activate the buzzer based on the sensor inputs. The resistors are used as pull-up resistors for the DS18B20 sensors.
| Pin Number | Name | Description |
|---|---|---|
| 1 | VCC | Connect to the positive supply voltage (5V recommended) |
| 2 | GND | Connect to the ground of the circuit |
// Define the buzzer pin
int buzzerPin = 9;
void setup() {
// Set the buzzer pin as an output
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// Play a tone on the buzzer for 1 second
tone(buzzerPin, 1000); // 1000 Hz frequency
delay(1000); // Delay for 1 second
noTone(buzzerPin); // Stop the tone
delay(1000); // Delay for 1 second
}
Note: The tone() function generates a square wave of the specified frequency (in Hz) on a pin. The noTone() function stops the generation of a square wave on a pin.
Q: Can I use the passive buzzer with a 3.3V microcontroller? A: Yes, the passive buzzer can operate at voltages as low as 1V, but the sound output may be quieter at lower voltages.
Q: How do I change the tone produced by the buzzer? A: Change the frequency of the PWM signal sent to the buzzer. Higher frequencies will produce higher-pitched tones, while lower frequencies will produce lower-pitched tones.
Q: Can I play melodies with the passive buzzer? A: Yes, by varying the frequency of the input signal in a sequence that corresponds to the melody, you can play simple tunes with the passive buzzer.