EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: alank2 on January 30, 2016, 05:16:10 pm

Title: Piezo buzzer questions
Post by: alank2 on January 30, 2016, 05:16:10 pm
Hi,

I've been playing around with driving these to see what I can do with them.  I am using a 5V microcontroller.  I've got a though hole "passive" piezo (the typical cheap round type) from China that has been my test subject.  Right now I have it connected:

VCC - resistor - piezo lead 1
piezo lead 2 - mosfet drain
mosfet source=ground
mosfet gate driven by microcontroller directly

I don't get much sound out of it unless I use a very small resistor.  I am not interested in getting the rated frequency, but want to use it to make a simple tick noise (full on/ full off) and also an error low frequency buzz noise (100hz).

I realize not using it in its range may be why I'm not getting the volume out of it without lowering the resistor, but these are the two sounds I want.

I plan on running the error buzz for 125ms and during this time it uses around 45 mA which seems like quite a bit.

Especially when I see a data sheet like this for something different:

http://www.cui.com/product/resource/cmt-1603-smt.pdf (http://www.cui.com/product/resource/cmt-1603-smt.pdf)

It talks about 3 ma as a maximum - is that advertising what it can do without exceeding 3mA, or is the design of these devices so that you can exceed that without damaging them as long as you remain inside the voltage maximum's?

Thanks,

Alan
Title: Re: Piezo buzzer questions
Post by: uncle_bob on January 30, 2016, 06:14:07 pm
Hi

The piezo buzzer *looks* like a capacitor. If you know it's capacitance and the frequency you are hitting it with, you can come up with an AC current that is going through the buzzer. That's what they are concerned about in terms of damaging the poor little thing.

The "this is to complicated" approach is to simply drop the resistor to the point that the sound is loud enough and see if it blows up. Best bet is that the thing was designed to be pretty loud, so you still will not be damaging it. Of course I have been wrong before ....

Bob
Title: Re: Piezo buzzer questions
Post by: Gyro on January 30, 2016, 07:03:41 pm
I'm confused, you describe it as a "passive" piezo. Do you mean a simple piezo element with no internal electronics, rather than a buzzer?

