Beställt på vardagar före 14:00 = skickas samma dag. 30 dagars ångerrätt

Kopplingsschema och kodexempel

Så här kopplar du Buzzer modul passiv för Arduino till en Arduino UNO eller ESP32, med ett exempel­sketch som du kan ladda upp direkt.

Passive Buzzer Melody Player

This project demonstrates how to generate musical tones with a passive buzzer module using an Arduino Uno. The Arduino outputs variable frequency signals via the tone() function to play a musical scale. Open the Serial Monitor at 115200 baud to see the currently playing frequencies.

Kopplingsschema: Buzzer modul passiv för Arduino på en Arduino UNO
Kopplingsschema · Klicka för att förstora
Kopplingstabell: Buzzer modul passiv för Arduino på en Arduino UNO
Kopplingstabell · Klicka för att förstora
Passive_Buzzer_Melody_Player.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : Passive Buzzer Melody Player
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Buzzer module passief Arduino
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Passive Buzzer Module Demo on Arduino Uno
const int BUZZER_PIN = 9;

// Musical notes in Hertz (C major scale: C4 to C5)
const int notes[] = {262, 294, 330, 349, 392, 440, 494, 523};
const int noteCount = sizeof(notes) / sizeof(notes[0]);

void setup() {
  Serial.begin(115200);
  Serial.println(F("Passive Buzzer Demo Starting..."));
}

void loop() {
  Serial.println(F("Playing scale ascending..."));
  for (int i = 0; i < noteCount; i++) {
    Serial.print(F("Tone: "));
    Serial.print(notes[i]);
    Serial.println(F(" Hz"));
    tone(BUZZER_PIN, notes[i], 150);
    delay(200);
  }

  delay(300);

  Serial.println(F("Playing scale descending..."));
  for (int i = noteCount - 1; i >= 0; i--) {
    tone(BUZZER_PIN, notes[i], 150);
    delay(200);
  }

  noTone(BUZZER_PIN);
  delay(1500);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 Passive Buzzer Melody Player

This example demonstrates how to generate musical tones with a passive buzzer module using an ESP32. The microcontroller uses PWM tone generation to play a sequence of musical notes repeatedly. Connect the buzzer module directly to power, ground, and a GPIO pin to hear the melody.

Kopplingsschema: Buzzer modul passiv för Arduino på en ESP32 DevKit V1
Kopplingsschema · Klicka för att förstora
Kopplingstabell: Buzzer modul passiv för Arduino på en ESP32 DevKit V1
Kopplingstabell · Klicka för att förstora
ESP32_Passive_Buzzer_Melody_Player.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 Passive Buzzer Melody Player
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Buzzer module passief Arduino
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

// Pin connected to the passive buzzer's PWM input
const int BUZZER_PIN = 25;

// Frequencies in Hz for a simple arpeggio
const int melody[] = {262, 330, 392, 523};
const int noteDurations[] = {250, 250, 250, 400};

void setup() {
  Serial.begin(115200);
  pinMode(BUZZER_PIN, OUTPUT);
  Serial.println("ESP32 Passive Buzzer Demo Started!");
}

void loop() {
  Serial.println("Playing melody...");
  
  for (int i = 0; i < 4; i++) {
    tone(BUZZER_PIN, melody[i], noteDurations[i]);
    delay(noteDurations[i] * 1.30); // Pause between notes
    noTone(BUZZER_PIN);
  }
  
  delay(2000); // Wait 2 seconds before playing again
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Produktsäkerhet
Tillverkare
OTRONIC
Meerweg 76A, 2121 VC BENNEBROEK, Nederland
support@otronic.nl
Ansvarig i EU
OTRONIC
Meerweg 76A, 2121 VC BENNEBROEK, Nederland
support@otronic.nl
Säkerhetsinformation
Läs produktinformationen och eventuell manual före användning. Elektroniska moduler och delar är avsedda för personer med teknisk kunskap; förvara dem utom räckhåll för barn. Använd endast angiven spänning och anslut eller koppla inte loss något medan kretsen är spänningssatt. Lämna uttjänt elektronik och batterier till en insamlingsplats; släng dem inte i hushållsavfallet.

Buzzer modul passiv för Arduino

Denna passiva buzzer ger en ton på cirka 85db när den ansluts till en spänning mellan 4V och 8V. För denna passiva buzzer behövs en mikrokontroller för att få buzzern att låta med hjälp av en PWM-signal. Buzzern förbrukar ca. 30mA.

Voltage: 5V

Passar bl.a. Arduino

Mått
Längd: 2,5cm
Bredd: 1,5cm
Höjd: 1,1cm

  • Passiv buzzer
  • Mikrokontroller krävs
  • Ton på 85 dB
  • 2,5 x 1,5 x 1,1 cm

Varför välja denna produkt?

  • Ljud med PWM – Ger ljud via en PWM-signal.
  • Lämplig för Arduino – Kan användas med Arduino-projekt.
  • Brett spänningsområde – Fungerar mellan 4V och 8V.
  • Låg strömförbrukning – Förbrukar cirka 30mA.
Specifikationer
Bredd1,5 cm
Lämplig förArduino
Längd2,5cm
Strömförbrukningca. 30mA
Höjd1,1 cm

Köps ofta tillsammans

Totalt: 33 kr

Recensioner

Inga omdömen än.

Skriv ett omdöme
Ditt omdöme

Frakt & returer

Frakt

  • Paket med spårning85 kr5 arbetsdagar
  • Paket med spårning104 kr5 arbetsdagar
  • Paket med spårning124 kr5 arbetsdagar
  • Paket med spårning130 kr5 arbetsdagar
Allt om frakt

Returer

Inte nöjd? Du har 30 dagars ångerrätt efter leverans för att returnera produkten.

Allt om returer

Tidigare visade

Reflekterande objektsensor QRD1114

Reflekterande objektsensor QRD1114

25 kr
E18-D80NK Infraröd reflektionssensor

E18-D80NK Infraröd reflektionssensor

55 kr
TCRT5000 Reflekterande Optisk Sensor

TCRT5000 Reflekterande Optisk Sensor

6 kr
USB-A breakoutkort

USB-A breakoutkort

8 kr