# Why do I need a resistor for a speaker?

If you look at http://arduino.cc/en/Tutorial/tone, you will see that the example uses a 100-ohm resistor. Why is this? What would happen if I removed that resistor? Would the speaker blow? Or would it just get louder? Why isn't there clear documentation on the maximum voltage/current draw from a speaker, like there is with an LED?

It says

DC Current per I/O Pin 40 mA

on this page: http://arduino.cc/en/Main/ArduinoBoardUno Ohm's law will tell you : 5V / 40 mA = 125 Ohm.

Magician: It says

DC Current per I/O Pin 40 mA

on this page: http://arduino.cc/en/Main/ArduinoBoardUno Ohm's law will tell you : 5V / 40 mA = 125 Ohm.

I was thinking about that. Lets say that the arduino could provide enough current to power the speaker without the need for a resistor. Would the speaker be a lot louder?

Speakers have power ratings and an impedance.

An "8?" speaker doesn't measure 8? with a DMM, that's because it's an impedance, an AC resistance. A speaker has a resistance, too, that's from the coil of wire wrapped around its permanent magnet == not much.

An 8? speaker in series with a 10? resistor do not result 18?.

Would the speaker be a lot louder?

40 mA is absolute maximum current for arduino board, 20 mA repetitive maximum. W/o resistor you will blow microprocessor first, and I don't know about speaker.

[quote author=Runaway Pancake link=topic=114429.msg860921#msg860921 date=1342402369] Speakers have power ratings and an impedance.

An "8?" speaker doesn't measure 8? with a DMM, that's because it's an impedance, an AC resistance. A speaker has a resistance, too, that's from the coil of wire wrapped around its permanent magnet == not much.

An 8? speaker in series with a 10? resistor do not result 18?. [/quote] But when using Tone(), the arduino is powering the speaker with DC current correct?

"DC current" in a time domain. But, again, the speaker is not a resistance, it is an impedance.

But when using Tone(), the arduino is powering the speaker with DC current correct?

That is correct but is pulsating DC, otherwise you would not get a tone. For your purposes you can consider it Pretty much like AC when it drives the speaker coil.

At strictly DC, a speaker looks like a short electrically after current starts to flow. So if your arduino were connected straight to a speaker and then to ground, and you drive the output high, the 8 ohm impedance speaker would like an open to start then charge up and look like a short, the arduino would connect the output pin to +5 via the output transistor, it would put out 40mA briefly, then overheat and fail. Depending on the power rating of the speaker, it may or may not be damaged by the DC current. One could say 40mA, 8 ohm: P = I^2 * R = 12.8mW. Or the 40mA could be higher before the output pin blows. Or one could put the 125 ohm resistor in series from the pin to the speaker so when your testing and accidentally put out a long high, it does not blow the output pin.

Better would to have a 100uF cap between the output pin and the speaker, so the speaker only sees the edges of the square wave you will eventually create. Resistor is still needed, as the cap looks like a short to ground as it charges up, but then it looks like an open after that.

This article discusses the size of the capacitor to use, ultimately the cap determines the bass response. http://www.wolfsonmicro.com/documents/uploads/misc/en/WAN0176.pdf

A 8-ohm speaker will typically have a winding resistance of 6 to 7 ohms - the specification is usually an average of the magnitude of the impedance over the audio band - the actual impedance will depend on frequency and acoustic loading and is a complex quantity (in several senses!).

Since a speaker couples electrical and mechanical systems its electrical impedance is strongly affected by the mechanical impedance - depends on cone area, springiness and damping of the spider and cone-support, size of enclosure.

So its only a very coarse approximation to say a speaker has a single impedance value in ohms!