Propeller and piezo
computer guy
Posts: 1,113
Hi everyone,
What is the easiest way to connect a piezo speaker up to a propeller chip?
The piezo I have is 5v.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
What is the easiest way to connect a piezo speaker up to a propeller chip?
The piezo I have is 5v.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Comments
I would use a transistor like a 2n3904 or bc337 or similar with a 1K base resistor.
These are NPN transistor..
Supply the piezo speaker with 5VDC on 1 wire and the other wire switch it to GND
Driving it direct from an output pin might work but the volts is a little low..
Your stuff left today as well to DeniL.... cheers Ron
That sounds like a good idea.
@OzStamp
Just to illustrate how sparse electronics shops are around here I will tell you a quick story.
I walked into Jaycar in Shepparton the other day and asked if they had any variable resistors and they said no so I asked for some wire ties and they said they had none of them either.
So I might have to source a 2n3904 transistor online.
It is a shame, I only ordered some electronics online the other day.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Thank you, however four-fold power sounds like it would be complex to implement.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
You can't drive a piezo with an open collector configuration without some sort of leakage resistor across the piezo.
The reason is because the piezo crystal behaves like a capacitor...· In open collector mode, it charges, but is not allowed to discharge.
See this link below for some alternative 1 pin examples...
http://forums.parallax.com/showthread.php?p=464410
Note:
The two transistor inverter solution is designed for 5V operation, and needs different valued resistors to work at 3.3V
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
wouldn't it be easier to just add a leakage resistor?
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
You could, but you wouldn't get the volume you would from deflecting the crystal in both directions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I have used the piezo with the BS2 before with plenty of volume.
Wouldn't this get the same volume, or at least close to?
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
·
Sorry, I misread your original post... for some reason I thought you wanted more volume.
·
OzStamp's solution is fine, just place a resistor (1K to 4.7K) in parallel with the piezo in addition to what he mentioned.
deSilva's solution will also work, just fine and is capable of boosting the volume.· Just drive 2 pins 180 deg out of phase.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 1/31/2008 11:03:29 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
-Phil
Thank you however I am happy with the circuit that Ron and Beau have provided.
I am just wanting to drive a piezo from 3.3v.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
I don't understand your comment:
"Thank you, however four-fold power sounds like it would be complex to implement"
4 fold power means 4 times more power.
Graham
I understand what four-fold power is.
I just mean in terms of writing code that can alternate the pins and still generate the desired frequency on the piezo.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker
Or do as Phil suggests and use a counter, in differential mode the pins will automatically be opposite. Not sure how to proceed, then have a look at the app note and ask a question when you get stuck.
Graham
I am happy with the volume I am getting, so the circuit that I have works fine for me.
Thank you anyway
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Sticker