Codey OnlineArduino- & ESP32-componentenbibliotheek › Buzzer module passief Arduino
Buzzer module passief  Arduino
Sensoren

Buzzer module passief Arduino

Buzzer module passief Arduino Deze passieve buzzer geeft een geluid van ongeveer 85 dB wanneer hij wordt aangesloten op een spanning tussen 4 V en 8 V. Deze passieve buzzer heeft een microcontroller nodig om geluid te maken met een PWM-signaal. De buzzer verbruikt ongeveer 30 mA. Spanning: 5 V. Geschikt voor onder andere Arduino.

Breedte: 25 mm

Pinout — Buzzer module passief Arduino

Pin Signaal Beschrijving
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.

Voorbeeld-aansluitschema — Buzzer module passief Arduino

Van Naar Draad
board:D9 x1:PWM green
board:5V x1:VCC red
board:GND x1:GND black

Voorbeeld-Arduinocode — Buzzer module passief Arduino

Dit voorbeeld is geschreven en compile-gecheckt voor de arduino-uno. Codey Online past het voor je aan naar elk ander ondersteund board.

// 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);
}

Vergelijkbare componenten

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

Bouw je Arduino- of ESP32-project met AI

Beschrijf wat je wilt bouwen. Codey Online schrijft de code, tekent het aansluitschema, compileert het en flasht je board rechtstreeks vanuit de browser.

Gratis starten