This isn't a programming question but I hope you can offer some help anyway: my GCB code works fine in making a piezo buzz when needed but the volume is too low for my interest. So I used a 9 volt regulator (because I happened to have one) and a 5 volt regulator from the same 12 volt power AC supply; 5 for the pic and 9 for the piezo. My piezo output pin is attached to a common basic NPN transistor through a 1k resistor and the piezo is hooked to the + 9v and to the collector. Emitter is grounded.
I get a fainter buzz than straight from the output pin using the 5 volt only circuit.
Obviously I am really missing something in my logic here and would really appreciate any help.
Thanks much!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What kind of piezo buzzer is it? Do you just need to supply a voltage to get it to buzz or does it need a square wave.
If its the square wave drive type you might try a resistor between 9V and the collector so that transistor can conduct some current and give a good voltage swing across the buzzer.
If its the other type I don't know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The piezo is a cheap Velleman 30mm piezo from Jameco. Good question about what type of piezo. I just get a click when connected across 5v +/- and beeping when driven by the Tone command. I connected a 0.1uf cap in series with the piezo (piezo from PORTC.3 to ground on a 16F676 on it's 5v circuit. I played enough to find it's resonant frequency (loudest sound).
But when I send PORTC.3 to the transistor and put the piezo on the collector side to 9v, the volume drops waay off. So you suggest a resistor size - range?
Thanks for your thinking!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could start off with a 10k resistor - see what voltage the collector sits at with PORTC.3 low and high to make sure the voltage swing is somewhere close to 9V.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you ever try the piezo buzzer without the 0.1uF capacitor in series direct from the pin. It might be louder without the capacitor in series as that probably acts as a voltage divider for ac signals
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Several ideas to test then. 1st I removed the cap. Then I put a 10k resistor in series with the piezo and 9v to collector (and a 1k resistor from PORTC.3 to base). Volume dropped to extremely low. So I took the resistor out of the piezo circuit and just measured v from collector to ground and got 2.1v with no beep (PORTC.3 low) and 1.1v with a peep (pin high). Wow, only a 1v drop? Sounds about as loud as if I just used the pic's 5v circuit.
Heck, I thought this would be easy but figuring out how to use the transistor, a BC458B. Thanks for your help.
George
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
You can try to put a 1K resistor in parallel with your piezo buzzer , because piezo is equivalent to a capacitor , your tansistot doen't works properly .
GC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sounds like the piezo is just a passive device with no electronics in it.
You need to drive the piezo with an AC waveform as it looks like a capacitor.
Try connecting the piezo between 2 of the PICs output pins and then drive them
alternatively high and low.
This will simulate a AC square wave across the piezo.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This isn't a programming question but I hope you can offer some help anyway: my GCB code works fine in making a piezo buzz when needed but the volume is too low for my interest. So I used a 9 volt regulator (because I happened to have one) and a 5 volt regulator from the same 12 volt power AC supply; 5 for the pic and 9 for the piezo. My piezo output pin is attached to a common basic NPN transistor through a 1k resistor and the piezo is hooked to the + 9v and to the collector. Emitter is grounded.
I get a fainter buzz than straight from the output pin using the 5 volt only circuit.
Obviously I am really missing something in my logic here and would really appreciate any help.
Thanks much!
What kind of piezo buzzer is it? Do you just need to supply a voltage to get it to buzz or does it need a square wave.
If its the square wave drive type you might try a resistor between 9V and the collector so that transistor can conduct some current and give a good voltage swing across the buzzer.
If its the other type I don't know.
The piezo is a cheap Velleman 30mm piezo from Jameco. Good question about what type of piezo. I just get a click when connected across 5v +/- and beeping when driven by the Tone command. I connected a 0.1uf cap in series with the piezo (piezo from PORTC.3 to ground on a 16F676 on it's 5v circuit. I played enough to find it's resonant frequency (loudest sound).
But when I send PORTC.3 to the transistor and put the piezo on the collector side to 9v, the volume drops waay off. So you suggest a resistor size - range?
Thanks for your thinking!!
You could start off with a 10k resistor - see what voltage the collector sits at with PORTC.3 low and high to make sure the voltage swing is somewhere close to 9V.
Did you ever try the piezo buzzer without the 0.1uF capacitor in series direct from the pin. It might be louder without the capacitor in series as that probably acts as a voltage divider for ac signals
Several ideas to test then. 1st I removed the cap. Then I put a 10k resistor in series with the piezo and 9v to collector (and a 1k resistor from PORTC.3 to base). Volume dropped to extremely low. So I took the resistor out of the piezo circuit and just measured v from collector to ground and got 2.1v with no beep (PORTC.3 low) and 1.1v with a peep (pin high). Wow, only a 1v drop? Sounds about as loud as if I just used the pic's 5v circuit.
Heck, I thought this would be easy but figuring out how to use the transistor, a BC458B. Thanks for your help.
George
Hi,
You can try to put a 1K resistor in parallel with your piezo buzzer , because piezo is equivalent to a capacitor , your tansistot doen't works properly .
GC
Sounds like the piezo is just a passive device with no electronics in it.
You need to drive the piezo with an AC waveform as it looks like a capacitor.
Try connecting the piezo between 2 of the PICs output pins and then drive them
alternatively high and low.
This will simulate a AC square wave across the piezo.