0
\$\begingroup\$

I'm trying to connect a buzzer to my Arduino Uno to play a tone. Instead of giving a melody I will give a HIGH value which translates in to 5V. Since I don't want to blow up anything I think I should use a resistor. But according to Ohm's law, I need to know how much miliamps the buzzer will draw. (R = V/I and in my case, I can't find my buzzer's I).

Any ideas on what resistor I should use?

\$\endgroup\$
  • 3
    \$\begingroup\$ Do you have a part number for the buzzer? \$\endgroup\$ – Scott Seidman Jul 6 '14 at 21:40
  • \$\begingroup\$ Can you post a picture of your part so we can tell whether what you have is really a buzzer or a piezoelectric transducer? \$\endgroup\$ – Ricardo Jul 6 '14 at 22:23
  • \$\begingroup\$ @DiegoCNascimento I've connected it with 1.5V batery and it makes a weird sound \$\endgroup\$ – Meletis Flevarakis Jul 6 '14 at 22:56
  • \$\begingroup\$ Well connect to a 5V supply, and make a good contact. If you don't have a 5V supply, try using 3 x 1.5V batteries in series so you get 4.5V, anyway it can not work with less than 5V. But try. If it does not make an audible tone, try rasping the contact, if you ear noise its not a buzzer. Again be sure to respect the polarity. If you are hearing the weird sound even after some time and the contacts are good (you are not shaking the contacts), its probably a buzzer that is not oscillating as it should because of the low voltage. \$\endgroup\$ – Diego C Nascimento Jul 6 '14 at 23:12
  • \$\begingroup\$ But again if i put 5V is it gonna blow up? If not i can try directly from the arduino digital port \$\endgroup\$ – Meletis Flevarakis Jul 6 '14 at 23:28
3
\$\begingroup\$

If you don't have the part number it's difficult to tell whats the current consumption of the device at the specified voltage.

So what I suggest is. Be sure it's voltage rating is 5V. Connect a 5V supply to the buzzer by a small time, it should have polarity marking, respect it. If it produces a tone (not a click or something like 50/60Hz hum), its a buzzer (it has its own oscillator and amplifier and transducer).

Being it a buzzer, use a current-meter (a multimeter in the DC current mA scale for example), connecting one point of the multi-meter to the supply, the other to the buzzer, and the other point of the buzzer to the supply, always respecting the polarity. This will show to you what is the average current consumption of the buzzer.

The Arduino UNO probably uses a ATmega168P or ATmega328P, the maximum current per IO pin is 40mA (but the maximum total supply is 200mA, so you need to respect this value with some margin even if the IO pin max current is 40mA).

If the buzzer draw more current than the uC I/O can supply, you can try adding a resistor according to the current, but it probably wont work or work out of the specifications. A NPN transistor will help you

schematic

simulate this circuit – Schematic created using CircuitLab

A general purpose NPN transistor that can handle the current and voltage can be used, also should have the necessary current gain.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

It really depends on the buzzer you're using. Without knowing the part number, you won't be able to use it properly.

Just as Majenko helped me notice, I've never used a buzzer myself (though I had, but didn't - the nomenclature seems to be very confusing). So, I only worked with piezoelectric transducers like the UCM1205APB (datasheet - see the column for the 5V part). I'll show you how I calculate my series resistance for it, just in case yours is similar to one of these.

According to the datasheet, it's specs are:

  • Operating voltage: 5V
  • Max current: 40mA
  • Coil resistance: 47Ω

Using Ohm's law,

$$V = RI$$

we can see that, without a series current limiting resistance, the buzzer coil resistance will let 100mA pass through it. That's past its maximum current rating, so we need to take it to a lower level.

We need to leave some room below the maximum rated current of 40mA and also stay within safe current levels that the Arduino output pin can source or sink, which is about 20mA. So let's shoot for that (20mA). That means we need to have 250Ω total resistance.

$$R = \frac{V}{I} = \frac{5[V]}{0.020 [A]} = 250\Omega$$

The buzzer already has 47Ω, so wee need to place we need to place a series resistor of 200Ω to get to the 250Ω that we want.

But that's in my case. You need to find your part's datasheet. If you have a piezo, you'll have to find its max rated current and coil resistance and do the math for your part. Ask your supplier for the datasheet, and if he or she doesn't have it, ask for the part number and look for the datasheet online.

If you really have a buzzer, then I won't be able to help you.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ What you have there is not a buzzer, but a piezoelectric transducer - a very different thing. \$\endgroup\$ – Majenko Jul 6 '14 at 22:01
  • 1
    \$\begingroup\$ @MeletisFlevarakis FYI, a buzzer is a device you apply a DC voltage to and it makes a noise. A transducer you have to apply a waveform to it to make a noise, like a speaker (using the Arduino's tone() function). \$\endgroup\$ – Majenko Jul 6 '14 at 22:06
  • 1
    \$\begingroup\$ The problem is people often sat buzzer when they mean transducer. also a lot of buzzers look like transducers because the largest part of it is a transducer. \$\endgroup\$ – Majenko Jul 6 '14 at 22:15
  • 1
    \$\begingroup\$ Put that plate in a little black plastic casing and you have your "buzzer". It cannot make a tone by itself, you need to oscillate it. It's a speaker. An actual buzzer includes an oscillator to generate the tone so all you need to provide is a voltage. \$\endgroup\$ – Majenko Jul 6 '14 at 22:20
  • 1
    \$\begingroup\$ Almost. A buzzer has a fixed tone or sound pattern. Some play multiple tones (doo-dah-doo-dah) and some do various sweeps. These are more often referred to a sirens though. But yes, you can't change how they sound, but a transducer can make any sound, even play music. \$\endgroup\$ – Majenko Jul 6 '14 at 22:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.