user15341: I'm wondering how to drive a speaker using an arduino output pin.  I am using a pwm playback method with a sound data file.  If you wire a speaker across an output pin and ground then how do you calculate what speaker power and impedence you can use without damaging the arduino?  Is there a reference making these calculations?
Thanks

user16673: Only very small ones with 20-30mA.  Earbud-size and slightly larger. You can buy a 2x3W amplifier which runs on 5V, and gives you two audio channels - but it works fine for mono. It can drive my 4 ohm desktop speaker, and is probably too powerful for that. Read about signal voltage and resistance for speakers. IIRC small audio outputs (like from an mp3 player) switch from -2.5V to 2.5V, giving an RMS of 5V. Or perhaps that was just my player. The only way to know this is to measure it - I played a sine wave and got a circa value. Offhand I can't say how to drive negative voltages from an arduino without extra circuitry. Hope it helps (and show us your code :)

user3879: The Arduino can supply 5V at max 20mA so 5/0.02 ⇒ 250Ω (if you can find such a beast).
NOTE you should use a capacitor to prevent DC flow if using a conventional speaker.
In general the larger the speaker the better. Tiny speakers are inefficient transducers. Hi-Fi speakers are not a good choice, as they are often inefficient, trading efficiency for linearity.
An alternative, if you are a scrounger, is to scavenge a transformer from an old transistor radio - this should give the best match.

15341: <p>I'm wondering how to drive a speaker using an arduino output pin.  I am using a pwm playback method with a sound data file.  If you wire a speaker across an output pin and ground then how do you calculate what speaker power and impedence you can use without damaging the arduino?  Is there a reference making these calculations?</p>

<p>Thanks</p>
 16673: <p>Only very small ones with 20-30mA.  Earbud-size and slightly larger. You can buy a 2x3W amplifier which runs on 5V, and gives you two audio channels - but it works fine for mono. It can drive my 4 ohm desktop speaker, and is probably too powerful for that. Read about signal voltage and resistance for speakers. IIRC small audio outputs (like from an mp3 player) switch from -2.5V to 2.5V, giving an RMS of 5V. Or perhaps that was just my player. The only way to know this is to measure it - I played a sine wave and got a circa value. Offhand I can't say how to drive negative voltages from an arduino without extra circuitry. Hope it helps (and show us your code :)</p>
 3879: <p>The Arduino can supply 5V at max 20mA so 5/0.02 ⇒ 250Ω (if you can find such a beast).</p>

<p>NOTE you should use a capacitor to prevent DC flow if using a conventional speaker.</p>

<p>In general the larger the speaker the better. Tiny speakers are inefficient transducers. Hi-Fi speakers are not a good choice, as they are often inefficient, trading efficiency for linearity.</p>

<p>An alternative, if you are a scrounger, is to scavenge a transformer from an old transistor radio - this should give the best match.</p>
