So a Piezo speaker is not loud enough for your project, but you don’t want to add an amplifier and external power supply? How about going middle of the road. Use your raw 3.3v supply and add the Pololu 2W speaker. Nice sounding and cheap enough. Just add a MOSFET and drive sound from a PWM pin.
Tiny Speaker Recipe:
- Pololu 2W speaker $3.49 http://www.pololu.com/catalog/product/1258
- FEZ or Arduino $40 http://tinyclr.com
- MOSFET breakout $3.95 http://www.sparkfun.com/products/10256
- 6 Ohm resistor $0.10
- Hook your speaker to Device side of MOSFET.
- Add 6 ohm resistor between 3.3v out and positive terminal on MOSFET.
- Ground MOSFET to FEZ GND pin.
- Bring a PWM pin over to MOSFET Gate pin.
- Add code to your project to drive PWM to make notes. I used driver here http://code.tinyclr.com/project/149/tone-buzzer-driver/
The resistor is doing two things. First, it limits the amount of current that the speaker can draw to under .55amps. Without it, the MCU will just keep resetting in a loop because the speaker drawing all ~1.5amps of current. Second, the 6 ohm limits the max watts to just under 2Watts so you don’t over drive the speaker. Plenty of amps left over for MCU.
This is by no means is a sound demon. However, it is plenty good for most small projects and better quality sound then a standard tin-can Piezo.
Now crank those Mario notes.