# How do you control the loudness level of a piezo buzzer?

#### steven334

Joined Aug 9, 2011
37
How do you control the loudness level of a piezo buzzer?
thanks steven

#### iONic

Joined Nov 16, 2007
1,662
Here's one way, but let hope it not the easy way!
How-to-Amplifying-a-Piezo-Speaker-and-Volume-Control

Here's some more general info:
What is a piezo buzzer ?

It's a "component" with a material having piezoelectric ability. Piezoelectricity is the ability for a material to produce voltage when it get distorted. The reverse is also true: when you produce a voltage, the material gets distorted. When you stop producing a voltage, it gets back to its original shape. If you're fast enough with this on/off voltage setting, then the piezo will start to oscillate, and will produce sound. How sweet...
Constant duty cycle ? Why ?

So we now know why we need to vary the frequency. This will make the piezo oscillates more and less, and produces sounds at different levels. If you produce a 440Hz frequency, you'll get a nice A3.
But why having a constant duty cycle ? What is the role of the duty cycle in this case ? Remember: when making a piezo oscillate, it's not the amount of volts which is important, it's how you turn the voltage on/off1:

when setting the duty cycle to 10%: during a period, piezo will get distorted 10% on the time, and remain inactive 90% on the time. The oscillation proportion is low.
when setting the duty cycle to 50%: the piezo is half distorted, half inactive. The oscillation proportion is high, because the piezo oscillates at the its maximal amplitude, it's half and equally distorted and inactive.
when setting the duty cycle to 90%: the piezo will get distorted during 90% of a period, then nothing. The oscillation proportion is low again, because the proportion between distortion and inactivity is not equal.

So, to summary, what is the purpose of the duty cycle in our case ? The volume ! You can vary the volume of the sound by modifying the duty cycle. 0% will produce no sounds, 50% will be the max volume. Between 50% and 100% is the same as between 0% and 50%. So, when I say when need a constant duty cycle, it's not that true, it's just that we'll set it at 50%, so the chances we hear something are high

#### strantor

Joined Oct 3, 2010
6,783
I have a simple continuity checker with a 9V battery and a piezo buzzer. when I put the leads across a high resistance, the sound is very faint. So, I suspect the volume is related to current and you could vary the volume down with a high value pot

Last edited:

#### steven334

Joined Aug 9, 2011
37
so how do i control the duty cycle?

#### steven334

Joined Aug 9, 2011
37
sorry i didnt see the link

#### iONic

Joined Nov 16, 2007
1,662
so how do i control the duty cycle?
Do you have a circuit with this Piezo buzzer to post here. .png is preferred.

#### CDRIVE

Joined Jul 1, 2008
2,219
Do you have a Piezo Buzzer or a Piezo Element? They are not the same. If your Piezo operates directly from a DC supply then you have a Piezo Buzzer, also called a Sonalert.

#### Audioguru

Joined Dec 20, 2007
11,248
A piezo beeper (it beeps at a high frequency, it does not buzz at a low frequency) has a built-in oscillator and runs from DC. Its loudnes is determined by the DC voltage.
A Piezo transducer is a small speaker (like used in the amplifier/volume control article) and runs from the AC from an amplifier.

#### CDRIVE

Joined Jul 1, 2008
2,219
A piezo beeper (it beeps at a high frequency, it does not buzz ......
Uhhh, yeah.

#### WBahn

Joined Mar 31, 2012
30,012
So, to summary, what is the purpose of the duty cycle in our case ? The volume ! You can vary the volume of the sound by modifying the duty cycle. 0% will produce no sounds, 50% will be the max volume. Between 50% and 100% is the same as between 0% and 50%. So, when I say when need a constant duty cycle, it's not that true, it's just that we'll set it at 50%, so the chances we hear something are high
I don't buy this. The diaphram only makes sound when it is moving. Regardless of the duty cycle, the diaphram moves twice each cycle. The only way to vary the sound intensity (okay, not the ONLY way, but from a simple driving signal standpoint) is to either increase the amount of the deflection or increase the speed of the deflection. The first involves applying a greater voltage while the second involves driving it with a lower impedance to reduce the RC time-constant involved. I would think that controlling the voltage is the more practical way for most simple circuits.

#### THE_RB

Joined Feb 11, 2008
5,438
WBahn that's not totally true.

The piezo resonates (flexes) at a much lower frequency than the digital transitions. So with a very short duty cycle the material has not had enough time to flex very far before being reversed. Basically it acts as a low pass filter which will reduce the sound level as the PWM moves away from the ideal 50% (as 50% duty causes the maximum possible deflection of the element).

It's common in microcontroller use to vary the PWM duty to the piezo element to get different sound volume levels.

#### WBahn

Joined Mar 31, 2012
30,012
Okay, I can see that. But it would seem to make the choice of drive frequency pretty critical.

#### THE_RB

Joined Feb 11, 2008
5,438
Yep that's right re the frequency vs loudness, especially since most piezo elements have a resonant frequency where they are much louder.

Cheap piezos are only really suitable for alerts and simple tunes etc.