Digital Output to a 3V buzzer?

Hey guys, I am completely new to Arduino, and calculating/using resistors in general...

As I understand it, the Arduino Uno's Digital Output pins are 5V, correct? I have a 3V Buzzer I want to power. Since I don't want to blow the buzzer, I should use a resistor, right?

Ohm's law is V=I*R, but this is where I am stuck. Do I use 5 for V, or 3?

I think it would be either a 200 or 300 Ohm resistor, but I'm not sure. Could somebody please explain, in detail, how to calculate this?

Thanks!

Ohm's law is V=I*R, but this is where I am stuck. Do I use 5 for V, or 3?

I think it would be either a 200 or 300 Ohm resistor, but I'm not sure. Could somebody please explain, in detail, how to calculate this?

You are missing information to properly calculate the required resistance. The buzzer draws a specific amount of current when it is powered by 3vdc. Lets just say the buzzer draws 10ma (you really need to find your specific value by datasheet or direct measurement of current) when wired to a fixed 3vdc. An Arduino does output 5vdc if the board is being powered by +5vdc, as there are 3.3vdc arduino boards available. Back to the problem, we require a resistor that will 'drop' 2volts (5-3=2v) and the formula to use is 2volt / .010 = 200 ohms (R=E/I). Keep in mind that you never want to draw more then the 40ma absolute max rating of a output pin, and 20-30ma is a more recommended maximum current limit.

That make sense?

PS: It might also be interesting for you to consider utilizing a pwm output pin for your buzzer, as you would then have the ability to adjust it's volume via software commands rather then just full on or off. Lefty

Thanks, this is what is on the back of the package for the buzzer-

3 VDC 15 mA

I am currently powering the Uno with USB, so i assume it is 5V.

So since the current of the buzzer is 15mA, I would do 2 / .015 = 133.33 ohms?

So since the current of the buzzer is 15mA, I would do 2 / .015 = 133.33 ohms?

You got it. 8-) A 150 ohm is a standard size and should work fine.

Lefty

Okay, thanks...

So I was at Fry's today, and bought a few different types of resistors-

Some say 1/8W, 2.2Ohm 2% Others say 1/4W 330 Ohm 2% Etc...

I know that the 2.2Ohm/ 100 Ohm means the resistance value, but what is the 1/8W 1/4W mean? I assume it means 1/8th of a Watt? If so, how does that affect what I am doing?

Also, since I don't happen to have a 133.3 repeating Ohm resistor, should I just use 2 100 Ohm resistors, and tie them together?

Edit: I don't have a 150Ohm resistor. D:

I have- 6 2.2 Ohms 4 330 Ohms 6 100 Ohms 4 680 Ohms 2 10K Ohms

So I was at Fry's today, and bought a few different types of resistors-

Some say 1/8W, 2.2Ohm 2% Others say 1/4W 330 Ohm 2% Etc...

I know that the 2.2Ohm/ 100 Ohm means the resistance value, but what is the 1/8W 1/4W mean? I assume it means 1/8th of a Watt? If so, how does that affect what I am doing? Also, since I don't happen to have a 133.3 repeating Ohm resistor, should I just use 2 100 Ohm resistors, and tie them together?

A resistor will dissipate power in the form of heat. The amount of power is equal to the voltage drop across it (2volts) X the current (.010amps) = .02 watts. Resistors are packaged is size to be able to dissipate a given amount of power, the smallest I've seen is 1/10 watt but even that is more then you will require for this buzzer. Normally one choices a resistors power rating to be at least double what it will actually be asked to handle.

