Not Working the Buzzer with HAT on Rasberrypi4

Hi Team,



When I used the following buzzer with HAT on Rasberrypi4, it was not worked correctly with the sample code.

https://www.seeedstudio.com/Grove-Buzzer.html

Here is the code which I used on this test.



sudo grove_pwm_buzzer



Note: When I used it on Rasberrypi3, it was worked correctly with the sample code.



Best regards.

Kaka

1 Like

Hi,



Can you check the buzzer by connecting the Data Pin to Raspberry Pi 3.3v and GND to Raspberry Pi GND Pin, by this setup the buzzer makes a sound if not buzzer might be broken? please check and share your findings.

Hi,



Yes, the buzzer was worked.



Best regards.

Kaka

Happy to know that :slight_smile: , Happy Making .

No, the buzzer was worked but if the buzzer was not worked with rasberrypi4 with HAt.



Best regards.

Kaka

Hi,



Have the same problem with the same configuration !?!?

Hi



Yes.



Buzzer on HAT with Raspi3 and basic code : Working

Buzzer on HAT with Raspi4 and basic code : Not working



Best regards.

Kaka

Hi,

Is there any error? also, can you share the code?

Hi



I have just used the default sample code which it was installed by following command.



$ curl -sL <LINK_TEXT text=“https://github.com/Seeed-Studio/grove.p … install.sh”>https://github.com/Seeed-Studio/grove.py/raw/master/install.sh</LINK_TEXT> | sudo bash -s -

$ sudo grove_pwm_buzzer





Best reagrds.

Kaka

Hi all,

No answer to this question yet? I have the same problem, also with Raspi4. I don’t have a Raspi3 to compare, but I already tried a second buzzer with the same results.

I’m new to the Pi and to Python, but I also noticed the print(buzzer.name()) command doesn’t return anything. I also tried the print(buzzer.getVolume), which also returns an error (<bound method Buzzer.getVolume of <upm.pyupm_buzzer.Buzzer; proxy of <Swig Object of type ‘upm::Buzzer *’ at 0xb5ef6818>)

It seems the object is not created (correctly)?

Anyone with a solution?

Thanks, Tiemen

Doesn’t this work?

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
sudo grove_pwm_buzzer

Hi Baozhu.

Thanks for your answer. No, that was what I already did. Even on a complete clean install of Raspian it doesn’t. Here’s the outcome:

Insert Grove-Buzzer to Grove-Base-Hat slot PWM[12 13 VCC GND]

3800
3400
3000
2900
2550
2270
2000
exiting application

No sound at all. The empty line above 3800 triggered me in thinking the buzzer object might not be created correctly, combined with the attempt to getVolume.

Any other ideas?

Thanks, Tiemen

Can you checking the buzzer by connecting the buzzer +ve to raspberry pi 3.3v and buzzer -ve raspberry pi GND and check you getting any sound or something ?

Hi Salman,

Yes, buzzer works with a clean beep. Also when connected to the pwn connector the command: “gpio blink 26” works. (pin 26 being BCM pin 12). Both prove on/off works.

The grove_pwm_buzzer however suggest being able to change te pitch. I was hoping to find out how to do that. That’s why I would like to get that to work.

Any other idea?

Thanks, Tiemen

Good that means Buzzer is working fine, we can check the python code pi! also I found this on the Grove Base Hat for Raspberry Pi Wiki

The audio jack output also uses PWM 0 and PWM 1, so you can't have audio output on that socket and use the PWMs at the same time.

so try to force the audio via HDMI and try again, meanwhile, I check other solution available

1 Like

Recently purchased a new Groove base kit with the buzzer and facing the same issue as Tiemen. I am using RaspberryPi 4 . Any workarounds for this? Or is there a way to check if my PWM port is working fine?

Thanks
Vamsi

Maybe you can use an oscilloscope to look at the waveform of the data.

having the same problem on rpi4. cant use pwm at all with base hat 12 and 13 pins