M5Stack Passive Buzzer Unit


Description

Passive Buzzer Unit is a mini passive buzzer unit, drove by 4KHz signal, that sounds up to 72dB within 10cm distance under rating input power. With the feature of compact size, low-power consumption, awesome audio performance, and a protective housing. Applied for varied buzzer alarm scenario.

Features

  • Drive signal:

    • 4KHz oscillation frequency

    • Up to 72dB (within 10cm, at rating power)

    • Drive signal: 4KHz 1/2duty square wave

Applications

  • Buzzer/reminder

Specification

SpecificationsParameters

Drive frequency

4KHz 1/2duty square wave

Power consumption

5V@86mA

Net weight

3.5g

Gross weight

8.5g

Product size

24 * 24 * 8mm

Packing size

93 * 138mm

Pinout

  • BUZZER

M5CORE - PORT BG26

BUZZER

SIGNAL

Schematic

Example

Arduino


#include <Arduino.h>

#define buzzer_pin 26
int freq = 4000;
int ledChannel = 0;
int resolution = 10;

void setup() {
  ledcSetup(ledChannel, freq, resolution);  //Sets the frequency and number of counts corresponding to the channel.  设置通道对应的频率和计数位数
  ledcAttachPin(buzzer_pin, ledChannel); //Binds the specified channel to the specified I/O port for output.  将指定通道绑定到指定 IO 口上以实现输出
  ledcWrite(ledChannel, 512);  //Output PWM.  输出PWM
}

void loop() {
    ledcWrite(ledChannel, 512);  //Output PWM.  输出PWM
    delay(3000);
    ledcWrite(ledChannel, 0);  //Output PWM.  输出PWM
    delay(3000);
}
 

UIFlow

UIFlow Functions

Notice: If you set the BuzzerState first, the Buzzer may not sound. Turn on Buzzer state after setting the frequency.

  • Set buzzer state

    • ON Buzzer on.notice: default frequency is 4,000Hz.

    • OFF Buzzer off.

  • Set frequency of buzzer 20~20,000Hz

Last updated