Choosing right resistor for speaker

@loddem, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project (or questions about it). See About the Installation & Troubleshooting category.

Where does the 3.4 in your calculation come from? You're on the right track, 5V / 20mA should be around 250 Ohm.