Uploaded May 2015 | Updated September 2026, 2 hours ago
Very simple, but terrible sound quality. I highly recommend NOT directly driving an 8-ohm speaker from an Arduino like this, though. It's not good for the pin. I just did this for a brief period. Really, you should put some additional resistance (maybe 500 ohms) between them. It won't be as loud, but you won't be in danger of breaking your Arduino.
Very simple, but terrible sound quality. I highly recommend NOT directly driving an 8-ohm speaker from an Arduino like this, though. It's not good for the pin. I just did this for a brief period. Really, you should put some additional resistance (maybe 500 ohms) between them. It won't be as loud, but you won't be in danger of breaking your Arduino.










