The correct way to plug in a buzzer?

Hello,
I’m writing a tutorial for newbs (also as a newb) that describes how to play music using an Arduino and CEM-1203 buzzer. The one thing that I need to confirm is how do I plug it in? Right now I have negative plugged into ground, and this was confirmed in IRC chat. I just wanted a second opinion just to be sure. With a buzzer, does it really matter what side plugs into ground? It has worked for me both ways without exploding… so far.

Thanks for the feedback an advance! :slight_smile:

It does not matter, the buzzer will work either way.

If you use two buzzers on the same signal, I think you might experience some phase problems if not all buzzers are wired together in 'series'. But I do not really know...

The data sheet says:- http://www.sparkfun.com/datasheets/Components/CEM-1203.pdf

That the resistance is 42R on an arduino this gives a peak current of just under 120mA, this is too much for an arduino pin. It says the mean current is 35mA which is within specification but only when outputting a certain frequency. Also it is a magnetic component so it requires a diode across it to block out any back EMF.

I would use the circuit in the data sheet with a transistor. Failing that put a diode across it and connect it up through at least a 100R resistor.

Mike, Would you rather use a piezo buzzer, with lower power consumption than an electromagnetic one, like this one? http://www.tdk.co.jp/tefe02/ef532_ps.pdf Although the datasheet also recommends driving it with a transistor, many schematics use it directly connected to the uC pins. Thanks.

That would certainly cut down on the current requirements. there is a danger of this acting as a microphone and generating a voltage when knocked so I would still use a 100R series resistor just to be on the safe side.

Thanks for the feedback! I'm using this buzzer as it came with my Arduino starter kit. It may not be the most awesome buzzer, but it's common with that kit.

Since this buzzer could potentially generate voltage, do you see it causing damage when plugged in like this to play tones at different frequencies?:

You might enjoy the video feature: http://www.youtube.com/watch?v=bDkPMaorzQU

do you see it causing damage when plugged in like this

To be frank yes, that data sheet says the resistance is 42R and I would not be so cruel to my arduino. That is irrespective of the voltage it could generate.

Is there an advantage of connecting the buzzer to 2 uC pins instead of one pin + ground? Thanks again.

No can't think of one apart from being able to damage two pins at the same time,

that's a saving. ;)

Awesome. I'll add the resistor (or at least a note and photo at the beginning of the tutorial with other notes as I already recorded the video. :P - maybe I can revise, rewrite.... Yes.

So to double check, my connection should look something like this instead?:

Man I need to take an electronics class...

Yep that is it.

Man I need to take an electronics class.

That's what your doing now isn't it? ;)

Indeed it is! :D Thanks for your help Grumpy_Mike. I truly appreciate it. Your assistance will prevent many lashings after posting a tutorial.

One last question if I may (working on answering this myself - I'll post if I get to it first): I have 330 Ohm resistors on hand. How does that compare to a 100R resistor?

EDIT:

I have it figured out. 100R = 100 Ohms, 5R5 = 5.5 Ohms, 3v3 = 3.3 volts. ::)

Thanks to the helpful folks at IRC #arduino, some filler research, and for future reference, here's some broken down info on why a 100R resistor is needed for this buzzer (let me know if my details are off):

The Arduino AVR (automatic voltage regulator) is rated for 40mA (milliamps) of current max.

According to the buzzer documentation, the 'coil resistance' is 42R +- (plus or minus) 6.3

ohms law: voltage = current * resistance

Other turn-arounds of this formula: resistance = voltage / current current = voltage / resistance (we're using this one)

Arduino voltage is 5 volts from USB (correct? does this change with plug up to 12v?)

5 volts / 42R = .119A, or 119mA: That's 79mA too much current.

To fix: 100R resistor + 42R buzzer = 142R

5v / 142R = .352Am, or 35.2mA: That's less than the 40mA of the Arduino AVR: Success!

Ok, so one more question: What effect will 330R/1.3mA have? EDIT: a softer buzz

Thanks for your patience and continued feedback. :)

Yes it looks like you are getting the hang of things. There is a lot to know. It's not very complex but there is a lot of it you have to know all at once.

Just a few minor points:-

The Arduino AVR (automatic voltage regulator)

I think the AVR stands for :- Advanced RISC Architecture, it is defiantly not automatic voltage regulator.

is rated for 40mA (milliamps) of current max.

It is not actually rated for this it is the absolute maximum stress level. In fact the data sheet says:-

Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

So while many people, me included, glibly quote and use 40mA to be safe you should use less than that. In practice I would say 35mA maximum and try and keep it below that.

(correct? does this change with plug up to 12v?)

No when you feed 12V into your arduino there is a regulator that cuts it down to 5V before it gets to the chip. The data sheet says you can power the chip with voltages VCC = 1.8V to 5.5V. There are some restrictions on things like maximum clock speed for the lower voltages. The output voltage from a pin is nominally the Vcc or supply voltage at a Vcc of 5V the data sheet gives the minimum high voltage as 4.2V.

Cool. Thanks again! I should be set.

Hmmm. Sorry to bring this back from the dead (at least it's somewhat fresh, right?...)

In regards to the 'Stresses beyond those listed under "Absolute Maximum Ratings' topic, in the box next to that showing maximum ratings, I see a voltage per pin of .5, not 5 as I mentioned earlier. If that's the case, the math would look like this for just the buzzer/no resistor:

.5 pin volts / 42 buzzer coil resistance = 12 mA (acceptable for Arduino, correct?)

Am I off somewhere? :-/

Thanks, again!

Are you referring to this...

Voltage on any Pin except RESET with respect to Ground -0.5V to Vcc+0.5V

If yes then I interpret that to mean...

The Voltage on any Pin except RESET with respect to Ground cannot go below -0.5V The Voltage on any Pin except RESET with respect to Ground cannot go above Vcc (+5.0V on most Arduinos) + 0.5V

Basically, for 5 volt Arduinos, the voltage on any pin must always be between -0.5V and +5.5V. I'm not certain what that means for output pins but I suspect that limit is meant to be applied to input pins.

If you look at the electrical characteristics you will see the output high voltage (Voh) is guaranteed to be a minimum of 4.2V if you have a supply of 5V. But that is a minimum, you only use a minimum in a calculation if it is the worse case, like you are trying to turn a FET on.

For you the worst case is the too much current, this is given when the pin is outputting the maximum voltage. This is not given in the data sheet so you have to assume the maximum it can be is 5V.

Many thanks!

Here is the resulting tutorial: http://www.budurl.com/buzzer

Best regards,

Haha, that video is great. ;D