Driving a Small Speaker (not a piezo buzzer) from a BS2.
I recently purchased a small speaker that says it can be driven from an microcontroller pin, but before I plug it into my BS2 I want to do due diligence. The data sheet says that it is impedance is 100 ohms and its rated input power is 0.15 W. My guess using the voltage drop across 100 ohms would be 50 mA, and 0.15 W at 5 volts is 30 mA. Both of these are well above the BS2's 20 mA per pin output. So I'm assuming I need to limit the current consumption.
Does anyone have any pointers on driving a small speaker (not a piezo buzzer) from a stamp? I assume I either add a current limiting resistor, or feed the pin output into a transistor and drive the speaker off that.
Does anyone have any pointers on driving a small speaker (not a piezo buzzer) from a stamp? I assume I either add a current limiting resistor, or feed the pin output into a transistor and drive the speaker off that.
Comments
The transistor idea works, too. Just wire it as a switch.
-- Gordon
Thanks Gordon. That is indeed the speaker, so I'll try a 100 ohm and see how it goes. I'm glad to hear it is loud as I wanted something louder than the typical buzzer.
Remember that a speaker is an inductive load and, like any inductive load, needs a catch diode across it to protect the switching circuitry from fly-back voltage spikes.
-Phil
The capacitor does cut down on the low frequency response, but that speaker drops off pretty fast below 1kHz anyway.
-Phil
There was a design idea in the 3/1 issue of EDN, an H-bridge driver specifically for a piezo speaker. A rather risky design in terms of protection from incorrect drive, but a nice simple circuit. The Micrel MIC4426 series that Phil brought to my attention also presents a neat option for bridge drive with voltages greater than the MCU Vdd. The PWM output from FREQOUT on the Stamp has a lot of high frequency switching going on, so you have to take that into consideration when using any external circuit.
Half a penny saved is half a penny earned.