Buzzer YL-44 is getting very hot when IDLE on my ESP32 CAM

Hi all,
i built an doorbell with ESP32 CAM and got an issue with this buzzer;
YL44 Buzzer

As I cant use "tone" on ESP32 this is the (simplified) code that generates the tone:

// BUZZER CONFIG
int pin_buzzer = 1;
const int channel = 15;
const int frequency = 2000;
const int resolutionBits = 12;

void setup() {
  pinMode(pin_buzzer, OUTPUT);
  ledcSetup(channel, frequency, resolutionBits); // BUZZER
  ledcAttachPin(pin_buzzer, channel); // BUZZER
}

void toneSIMPLE() {
      ledcWriteTone(channel, 783);
      delay(500); 
      ledcWriteTone(channel, 0);
      delay(20);
      ledcWriteTone(channel, 659);
      delay(500);
      ledcWriteTone(channel, 0);
}

.. in loop function toneSimple is called when ring button is pressed.
My issue is, that the buzzer is getting very hot when its idle. A simple thermometer shows about 55°C on the surface constantly.

This was my first project with a PCB, here is the layout:

Any thought on this?
What am I doing wrong?
Any help is much appreciated

Link to buzzer datasheet please.

actually no datasheet available.
Heres a schematic:

img_1917

I read in another post, that HIGH will turn the buzzer of. So i tried:

void toneOK() { 
digitalWrite (pin_buzzer, LOW); // Turn Buzzer ON
delay (2) ;
ledcWriteTone(channel, 1046); 
delay(150); 
ledcWriteTone(channel, 0); 
digitalWrite (pin_buzzer, HIGH); // Turn Buzzer OFF
} 

but still above 50 degrees on surface when idle

If Vcc of the controller is 5 volt this would work. If controller Vcc is 3.3 volt it will not shut off the transistor.
Measure the voltages at the transistor base. Measure the voltage across the buzzer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.