8Ω speaker, what resistor values to use? I want to connect 2 speakers of 8 ohm to 2 (different) pins of the Arduino.
However, for this example one speaker is enough.

I came across a lot of circuits without or with a single resistor which on other foras was not adviced, where one pin directly controls the speaker. This way (assuming 0,02A is the max recommended output for a pin), the resulting power is like 0.02A * 5V = 0.1W.

My speaker is 0.5W (8 ohm) and I want to hear how hard that is :-)

But it seems I have to use something with a transistor to isolate the path.
I came across this circuit:



However, when I would calculate the values or R1 and R2 myself I would get:


R2: Afaik, the recommended output for a pin is 0.02 A. This means:
V = I * R &lt;=> 5 = 0.02 * R &lt;=> R = 5 / 0.02 = 250Ω -> 270Ω (nearest higher value)
R1: my speaker is 0.5W, 8Ω. 
P = V * I &lt;=> 0.5 = 5 * I &lt;=> I = 0.1A
V = I * R &lt;=> 5 = 0.1 * R => R = 50Ω, which is Rtotal below:
Rtotal = Rspeaker + R1 &lt;=> R1 = Rtotal - Rspeaker = 50 - 8 = 42Ω => 47Ω (nearest higher value)


This result in 
V = I * R &lt;=> 5 = I * (R1 + Rspeaker) &lt;=> I = 5 / (47 + 8) = 5 / 55 = 0.0909 A
P = V * I = 5 * 0.0909 = 0.4545 W (so I lose 'just' 10%) 

Are my calculations correct, and I assume the +5V pin of the Arduino will not have trouble giving 90.9 mA ?

Update:

I have some more questions regarding the accepted answer:


Would it mean if I use 7 transistors, all my voltages will be used for transistors and nothing is left (7 times 0.7 V which is approx. 5 V?)
**** Answer = No, a transistor will add Voltage so 7*0.7= 4.9Volt added ***
I assume I can better use as less as possible to 'switch' a transistor? * Answer = No, 0.7-Volt required, 5V is fine depending on the rating of the transducer   (but enough to be able to switch it) ? You say R2 can be smaller, but I can better make it higher not to waist voltage?  Answer = Changing the resistor will change the volume, look at the wattage rating for the speaker *
I already built the circuit below (but with a BC547 transistor) ... using a 0,25W R1 resistor. I guess I was lucky (?) * Answer = No, luck has no part, that transistor would work fine within the parameters used, look at the datasheet * 
Regarding the base pin of the transistor ... by making the resistor higher (see item 2 above) ... that would help also not to burn the transistor pin? * Answer = No... please view the datasheet and ratings for the hw *
Again about the transistor, so I should make the resistor R2 in such a way that the gain times the mA is driving the speaker? (need to calculate this again) * Answer No, and I think you are thinking of "Gain" the wrong way, "Gain" is a "DB" measure and is for how well AC is transferred between antenna. * 
You say to remove R1 completely ... but than I expect V = I * R &lt;=> 5 = I * 8 => I = 0.625A ... P = V * I = 5 * 0,625 = 3.1W which blows the speaker? * Answer = Wrong way of looking at the 8-Ohm Impedance rating, Impedance is AC *
The speaker rating of 8&nbsp;&Omega; is AC resistance, speaker impedance. Impedance (AC-Resistance) changes based on the frequency of the signal fed into it.  

If you are worried about hurting the speaker and need to calculate power driving that particular "load", look at the speaker Wattage rating. 
Say it is 1&nbsp;W for example, and you are providing 5&nbsp;V d.c., the amperage required will be: 0.2&nbsp;A.

V * A = W 
0.2 * 5 = 1


So the DC resistance is actually: 

V = I * R (0.2 / 5 = 0.04 Ω). 


Give it a higher amplitude... say 5.7&nbsp;V to account for a transistor no resistor, and you get about 0.175&nbsp;A. and a change in DC resistance again to 0.0301&nbsp;&Omega;.

If the power supply is AC, the impedance needs to be matched to the speaker impedance to get best energy efficiency, otherwise the amplifier can be damaged.  

For that circuit I suggest you place a variable resistor where the resistor is in your circuit to allow for a volume change. Also a flyback diode maybe a good idea, that will protect the speaker but take down voltage 0.7&nbsp;V d.c. keep in mind you have that transistor there adding 0.7&nbsp;V d.c.! so it evens things out too using that diode.

That diode placed on the high (+) side of the circuit, before the speaker and after the variable resistor.