Piezo buzzer's current consumption confounding me - Page 1
Forum section: electronics / beginners

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 01, 2016, 04:29:03 pm
content: I have been playing around trying to get a handle on the current required to drive a piezo buzzer in various configurations. But, the numbers I'm measuring don't make sense to me - or, rather, seem unrealistically low.First, I tried using an external BJT NPN transistor (a BC337) to drive the piezo, with a 1K resistor in parallel with the buzzer. Current measured at 2.8mA. Next, given that the current was so low, I figured why bother with an external transistor, when I can drive it straight from the MCU's I/O pin? So hooked it up with a 220R series resistor to provide some kind of safe current-limiting just in case, and the same 1K parallel resistor across the piezo. Current measured 2.4mA.However, I then figured that in this configuration the 1K resistor was redundant (when there is a permanent path to ground for the piezo, it doesn't need the resistor to discharge it in the off periods of the frequency cycle, right?), so I removed it and measured again. I was puzzled to see that now zero was registering on my meter.After double-checking everything, I switched the range down from 20mA until it finally did register... around 5uA!Wha? How?Surely a piezo buzzer cannot possibly be using that little current to produce a loud sound? I was expecting something in the low single-digit mA range - the spec sheet for this particular buzzer claims 7mA max. @ 9V p-p 4KHz. If it truly is drawing such a minuscule amount of current, it appears that the current consumption I measured in the earlier iterations was simply that drawn by the parallel 1K resistor (5V @ 50% duty cycle = 2.5V avg, so 2.5V / 1000R = 2.5mA).Is it something to do with a piezo being extraordinarily efficient when driven at its resonant frequency? Or is the square wave signal somehow messing with the reading of my meter?Circuit diagrams below if it helps.

author: MosherIV
author_rank: Super Contributor
timestamp: August 01, 2016, 04:40:43 pm
content: 1st - You did have your meter set to AC current didn't you?2nd - I was reminded recently that most meters only measure AC current up to 1KHz ONLY (check you meter's specifications)3rd - Since the waveform is probably a square wave, the meter need to be a TrueRMS type in order to give true reading since most assume sine wave for AC. (however, due to point 2 - probably redundant anyway)

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 01, 2016, 06:39:38 pm
content: I'm not driving the piezo with AC; DC only, 0-5V 4KHz square wave, 50% duty cycle.Was it not obvious from the circuit diagrams?

author: Seekonk
author_rank: Super Contributor
timestamp: August 01, 2016, 06:40:28 pm
content: Best to drive them with two pins of a micro out of phase. We had a product where we turned a pot to get the resonant frequency for loudest point. About a year later units started coming back. Under a microscope the connections to the crystal has fatigue cracks. Looking at the specs we were driving them at about 50% more voltage. At resonance they are quite efficient but so is your ear to higher frequencies. A Braun tri amped speaker had 60W for bass, 15W for midrange and 1W for tweeter.

author: Kilrah
author_rank: Unknown
timestamp: August 01, 2016, 07:26:10 pm
content: The piezo draws short intense current pulses, your meter can't measure that, especially not in DC mode. AC may give you some results, but with questionable accuracy.

author: MosherIV
author_rank: Super Contributor
timestamp: August 01, 2016, 07:33:48 pm
content: QuoteWhat do you think a 4KHz square is?DC or an AC waveform?So, you got me thinking, how can you measure the average current......Put a decoupling capacitor on the 5V, turn off the waveform and measure the current.Turn on the waveform and measure the current, the difference between the 2 is the avaerage current going into the piezo

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 01, 2016, 07:55:49 pm
content: Quote from: MosherIV on August 01, 2016, 07:33:48 pmWell I say DC because I'm pretty sure technically it'snot ACbecause there's no 'alternating' going on - the current isn't reversing flow, I'm just switching it on and off.But if your point was that the periodic nature of the signal makes it difficult to measure with DC amps mode on a meter, then fair enough. However, my meter doesn't have AC current functionality.It's only a cheapy.Soooo, if there's another way for me to properly measure the current, then...Quote from: MosherIV on August 01, 2016, 07:33:48 pmWhen you say 'turn off the waveform', you mean just continuous 5V? What kind of value and type of cap would I need?

