November 21, 2024, 08:39:34 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


Driving a piezo speaker from a Prop-2

Started by Jeff Haas, September 03, 2011, 02:28:21 AM

Previous topic - Next topic

Jeff Haas

I'd like to add a piezo speaker to my Prop-2 project.  I didn't find anything on the EFX forums about it, and a search of the Parallax forums got a lot of advice...but I know the Prop-2 is slightly different than the BS2.

There's a 220ohm resistor on each output, correct?  I assume that I need to add a transistor to drive volume, as in post #14 of this thread:
http://forums.parallax.com/showthread.php?107689-BS2-amp-Piezo-Speaker

Anything else I should know?

JonnyMac

Parallax has a piezo that they use in with that they use in their kits that should be directly compatible; the inline resistor won't be a bother (they have it on their boards, too).  Or, you might try connecting an old speaker between V+ and an OUTx terminal.  The ULN is a Darlington transistor circuit and acts like an amplifier.
Jon McPhalen
EFX-TEK Hollywood Office

Jeff Haas

I gave it a try.  It seems that connecting a piezo or a small 8-ohm speaker directly to a pin works, but you get almost no volume - you have to hold your ear next to it to hear anything.

So a friend suggested I try out an LM386 op-amp (89 cents at a local electronic supply). That works well, and either the speaker or a piezo has plenty of volume.  I used the "minimum parts" hookup on the datasheet, and powered it from the V+ output.

http://www.national.com/mpf/LM/LM386.html#Overview

JonnyMac

If you're going to use an external amplifier (good idea) then you definitely want to use the filter circuit shown in the help file under FREQOUT.  This will convert the pulsating output of the chip to sine-like waves that will sound more pure (less gritty) from the amplifier.
Jon McPhalen
EFX-TEK Hollywood Office