RAK 18001 buzzer overheating

Hi,
I am using one of these devices - I thought successfully. But I’ve had 2 fail on me (or at least stop producing a tone). A colleague noticed that the buzzer was getting very hot on his system so I checked it out with a third device on my set up.
The buzzer uses 300mA. And it is continuous. This seems excessive. Is there a fault with the device or is it the way I am using it?
My code is trivial:

#include <Arduino.h>
#include “main.h”

#define BUZZER_CONTROL WB_IO3

void init_buzz()
{
pinMode(BUZZER_CONTROL,OUTPUT);
}
void buzz(int note, int duration)
{
tone(BUZZER_CONTROL, note);
delay(duration);
noTone(BUZZER_CONTROL);
}

I am using it to output a short (200ms) beep each minute.

Thanks
Alan

The schematic is quite simple:
image
Not sure where it could burn 300mA’s.
And your code is very similar to the example code and to a code that I used in one of my projects.

You use WB_IO3, so you have the RAK18001 in slot C. Do you have any module in the IO slot?

Presumably, if you applied a steady voltage to the base of the transistor - rather than a square wave - then it can draw whatever the resistance of the ‘speaker’ allows.
I have a GNSS module on slots A & B and nothing on slot D. And without the buzzer it draws 55mA when the GPS is searching for a fix and 5mA when the GPS is returned to ‘off’ mode.

Alan

I just checked my code GitHub - beegee-tokyo/WisBlock-RAK12003-IR: Example project using WisBlock system to create a contactless IR temperature sensor. where I used the buzzer. It is battery supplied and works for weeks from an 1000mAh battery, so it must have low consumption.

Just to check, can you put a digitalWrite(Buzzer_Control, LOW) ; after noTone(BUZZER_CONTROL);

I’ve only just seen this reply.
That worked.
I also added it in the init code:

#define BUZZER_CONTROL WB_IO3

void init_buzz()
{
pinMode(BUZZER_CONTROL,OUTPUT);
digitalWrite(BUZZER_CONTROL, LOW);
}
void buzz(int note, int duration)
{
tone(BUZZER_CONTROL, note);
delay(duration);
noTone(BUZZER_CONTROL);
digitalWrite(BUZZER_CONTROL, LOW);
}

Thanks
Alan

Good, but it is strange.
I don’t have the digitalWrite(BUZZER_CONTROL, LOW); in my code and I do not have the excessive power consumption.

Seems noTone(BUZZER_CONTROL); doesn’t care what is the latest status of the PWM signal (Low or High) and in your case it ends up in High status.

But it is good you found it. We have to change our example codes and make sure that the GPIO is set to low after noTone(BUZZER_CONTROL);

Thank you. And now I am reliefed that we do NOT have a hardware problem.

Glad to be able to help.

Just need to buy 2 more buzzers.

Alan