Making a piezo buzzer louder


I recently bought this mini speaker from Pimoroni to use with my BBC:Microbit.
I’m trying to create a loud beep but the audio level is disappointingly low but according to the data sheet it has a typical output of 95db. To test it I’ve been using this simple code and it’s so faint:

import music

Am I doing something wrong? ( I read somewhere that buzzers/speakers have a resonate sound which might make it louder if I knew what that was).

Many thanks,



It’s likely a combination of two things, the low output signal of the Micro Bit and the “mini” speaker.
I switched to this, and its not bad. It’s like whats in those talking greeting cards.
You still won’t get really loud sound unless you switch to an amplified speaker though, Maybe something like this,
I say “maybe” because I don’t currently own one.

The one you linked too looks more like a piezo buzzer than speaker. It states it audible around the 2K Hz range so try sounds more at that frequency.


Great. Thank you for the advice. I’ll give this a go,


How are you powering your Micro-Bit? I ask because when powered by USB you are very limited by how much current you can draw. You’ll get much better results if powered by batteries via the JST jack.
Scroll down to the power supply section. Basically, if you power it via the USB port, 5V gets regulated down to 3V , but that regulator is very limited in how much current it can supply. Power it via the battery jack and you bypass the regulator. There are still some limits on current per output pin but your total current draw can be a lot more if running on battery.


Looking at the product page, you might be better off trying to drive it directly with write_analog(511)

This applies a 50% duty cycle which according to the product page should get you closer to the 95dBA you’re looking for.

Here’s the link to Microbit’s PWM docs for reference.


I’ve only ever done the . And to be honest, I haven’t touched my Micro-Bits in ages. Might be time to dust them off and get back at it.


Thanks for the suggestion to try using write_analog(511). I’ve read the docs but am struggling with code, how to actually play a tone using write_analog(511)? Any clues you could give me?
pin0.write_analog(511) gives me a low buzz.

This gives me an ok tone that does sound more resonant.
tune = [“C7:40”]


Many thanks. I’ve been using usb but have now been trying with my battery pack. Still working on the code to try and make a tone before I know if it’s louder.


Just compared my Piezo buzzer from this kit, with the thin mini speaker I have and loudness wise they are about the same. The speaker definitely sounded better but wasn’t really any louder. Not that my ears could tell. I can hear it quit plainly from a few feet away though.,pin=microbit.pin0, wait=True, loop=False)


Mine is definitely a buzzer more so than a speaker. If I connect it to the +3V and ground it emits a continuous tone. So that explains why my speaker sounds better.
A buzzer is an audio signaling device, which may be mechanical, electromechanical, or Piezoelectric. It produces various audio signal based on the oscillation of the material used in it. They are commonly used in alarms and timers.
The buzzer can be connected to digital outputs, and will emit a tone when the output is high. Alternatively, it can be connected to an analog pulse-width modulation output to generate various tones and effects.