Codey OnlineArduino & ESP32 component library › Buzzer module passief Arduino
Buzzer module passief  Arduino
Sensors

Buzzer module passief Arduino

Buzzer module passief Arduino This passive buzzer emits a sound of approximately 85dB when connected to a voltage between 4V and 8V. This passive buzzer requires a microcontroller to generate sound using a PWM signal. The buzzer consumes approximately 30mA.Voltage: 5VSuitable for Arduino, among others.

Width: 25 mm

Pinout — Buzzer module passief Arduino

Pin Signal Description
PWM PWM PWM control input from the microcontroller to generate the buzzer tone.
VCC power Positive supply for the passive buzzer module, typically 5V.
GND ground Ground return for the buzzer module and control signal.

Example wiring diagram — Buzzer module passief Arduino

From To Wire
board:D9 x1:PWM green
board:5V x1:VCC red
board:GND x1:GND black

Example Arduino code — Buzzer module passief Arduino

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

// Passive buzzer module example for Arduino Uno
// Plays a simple melody using the module's PWM input.

const int buzzerPin = 9; // Connected to x1:PWM

void setup() {
  pinMode(buzzerPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("Passive buzzer module demo starting...");
}

void playTone(int frequency, int durationMs) {
  if (frequency > 0) {
    tone(buzzerPin, frequency, durationMs);
  }
  delay(durationMs * 1.30);
  noTone(buzzerPin);
}

void loop() {
  Serial.println("Playing C major scale...");

  int melody[] = {262, 294, 330, 349, 392, 440, 494, 523};
  int noteDuration = 180;

  for (int i = 0; i < 8; i++) {
    Serial.print("Note frequency: ");
    Serial.println(melody[i]);
    playTone(melody[i], noteDuration);
  }

  Serial.println("Pausing...");
  delay(1000);
}

Related components

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Build your Arduino or ESP32 project with AI

Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.

Start for free