Piezo buzzer questions - Page 1
Forum section: electronics / beginners

author: alank2
author_rank: Super Contributor
timestamp: January 30, 2016, 05:16:10 pm
content: 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 1piezo lead 2 - mosfet drainmosfet source=groundmosfet gate driven by microcontroller directlyI 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.pdfIt 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

author: uncle_bob
author_rank: Unknown
timestamp: January 30, 2016, 06:14:07 pm
content: HiThe 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

author: Gyro
author_rank: Super Contributor
timestamp: January 30, 2016, 07:03:41 pm
content: 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.

author: dadler
author_rank: Unknown
timestamp: January 30, 2016, 07:21:39 pm
content: What does your buzzer look like?Does it look like this: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.

author: alank2
author_rank: Super Contributor
timestamp: January 30, 2016, 07:52:40 pm
content: 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.

author: Gyro
author_rank: Super Contributor
timestamp: January 30, 2016, 08:13:49 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: January 30, 2016, 08:19:46 pm
content: Connected between two I/O pins on the microcontroller and drive each I/O pin with the opposite phase waveform.

author: alank2
author_rank: Super Contributor
timestamp: January 30, 2016, 08:36:13 pm
content: Quote from: Gyro on January 30, 2016, 08:13:49 pmWould 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?

author: dadler
author_rank: Unknown
timestamp: January 30, 2016, 08:54:29 pm
content: There are also specialized piezo drive chips:http://www.mouser.com/Search/ProductDetail.aspx?R=NJU72501MJE-TE3virtualkey51310000virtualkey513-NJU72501MJE-TE3

author: Gyro
author_rank: Super Contributor
timestamp: January 30, 2016, 09:18:51 pm
content: Quote from: alank2 on January 30, 2016, 08:36:13 pmI'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.

author: alank2
author_rank: Super Contributor
timestamp: January 30, 2016, 09:49:12 pm
content: 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...

author: Brumby
author_rank: Unknown
timestamp: January 31, 2016, 12:11:45 am
content: Quote from: alank2 on January 30, 2016, 08:36:13 pmThe old-fashioned way of making a buzzer was to wire up a relay with the coil powered through a set of NC contacts. Forthattype of buzzer a reverse biased diode across the coil is advised.Not for piezo.

author: alank2
author_rank: Super Contributor
timestamp: January 31, 2016, 01:43:52 am
content: 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.

author: alank2
author_rank: Super Contributor
timestamp: February 01, 2016, 07:10:42 pm
content: What is the difference between piezoelectric and electromagnetic - mouser lists these types.

author: Gyro
author_rank: Super Contributor
timestamp: February 01, 2016, 07:18:11 pm
content: 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.

author: alank2
author_rank: Super Contributor
timestamp: February 02, 2016, 01:40:34 pm
content: What are the advantages of each type. I found both types at around the same price point at Mouser.

author: Brumby
author_rank: Unknown
timestamp: February 02, 2016, 02:02:22 pm
content: 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:(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- lightweightand when you have access to the oscillator circuitry:- can control volume easily- can change frequency easilyElectromechanical 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.

author: alank2
author_rank: Super Contributor
timestamp: February 02, 2016, 02:15:20 pm
content: 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%3dHow does this device differ from a piezo? Assuming both are passive, what advantages or disadvantages would it have?

author: Brumby
author_rank: Unknown
timestamp: February 02, 2016, 02:42:14 pm
content: Apologies! I've not been paying attention.That electromechanical buzzer is like a hobbled loudspeaker. Itdoesneed 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.

author: alank2
author_rank: Super Contributor
timestamp: February 02, 2016, 09:03:12 pm
content: 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?

author: Zero999
author_rank: Super Contributor
timestamp: February 02, 2016, 09:11:50 pm
content: The electromagnetic transducer is most likely a moving iron speaker.https://en.wikipedia.org/wiki/Moving_iron_speaker16R 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.

author: alank2
author_rank: Super Contributor
timestamp: February 03, 2016, 01:25:27 pm
content: 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