I’m asking not specifically about smoke detectors but any device that beeps but does not make any other, non-beeping sounds. Examples include microwaves, the timers on ovens, the fare system on a bus when you give it your fare, the little beepy heart monitor things in hospitals and old-school digital watches. These things beep but they seem to only beep; they do not make any other, non-beeping sounds.
So my question is: how do these things beep? It must be a speaker right (?), and if it is a speaker then why do these devices never make any other sounds other than beeping? (Because presumably speakers have a greater range than just a few beeps.) Or do these devices have specialized speakers that can only make a few sounds? If so, how do these speakers work?
I’m not sure if I articulated this very well but hopefully that makes sense.


Piezo buzzers have a resonant frequency they’re strongest at. Two-pin piezo disks need driving at the desired frequency. Usually only a GPIO pin (PWM-capable if possible) and a resistor is needed. Three-pin disks provide a phase-shifted feedback to the driving transistor to keep oscillating at the resonant frequency. Some include that whole circuit inside their housing so they have just 2 pins but those are for DC power, only the volume can be somewhat adjusted by changing the input voltage.
The only ones I’ve ever used myself area is the DC variety. Apply power: beeeeep; stop applying power: <sound stops>
I don’t know which ones are more commonly used in consumer electronics.