author: MosherIV
author_rank: Super Contributor
timestamp: August 01, 2016, 08:04:07 pm
content: QuoteCorrectQuoteYes, hold the piezo at 5v or 0V .An electrolytic, 10uF or so, anything above that really, it is just to smooth out the AC current and give you an average going into the circuit.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 01, 2016, 09:45:32 pm
content: I tried the capacitor thing, but either I'm doing it wrong or it doesn't work.Didn't have any 10uF electrolytics to hand, so I used a 47uF instead. I arranged things as follows:(The multimeter is 'MR1' in the schematic.)Then I changed my test code to go high on the relevant MCU pin for a couple of seconds, then pause for a second, then do a 4KHz 50% duty cycle square wave for 2 seconds, ad infinitum.I still only got readings in the fractional milliamps. About 0.5mA for the first 'reference' period, then 0.1mA for the 'beep' period.

author: MosherIV
author_rank: Super Contributor
timestamp: August 01, 2016, 10:06:20 pm
content: Try it on the original circuit with the transistor driving the piezo and resistor.

author: MosherIV
author_rank: Super Contributor
timestamp: August 01, 2016, 10:39:59 pm
content: There something bugging me about the way you tried to measure with the capacitor and while brushing my teeth it came to meIt will not work the way you have it because when the micro gpio pin goes low, it discharges the capacitor.The measurement must be done on the voltage supply to the whole circuit. Take the differnce between the piezo off and being driven with the square wave.

author: Seekonk
author_rank: Super Contributor
timestamp: August 01, 2016, 10:51:00 pm
content: Using your very first drawing, try replacing the resistor with an inductor. A common mode AC line inductor from some old low power electronics. Put the coils in series( diagonal connection) and that should give enough inductance and about 10 ohms resistance. That should be loud and low power.

author: dmills
author_rank: Super Contributor
timestamp: August 02, 2016, 01:43:18 am
content: You are missing the trick, the piezo is effectively a series RLC network, and yes when driven with a square wave the CURRENT does oscillate, consider driving the thing WAY below resonance (so that the inductance is not a factor), drive the pin high, current flows into the element, increasing the voltage across the element capacitance, drive the pin low, current flows back OUT of the element discharging the capacitance.Average current IS zero, RMS current is non zero, and average POWER is non zero but the current leads on the voltage by enough to make the real power small.Regards, Dan.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 02, 2016, 06:10:30 pm
content: Quote from: MosherIV on August 01, 2016, 10:06:20 pmAh, gotcha. I tried it with that configuration, and got the following results: 5.31mA during 'reference' period, 3.15mA during 'beep' period, making a difference of 2.16mA.That seems more in line with what I'd expect for running at 5V, given the manufacturer's spec at 9V. But still seems suspiciously close to the current draw of that 1K resistor on its own. Unless this is completely mitigating that - I still can't quite get my head around what it is about using a capacitor like this that makes the measurement possible.Quote from: MosherIV on August 01, 2016, 10:39:59 pmNot particularly feasible, as I'm doing these experiments with an Arduino board powered over USB alone, so kinda hard to measure at the point of overall supply. One of those USB power measurement gadgets, would be handy, really.This is all a bit of an academic exercise anyway; I was only curious as to how little, approximately, the piezo would draw so that I could guesstimate how small of a 5V regulator I could get away with for powering my micro and all it's accompanying peripheral devices. Looks like it all going to be way below 100mA, which any old 7805 should handle, so all's good in that respect.Quote from: Seekonk on August 01, 2016, 10:51:00 pmI don't need it to be any louder. It's perfectly loud for my purposes as-is. That's also why I'm not bothering with driving it with a 'push-pull' configuration using two micro pins.Quote from: dmills on August 02, 2016, 01:43:18 amOkay, I think I understand. In the configuration where the piezo is directly attached to the micro, when the square wave drive is 'off', the piezo element discharges back through the micro pin, so itisalternating direction.