If so then from the connections you describe, you're effectively driving it with DC... When you turn on the mosfet the drain pulls down to 0V, but when you turn it off there is nothing other than the piezo's internal leakage to pull it back up again (as Bob says, it's mostly capacitive).  Try putting a resistor in parallel with the piezo and you might find that the volume increases dramatically.

If it is a simple small piezo disc then you ought to be able to drive it directly off the micro-controller port. In fact a common way of increasing the volume is to drive it between two outputs toggling in anti-phase, effectively doubling the voltage swing.

None of the above applies of course if it is a (edit: higher current) active electronic buzzer.
Title: Re: Piezo buzzer questions
Post by: dadler on January 30, 2016, 07:21:39 pm
What does your buzzer look like?

Does it look like this:

(https://www.adafruit.com/images/1200x900/1536-06.jpg)

If so, these are active buzzers, with an internal oscillator and current limiting. This type will pull about 25-50mA @ 5V with no current limiting resistor. If you use much resistance, they either go silent or sound "sick". You can't really change the oscillation frequency in these externally.
Title: Re: Piezo buzzer questions
Post by: alank2 on January 30, 2016, 07:52:40 pm
It does not have any drive circuit in it.

I tried putting resistance across it and it is maybe the smallest bit louder with it, but hardly noticeable.

I'll try driving it from the uc directly and see what it does - what are some common drive circuits?

EDIT - I did also add a reversed biased diode.
Title: Re: Piezo buzzer questions
Post by: Gyro on January 30, 2016, 08:13:49 pm
Ideally you should be driving it actively up and down, as in the output stage of a logic gate rather than just in one direction (even with the added resistor). If you're still trying to make it 'tick' at low repetition rate then it probably won't get that loud anyway because there isn't much energy going into it (just the brief capacitive charge and discharge). Try driving it at several kHz, resonant effects help then too.

You don't need to include the reverse biased diode as it doesn't have an inductive component, it's capacitive.
Title: Re: Piezo buzzer questions
Post by: Zero999 on January 30, 2016, 08:19:46 pm
Connected between two I/O pins on the microcontroller and drive each I/O pin with the opposite phase waveform.
Title: Re: Piezo buzzer questions
Post by: alank2 on January 30, 2016, 08:36:13 pm
You don't need to include the reverse biased diode as it doesn't have an inductive component, it's capacitive.

Would that be different than a piezo that has an active driver in it?  I always thought on those you needed the reverse viased diode - or is that for a different type of buzzer?
Title: Re: Piezo buzzer questions
Post by: dadler on January 30, 2016, 08:54:29 pm
There are also specialized piezo drive chips:

http://www.mouser.com/Search/ProductDetail.aspx?R=NJU72501MJE-TE3virtualkey51310000virtualkey513-NJU72501MJE-TE3 (http://www.mouser.com/Search/ProductDetail.aspx?R=NJU72501MJE-TE3virtualkey51310000virtualkey513-NJU72501MJE-TE3)
Title: Re: Piezo buzzer questions
Post by: Gyro on January 30, 2016, 09:18:51 pm
You don't need to include the reverse biased diode as it doesn't have an inductive component, it's capacitive.

Would that be different than a piezo that has an active driver in it?  I always thought on those you needed the reverse viased diode - or is that for a different type of buzzer?

I'm not sure, I guess it's possible that some of them have some sort of L-C arrangement to boost the piezo drive, but I've never seen one. There are also some small buzzers that are magnetic rather than piezo. I guess it wouldn't hurt to include one just in case, but only in the case of a DC powered an active one.
Title: Re: Piezo buzzer questions
Post by: alank2 on January 30, 2016, 09:49:12 pm
I use some "active" piezo in another project and I measured it and it does have a voltage spike when ti turns off, it was up to 60V as I recall so I put a reverse biased diode in there...
Title: Re: Piezo buzzer questions
Post by: Brumby on January 31, 2016, 12:11:45 am
You don't need to include the reverse biased diode as it doesn't have an inductive component, it's capacitive.

Would that be different than a piezo that has an active driver in it?  I always thought on those you needed the reverse viased diode - or is that for a different type of buzzer?

The old-fashioned way of making a buzzer was to wire up a relay with the coil powered through a set of NC contacts.  For that type of buzzer a reverse biased diode across the coil is advised.

Not for piezo.
Title: Re: Piezo buzzer questions
Post by: alank2 on January 31, 2016, 01:43:52 am
I got it working pretty well by using two gpio pins and a resistor.  I sized the resistor to allow 85% of the maximum current the uc pins can handle and it works pretty well.  Thanks everyone.
Title: Re: Piezo buzzer questions
Post by: alank2 on February 01, 2016, 07:10:42 pm
What is the difference between piezoelectric and electromagnetic - mouser lists these types.
Title: Re: Piezo buzzer questions
Post by: Gyro on February 01, 2016, 07:18:11 pm
I think you've got the hang of piezo ones now, in both bare element and active. The electromagnetic involve a coil and a magnetic or at least ferrous diaphragm. Almost always supplied in 'active' form - the 'bare' form would be a small loudspeaker.
Title: Re: Piezo buzzer questions
Post by: alank2 on February 02, 2016, 01:40:34 pm
What are the advantages of each type.  I found both types at around the same price point at Mouser.
Title: Re: Piezo buzzer questions
Post by: Brumby on February 02, 2016, 02:02:22 pm
As mentioned above piezo devices are of two types.

One is the bare transducer - which is just a wafer of piezo material with contacts either side.  It reacts to an applied voltage like this:
(https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/PiezoBendingPrinciple.svg/1340px-PiezoBendingPrinciple.svg.png)

(One set of these + and - signs needs to be reversed!)
... and if you apply DC voltage, then it will just bend in one direction and stay there.  To get an audible tone, you need to apply a voltage that varies.

Which leads us to the second type - an active device, which has an oscillator circuit built in.

Advantages of piezo transducers:
 - low power consumption for high output
 - no back EMF problems
 - lightweight
and when you have access to the oscillator circuitry:
 - can control volume easily
 - can change frequency easily

Electromechanical buzzers are essentially relays wired up to repeatedly turn on and off and they only have one real advantage that I can think of at this moment - you only need a suitable DC power source for them to work.
Title: Re: Piezo buzzer questions
Post by: alank2 on February 02, 2016, 02:15:20 pm
Thanks Brumby - I understand the passive vs. active thing now.

Here is a device that says it is electromagnetic - but since it talks about a square wave I am assuming it is not active with a driver built in:

http://www.mouser.com/ProductDetail/PUI-Audio/SMT-1127-S-R/?qs=%2fha2pyFaduhhFS9%252bGv%2ffsJn54YlgoPEgtA7%2fN8kErx9w1mCUvJ4uTw%3d%3d (http://www.mouser.com/ProductDetail/PUI-Audio/SMT-1127-S-R/?qs=%2fha2pyFaduhhFS9%252bGv%2ffsJn54YlgoPEgtA7%2fN8kErx9w1mCUvJ4uTw%3d%3d)

How does this device differ from a piezo?  Assuming both are passive, what advantages or disadvantages would it have?
Title: Re: Piezo buzzer questions
Post by: Brumby on February 02, 2016, 02:42:14 pm
Apologies!  I've not been paying attention.

That electromechanical buzzer is like a hobbled loudspeaker.  It does need a varying voltage to work, so it is similar to the bare piezo element in that respect.

I don't know enough about this type of product to comment about its advantages, but I think the operating voltage will generally be lower than for piezo transducers.
Title: Re: Piezo buzzer questions
Post by: alank2 on February 02, 2016, 09:03:12 pm
I figured out last night that what I've been using is an electromagnetic type device without any driver in it.

Once I got my hands on a real piezoelectric, I found it doesn't need a resistor and uses much less current.  Another difference is that the PE type can't do a sinewave below 1kHz very well, where the EM type has no issue with it.  The PE can do a squarewave just fine and I tested it at 100 Hz.

Is the EM type more like a speaker?

If the piezo was just the disc you sometimes see, would it make noise or does it need an air chamber of some sort to do that?
Title: Re: Piezo buzzer questions
Post by: Zero999 on February 02, 2016, 09:11:50 pm
The electromagnetic transducer is most likely a moving iron speaker.
https://en.wikipedia.org/wiki/Moving_iron_speaker

16R is too low for a microcontroller to drive which is why you found you needed a resistor. Another option is to drive it with an external transistor but make sure you don't exceed the maximum current/power rating.
Title: Re: Piezo buzzer questions
Post by: alank2 on February 03, 2016, 01:25:27 pm
Thanks Hero999 for that - that is what it looks like from the top all right.

I found this page with lots of info in case any one is interested:

http://dbunlimitedco.com/frequently-asked-questions (http://dbunlimitedco.com/frequently-asked-questions)