PWM sound effect for embedded MCU

I need to generate sounds using a piezoelectric buzzer for my embedded MCU.

Anybody know of some form of sound library on the net that has different sound effects using PWM?

I need to generate button press sounds and some kind of alarm sounds. Reply correct input with some kind of happy sound and error input with a sad sound :-)

Reply to
karlskogasweden
Loading thread data ...

A piezoelectric buzzer is ill suited to reproducing sounds of many kinds, due to its narrow resonance band. The situation does not change by feeding badly suitable PWM to it.

About the only way to produce messages with it is some kind of Morse code.

--

-TV
Reply to
Tauno Voipio

I agree with your response but I wonder if it might be possible to craft a heavily modified (or not) source audio file (like a voice command) that will sound acceptable on a piezo buzzer.

JJS

Reply to
John Speth

Any sound that could be produced will sound very tinny with the characteristic frequency of the element overwhelming. In addition, the high Q of the buzzer element makes all sounds start and end slowly.

--

-TV
Reply to
Tauno Voipio

Do you have a choice in the transducer being used? I.e., MUST it be a piezo? (You'd have more flexibility with a small speaker)

I think you're going to end up with beeps (at the piezo's fundamental frequency) of various cadences: beeeeeeeeep! beep beep beep beep beep beeeeeeep etc. A piezo is really only good at "getting attention", not conveying information.

Reply to
Don Y

I think it's doable. A rising tone for happy and a falling tone for sad.

Reply to
Paul Rubin

There was an ancient DOS golf game which used the PC piezo sounder to generate speech commentary and other sounds using PWM. It was tinny, but perfectly understandable.

Cheers

--
Syd
Reply to
Syd Rumpo

The PC sounder was not a piezo, but a small speaker connected to the timer chip output.

You can produce rough but understandable sound from a speaker with single bit feed by feeding it with fast enough PWM or sigma-delta.

--

-TV
Reply to
Tauno Voipio

You're right, I stand corrected.

Cheers

--
Syd
Reply to
Syd Rumpo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.