BUZZER UNIT

SKU:U132

描述

BUZZER 是一款无源蜂鸣器拓展单元,采用4KHz频率信号驱动,额定电压供电情况下,10cm内声压等级可达72dB,具有体积小巧,功耗低,发声效果好,自带保护外壳等特点,适用于各类蜂鸣报警场景。

产品特性

  • 驱动信号:
    • 4KHz震荡频率
    • 声压等级 72dB(10cm额定电压下)
    • 驱动信号: 4KHz 1/2duty 方波

包含

  • 1x BUZZER Unit
  • 1x HY2.0-4P线缆(20cm)

应用

  • 蜂鸣报警/提示

规格参数

规格 参数
驱动频率 4KHz 1/2duty 方波
功耗 5V@86mA
净重 3.5g
毛重 8.5g
产品尺寸 24 * 24 * 8mm
包装尺寸 93 * 138mm

管脚映射

  • BUZZER
M5CORE - PORT B G26
BUZZER SIGNAL

原理图

案例程序

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