as it turns out there are small cartridge beepers / buzzers that looks like beepers / piezos but they are actually small magnetic speakers
http://ya-tu.com/eProductView.Asp?ID=38
https://www.aliexpress.com/wholesale?ca … zzer+12085
i happened to find a similar piece at my local electronics parts retailer and bought one that looks similar
in testing it out i’m getting about 50 ohms across. i’d imagine that that’s due to very fine copper wires being used
in testing them out they are rather loud, with it loudest at around 2.5khz
my piece work on a maple mini using tone() to drive it from a pwm pin
however, i’m not very careful as i later found that driving it from a gpio pin is sourcing some 60ma from that pin (3v / 50ohm)
the specs say gpio pins 20ma and 25ma abs max, looks like stm32f103 can stand quite a bit of abuse huh?
https://www.st.com/resource/en/datasheet/cd00161566.pdf
i’d think paring it up with a transistor would be necessary but i’m yet to test that out
a piezo would probably have much higher resistance and alleviate the need of a separate transistor
a design as such isn’t really good as a speaker even if it is magnetic as i think it is intended to exploit helmholtz resonance.
https://en.wikipedia.org/wiki/Helmholtz_resonance
https://newt.phys.unsw.edu.au/jw/Helmholtz.html
this makes the frequency response non-linear with it being the loudest at the resonant frequency of the cavity
very much a beeper driven magnetically
the beeper is connected in a common collector setup, i.e. in place of Re
https://en.wikipedia.org/wiki/Common_collector
the spice simulation looks like this

- v2.png (20.01 KiB) Viewed 566 times
i actually used a common collector circuit partly as i thought i’d not need to invert the signals. hence, when the pin is off the beeper is off as well.
https://en.wikipedia.org/wiki/Common_emitter
I looked at common emitter again and actually wondered if placing the beeper in place of Rc (rather than across the transistor to ground) would after all be a better setup. a point is that i’d prefer that the transistor and beeper is off when Vin is off/low.
But it seemed the common collector setup seem to have some advantage in that the beeper coil resistance would effectively work as the emitter resistor for negative feedback as well.
and to test it out i setup some entertainment with stm32duino
RTTTL player ported to stm32duino
https://github.com/ag88/stm32duino_rtttl
and an early seasons greetings
![]()
Ray
and the other part is the use of *square* waves which absolutely trashes the music whatever melody you play
[ag123 – Wed Dec 05, 2018 4:03 pm] –
that is partly the fault of the beeper, build into a 12 mm helmholtz resonator can it will sound funny no matter how well you tweak it
and the other part is the use of *square* waves which absolutely trashes the music whatever melody you play
![]()
WOW.
You make it sound like a hardware problem? Imagine the mountain the 1st engineer had to climb to put those little speakers into cell-phones and actually, somehow, made it play acceptable music.
Maybe they just need a baffle:

Ray