By the way two 330 ohm resistors wired in parallel gives you 165 ohms or three 330 ohms in parallel would give you 110 ohms, either would be close enough for your use. Any other series or parallel connected resistors that comes close to 130 ohms will work fine. Resistors wired in series add for the total resistance, resistors wired in parallel are equal to the reciprocal of the sum of their reciprocals (http://www.1728.com/resistrs.htm).

Lefty

Okay, makes sense.

I think I am going to start with series circuits, as parallel seem slightly harder to use. :/

If I used 1 100 Ohm, and 6 2.2 Ohms, I would get a total of 113.2 Ohms, would that be okay to use? Or should I be safe and go with 2 100 Ohm resistors?

If I used 1 100 Ohm, and 6 2.2 Ohms, I would get a total of 113.2 Ohms, would that be okay to use? Or should I be safe and go with 2 100 Ohm resistors?

For simplistic sake I would just use one 100 ohm resistor, the slight increase in current won't damage the buzzer, I promise. ;)

Lefty

Okay, sounds good.

If it does, you owe me $1.99. :P

Okay, sounds good.

If it does, you owe me $1.99.

No problem, just put it on my tab.

Quick question on wiring it-

I assume I put the resistor into digital pin I am using first, then connect the resistor to the positive lead of the buzzer, then the negative lead goes to Ground, right?

The orientation of the resistor doesn't matter, does it?

I assume I put the resistor into digital pin I am using first, then connect the resistor to the positive lead of the buzzer, then the negative lead goes to Ground, right?

The orientation of the resistor doesn't matter, does it?

In a series circuit it doesn't matter if the buzzer or resistor is first, but most would wire the resistor to the output pin and then to the buzzer.

If you wish for a digital HIGH to sound the buzzer then wire as you stated with buzzer negative to ground. However you could wire it such that a digital output LOW would sound out by wiring pin, resistor, buzzer negative, buzzer positive, +5vdc. Your choice, but most prefer 'true logic' where HIGH means something turns on, but that really is just a mental construct. Or some may state an unnecessary mental limitation. ;)

Lefty

Alright thanks, about to wire it up now…

It is safe to just stick the wire and resistor into the little slot on the Uno, right?

It is safe to just stick the wire and resistor into the little slot on the Uno, right?

If you mean the female pins of the Arduino shield connectors, then yes it is. How secure the wire will be depends on the wire gauge size and stiffness of the wire.

Lefty

Okay. Is there a way to ensure a secure connection in there? I can't tell if the exposed wire is even touching the contacts inside the pin.

Okay. Is there a way to ensure a secure connection in there? I can't tell if the exposed wire is even touching the contacts inside the pin.

Well if the wire bottoms out, and seems to have any kind of resistance at all to moving, it should be OK. For more permanent installations, if you can solder, I recommend using male header pins where you solder the wire to the short end and plug the long end into the shield connector. I use these and just break off the number of pins I need: http://www.sparkfun.com/products/116 Fry's might carry them.

Yeah, I will probably end up doing that later.

Right now I don't have access to a soldering iron, plus I've never soldered these small of parts before. I've only soldered wires together. Once I soldered an encoder to its wires, but that's it.

Well if you are serious about building Arduino projects soldering is something you should try and master. It's not hard, just takes practice.

I've found this kind of soldering aid a lot of help to hold wires and components as I solder them up, I use two of them when needed. http://www.amazon.com/Eclipse-900-037-Helping-Soldering-Magnifier/dp/B002PI4AK6

But the most important thing, if you don't have one all ready, for working on Arduino projects is to get a decent digital multimeter, otherwise you really are working in the blind. Buy as best as you can afford, but even a $20 one is fine for starting out.

Lefty

Oh, I know all about using helping hands. Wouldn't solder without them!

I'm 16, a junior in high school, but I'm the lead programmer/electronics stuff for our robotics team. However, all the stuff we do, (electronics wise) is already done and set up. It is just knowing how to plug stuff in, and not do it backwards. :P

I can solder wires decently, but I've never soldered on a PCB.

I can solder wires decently, but I've never soldered on a PCB.

Again it just takes a little practice. You might consider going to a thrift store and buying a $5 VCR, take it apart and start unsoldering parts from the pcb, practice cleaning out the holes and even resoldering parts back on. The basic rule to follow is to apply the proper heat first to the work before adding the solder, it will flow then into the work.

Good luck on your future projects and I think you will find your Arduino board a great platform to add to your experiance and growth in both electronics and programming.