I am currently driving a piezo straight from the arduino's IO, so it only receives a signal from 0 to 5v. But I need to make the beeper louder.
I was told that I should be reversing the polarity at the speaker in order to extended the range of linear motion and make bigger sound waves!
I was wondering if there is an easy electrical circuit that I could build that would allow flipping the polarity to the speaker instead of a simple 0 to 5v square wave?
The piezo is connected between the Arduino output and the collector of the transistor.
When the Arduino output goes LOW: the right hand side of the piezo is at +5 (transitor is turned OFF) and the left hand side is at 0V.
When the Arduino output goes HIGH: the right hand side of the piezo is at 0V (transistor is turned ON) and the right hand side is at 5V
I see. Thanks Larry. I got off the track in thinking it was a DC buzzer, and was just thinking that the initial issue was the arduino output (OP's circuit) didn't have enough current to drive the DC buzzer.
But looks like it's an AC buzzer/speaker. Thanks for replying Larry.
Should also be possible by connecting the piezo between two Arduino output pins.
And switch the pins in opposite phase.
Not sure how to code that fast enough though.
Add a 100ohm (current limiting) resistor in series with the piezo.
Leo..
@LarryD,
I see how that reverses polarity across the piezo but not sure why you call that a 10V change when such a change requieres a difference of potential of 10V (0V to 10V or -5V to +5V). I understand that your circuit accomplishes the polarity reversal requested by the OP but just don't understand you call that "a 10V change".
@Megabucks,
The bottom waveform you posted is not valid. A waveform has a starting point and a "HIGH" voltage level determined by the Vcc of the Logic circuit . The output high cannot be equal to the output LOW. If the sígnal starting at 5V and increases, the HIGH voltage level must be > the LOW voltage level. The bottom waveform you posted would only make sense if the LOW voltage was -5V. ( and the líne in the center represented the 0 V level.)
raschemmel: @LarryD,
I see how that reverses polarity across the piezo but not sure why you call that a 10V change when such a change requieres a difference of potential of 10V (0V to 10V or -5V to +5V). I understand that your circuit accomplishes the polarity reversal requested by the OP but just don't understand you call that "a 10V change".
Remember your ground (reference) is switching from one side of the Piezo to the there side.
Different situation but similar mind game:
Look a the Vgs turn on voltage of a MOSFET
N-channel needs +Vgs
P-channel needs - Vgs
How then can I get a -Vgs out of a +5 volt Arduino system?
Answer, highlight the next line:
Next Line: Turn the MOSFET on its head, i.e. source to +5V drain to 0 volts.
raschemmel: @LarryD,
I see how that reverses polarity across the piezo but not sure why you call that a 10V change when such a change requieres a difference of potential of 10V (0V to 10V or -5V to +5V). I understand that your circuit accomplishes the polarity reversal requested by the OP but just don't understand you call that "a 10V change".
Its 10V peak-to-peak AC signal instead of 5V peak-to-peak AC signal. Heard of bridge-mode?
Ok, then it's because the ground reference switches it means that it is -5V across the piezo when the GND reference is +5V and + 5V when the GND ref is 0 V, but at any given point in time does it ever have 10V across the piezo ? Bridge mode means a motor has either Vcc or -Vcc across it, not 2x Vcc .
Think of a speaker with a tone 10Vpp applied.
There is +5v across the speaker during the positive side of the waveform then -5v during the other.
You never have 10 across it at any one time but the paper cone is stilled 'pushed' out then 'pulled' in.
Similar would be the effect on the piezo.
(note with DC switching, level change is an instantaneous, almost, from one level to the other, could you then argue there was 10 volts across the piezo )
It is basically a 10 Volt voltage swing, with zero in the middle. So at one extreme, it sees an instantaneous 5 Volt, and the speaker material is forced in one particular direction. At the next switching event, the voltage is -5 Volt, so the speaker material is forced in the 'other' direction.
Does the frequency matter ?
I cannot think of a reason why it would.
Also, was my question a "valid" one ?
Intuitively, one would think there is only 5 volts across the piezo.
However, when you realize both sides are switching levels then it should be clear that there is a wider voltage influence being felt by the piezo.