PIC - Resistor Value for Driving Piezo Buzzer via PWM

Discussion in 'General Electronics Chat' started by Hurdy, Mar 24, 2014.

  1. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    Hi,

    Thanks for taking the time out to read this post.

    My question is, what value resistor should I use to drive my 3Vp-p piezo buzzer (Multicomp MCABT-401 RC)?

    Here's the datasheet.

    I've been browsing the web for various examples, and came across many examples like the one here.

    As you can see from the image in the link, the piezo is driven by a PWM via 1k resistor.

    This example uses a 1k resistor with a 5V supply. Should I use a different value resistor because mine is being driven by 3V? (I'm using a PIC32MX795F512L - datasheet).

    How would you go about calculating an adequate resistor value for Piezo Buzzer?

    Many thanks,

    Rob
     
    Last edited: Mar 24, 2014
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    The spec sheet states they draw 1mA at 3V, so it seems OK if you don't use a resistor at all. However, I sure don't know what this thing really looks like as a load, so I'd put something in series to limit things. 1K is probably on the high side but as good a starting point a any.

    This is definitely a "try it and see" situation: just because the piezo can take more current then the minimum doesn't mean your ears can.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    The data sheet shows 3V at 1mA. Hence the impedance is approximately 3kΩ.

    You can apply the PWM voltage directly or you can put a resistor in series in order to reduce the sound level. Entirely up to you and everyone within ear shot.
     
    Last edited: Mar 25, 2014
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    It's not a "buzzer" which always have an internal oscillator.

    It is a piezo transducer, with no internal electronics.

    You can drive it fine directly from the PIC output pin, which have a FET resistance of about 50 ohms. If you like, you can put an additional resistor in series (like 100 ohms) but it is not necessary.

    That will be a quiet piezo as its resonance is at 4kHz. And you manually have to send a waveform to it. It's not a good choice.

    Have you considered just getting a piezo buzzer? Then you can just turn the PIC pin HI, and it will beep by itself, at a nice loud resonant frequency. It will be louder than your piezo choice and requires less effort to drive it.

    If you need a piezo transducer (because you want to play music on it etc) then a much better choice would be a lower resonant frequency device, where it's resonant freq is 800Hz or 1.2kHz etc.
     
  5. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    Thank you everyone for your replies.
    Some really good feedback there.

    In all honesty THE_RB I've never worked with buzzers/transducers before.
    I read to use piezo transducers because they require a low current to drive, thus great for batteries and low powered micro controllers.

    Simply I'm looking for a way to produce a nice beep sound to give feedback to the user when an event occurs. It doesn't need to produce different tones for different situations. Just a nice, simple and loud enough beep.

    So for a simple and loud enough beep that can be driven simply by a PIC port, would you advise that I use a Piezo Buzzer or Piezo transducer?

    Many thanks,

    Rob
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    The transducer will work fine. It takes no current when the PWM signal is idle at 0V.
    You don't have to use that transducer. You can buy the bare disc at low prices from numerous hobby stores.

    example:
    http://www.techsupplies.co.uk/SPE003

    [​IMG]
     
  7. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    So am I correct in thinking that for a:

    Piezo Buzzer - you simpy apply a voltage and it has an internal oscillator to generate the sound.

    Piezo Transducer - You supply a sine/square wave to match the resonant frequency to generate the sound.

    So for this Piezo Buzzer (datasheet) from Farnell I simply need to supply a 3V DC supply and it will generate a tone?

    Or are Piezo Transducer and Buzzers the same thing and I always have to apply a sine/square wave at the given Resonant Frequency?
     
  8. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    Buzzers and transducers are not the same.
    They are as you initially described them.

    Yes, the buzzer in the data sheet requires a constant DC voltage
    It is not difficult to program a MCU to make the transducer give a "beep".
     
    Hurdy likes this.
  9. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Then my suggestion is to pick a piezo buzzer. Most run well under 20mA and are quite loud. Some too loud, you need to stick something on top of the hole.

    A buzzer is much easier to drive because you just set the PIC output pin HI to make it beep. Like this;
    Code ( (Unknown Language)):
    1.  
    2. LATB.F1 = 1;     // pin HI, starts beep
    3. Delay_mS(20);    // beep duration
    4. LATB.F1 = 0;     // end beep
    5.  
    You can still get different beep sounds by changing the beep duration. :)
     
    Hurdy likes this.
  10. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    Thanks guys. Really appreciate it. I will look into Piezo buzzers then if it's a simple case of ON & OFF. Much easier than configuring a PWM.

    If it can also be driven at 20mA then it's a no brainer.

    Many thanks again, really appreciate it.
     
  11. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    Hi everyone.

    Would this piezo buzzer (see datasheet) do the trick by simply applying DC? i.e. no sine/square wave.

    I assume that because it has a Maximum Current of 20mA then I don't need to include a series resistor?

    Many thanks,

    Rob
     
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    "Maximum Rated Current" does not guarantee that at 12V it will not draw more then 20mA.

    "Maximum Rated Current" means that at 12V do not put more then 20mA into this device.

    However, it should be OK with the 3V your PIC is running with.
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    You need a piezo buzzer rated to work at 3.3v. Some 5v models might work.

    I really doubt that you could use a 12v model on a 3v PIC output pin!

    Farnell/Element14/Digikey etc should all have tons of 3.3v DC piezo buzzers in their catalogues. They are a very common item made by many manufacturers.
    :)
     
  14. Hurdy

    Thread Starter Senior Member

    Feb 27, 2006
    137
    0
    Thanks guys, really appreciate it.

    I've found this 3v (max 5V) piezo buzzer (datasheet)

    I think I will put a resistor in series just to make sure it doesn't pull more current than required.

    R = V/I

    R = 3/0.025 = 120 ohms

    Thanks again.
     
Loading...