small beepers/buzzers that are actually tiny speakers – RTTTL player ported to stm32duino

ag123
Sat Nov 03, 2018 5:52 pm
this is probably off-topic but it is rather general, recently i’m needing a beeper / buzzer and start browsing ebay/aliexpress.
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? :lol:
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


ag123
Sun Nov 04, 2018 1:34 pm
ok i did a little follow up and some tests with a transistor

the beeper is connected in a common collector setup, i.e. in place of Re
https://en.wikipedia.org/wiki/Common_collector
Image

the spice simulation looks like this

v2.png
v2.png (20.01 KiB) Viewed 566 times

ag123
Sun Nov 04, 2018 2:44 pm
on a side note, my guess is given the high currents, high power consumption, one may prefer to look for a piezo beeper instead, interestingly the above high current, high power consumption beeper is one of the cheaper ones around on aliexpress. while i hardly find piezo beepers of the same size and price range, i’m not too sure why. Perhaps that high current, high power consumption beeper is quite commonly used and hence mass produced in volume or in a worse case the good piezo beepers are diverted to the ‘real’ electronics and the cheap high consumption beeper dumped for the arduino fans. oh it is rather loud, maybe that explains the use of electromagnetic higher power consumption design as well :lol:

fredbox
Sun Nov 04, 2018 3:42 pm
Place a capacitor in series with a speaker to eliminate the high DC currents. Try about 10 uf with the positive side of the cap going to the emitter of the transistor or directly to the digital output pin. With the capacitor in place, you have current during the transition from 0-1 or 1-0 but no current once the pin is high or low.

ag123
Sun Nov 04, 2018 3:47 pm
thanks i’d try that sometime later as i’ve taken apart the pieces :lol:
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
Image
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.

ag123
Thu Nov 29, 2018 1:15 pm
ok my cheap beepers arrived.
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

:lol:


zoomx
Thu Nov 29, 2018 1:36 pm
+1 :lol:

MoDu
Tue Dec 04, 2018 3:22 pm
So you’ve made 2$ 76 MHz ARM-CPU… greeting card? Damn, in the 90’s, I thought buying a greeting card with music for 2$ was the future. :lol:

ag123
Wed Dec 05, 2018 3:19 pm
oh only thing it is better, it plays for you the thousands of RTTTL songs out there in the internet, copy, paste and play, i think polyphonic MIDI ring tones is possible just that that’s a pretty big project to code :lol:

mrburnette
Wed Dec 05, 2018 3:51 pm
Oh, my, that “tingy” sound is really annoying! My grandson has some cheap toys that make a similar raise-the-back-hair sounds, :shock:

Ray


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
:lol:

mrburnette
Wed Dec 05, 2018 4:16 pm
[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
:lol:

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. :lol:

Maybe they just need a baffle:
Image

Ray


ag123
Wed Dec 05, 2018 4:24 pm
that cheap beeper is really a tiny speaker, i’m not sure why they cram it into the format of a helmholtz resonator , maybe some gadget manufacturers told them ‘i want a beeper’ so they make a speaker in the format of a beeper
:lol:

Leave a Reply

Your email address will not be published. Required fields are marked *