SKU:U132












Unit Buzzer 是一款基于无源蜂鸣器的高效声音反馈单元。它通过外部 PWM 方波信号驱动振膜振动发声,可实现蜂鸣报警与自定义提示音播放。该单元采用 Grove HY2.0-4P 接口通信,内置带保护电路的 NPN 三极管驱动,支持 4KHz 推荐驱动频率与 72dB 清晰声压,并采用 LEGO 兼容孔设计,便于灵活对接 LEGO 结构或使用螺丝固定。适用于报警系统、用户交互提示、智能设备反馈等应用场景。
| 规格 | 参数 |
|---|---|
| 驱动频率 | 4KHz 1/2duty 方波 |
| 功耗 | 5V@86mA |
| 产品尺寸 | 24.0 x 24.0 x 8.0mm |
| 产品重量 | 3.3g |
| 包装尺寸 | 138.0 x 93.0 x 9.0mm |
| 毛重 | 6.8g |
| HY2.0-4P | Black | Red | Yellow | White |
|---|---|---|---|---|
| PORT.B | GND | 5V | Signal | / |
#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);
}