I have a piezo horn that I will be using to sound the start of swim events.
I can not locate a datasheet, except for this info :
Impedance 1000 ohm @ 1 kHz
Voltage Nominal 15 V
Voltage Peak 35 V
Frequence Response 3 kHz - 30 kHz
Sensitivity 1W,1m 92 dB
I am using a PWM tone of around 7 kHz.
The piezo horn is connected with a constant 12VDC to the positive pin, and the negative horn pin connected to a 2N2222 or 2N3904 NPN transistor.
The piezo negative pin has a pull-up which I found was needed to 'reset' the horn between pulses from the transistor.
The transistor is driven with a series resistor from pin 12 of a Mega 2560.
The horn is currently working and I am satisfied with the sound and volume.
But since we are likely to have 400 parents shouting for their kids, I want to add another 2 horns so they can be positioned behind the starting line - don't want any parents complaining their kids couldn't hear the start horn.
So my questions are :
Should I be able to drive 3 horns from the same transistor ?
should I add diodes ( 1N4004 ? ) across the terminals of each horn ( like I need to do for relay coils ) ?
The 12VDC that feeds the horns is also connected to an 9V linear voltage regulator that is used to power the Arduino ( Gnd and Vcc pins ).
Should I be able to drive 3 horns from the same transistor ?
Not sure. 1000 ohm impedance divided by 3 is 330 ohms, not unreasonable but at 7 kHz instead of 1 kHz, that is one-seventh or 50 ohms so you could be looking at a current draw of a quarter amp, depending on the other details following:
DaveO:
2. should I add diodes ( 1N4004 ? ) across the terminals of each horn ( like I need to do for relay coils ) ?
The piezo driver is a capacitor, of itself it will not generate a back EMF unless it resonates. You have not specified the pull-up resistor value. OTOH, to drive it correctly it should have an inductor across it, which will generate a back EMF however that is exactly how you properly drive piezo "screamers". The whole situation becomes much more complex.
DaveO:
The 12VDC that feeds the horns is also connected to an 9V linear voltage regulator that is used to power the Arduino ( Gnd and Vcc pins ).
Paul__B:
1000 ohm impedance divided by 3 is 330 ohms, not unreasonable but at 7 kHz instead of 1 kHz, that is one-seventh or 50 ohms so you could be looking at a current draw of a quarter amp, depending on the other details following:
My main power supply is 12VDC 2A. Apart from the horns, the only other components are the Arduino itself, and a 3.3V reg for the ethernet module.
Paul__B:
The piezo driver is a capacitor, of itself it will not generate a back EMF unless it resonates. You have not specified the pull-up resistor value. OTOH, to drive it correctly it should have an inductor across it, which will generate a back EMF however that is exactly how you properly drive piezo "screamers". The whole situation becomes much more complex.
Output pin 12 has a 1K resistor to the transistor, and a 100K pull-down to ground.
The negative pin of the horn that connects to the transistor, also has a 550ohm pull-up resistor to the 12V line.
Paul__B:
I hope you are not feeding 9V into Vcc.
Sorry, that should have said 'the Vin' pin of the Mega, which as far as I understand, does not require 5V regulated power.
That circuit is very inefficient and will not achieve anywhere near the loudness of which the piezo elements are capable.
In line with polymorph's comments, you can put a capacitor (10µF should do) in series with the output line to the piezo and in that case, you can return the piezo to ground instead of Vcc, which is much more practical.
Next, someone will tell you how to use a proper "push-pull" driver and a circuit which will allow you to drive all three in parallel.
Many Thanks for the feedback. Obtaining parts around here is a very long process, but I do have the following in my 'box of bits' :
ULN2803 Darlington Driver 8 channel ICs
IRFZ44N 41A 55V N-channel MOSFET
SN754410NE quad half-H drivers
74HC595N shift registers.
Can you please advise me which, if any, of these could be used to drive the 3 piezo horns, and any advice or diagrams of the best way to use them would be really appreciated.
I have little knowledge or understanding of these components, but my gut feeling is to use the PWM pin 12, connected to a 2N2222, to control the IRFZ44N MOSFET, which would power the piezo horns. My concern is that the horn, when given power ( 12VDC ) makes a single 'click' and only makes a tone when the Arduino Tone is used on the PWM output pin - this has worked with a single horn connected to the 2N2222. Is a mosfet capable of switching the power to the horn at the same speed as the 2N2222 ?
This is a kids charity project I am doing ( which makes it more important to me ) and I am starting to run out of time to get the rest of the project completed and could really use any assistance that you could offer to get these horns working reliably.
The rest of the system with the start timer, android tablet based internet web server, php script for event management and all the whistles and bells is all done - just the horns to complete now.
Yes, these "horns" are merely a form of loudspeaker which reproduces the waveform sent to it.
You want an audio amplifier to drive it from a "tone" function on the Arduino. An LM386 is dead easy to use, connected to a 12V supply. Requires an output capacitor, an input capacitor and a couple of resistors.
The LM386 is probably 2 weeks away from being able to arrive here - and with our postal service, there is less than 20% chance that once ordered it will actually arrive.
Could any of the other components I have not be used instead ?
Oh, yes, actually the H-bridge driver will work just fine! I wasn't thinking.
Put a 22 µF capacitor in series with the output and set it up with enable either continuously on and the high/ low input driven by your tone pin, or only enable it while you generate the tone to save power.
Or you could run it as a full H-bridge and add 6dB to your output.
{I presume H-bridges don't mind being operated at 7 kHz ...}
Purpose
The library is named toneAC because it produces an alternating current (AC) between two pins. The ATmega's PWM takes care of this so the accuracy is exact. When you send a tone to a speaker with the standard tone library, the loudest is at 50% duty cycle (only on half the time). Which at 5 volts, is like sending only 2.5v to the speaker. With toneAC, we're sending out of phase signals on two pins. So in effect, the speaker is getting 5 volts instead of 2.5, making it nearly twice as loud. The sound quality difference has to do with allowing the Arduino's PWM to take care of everything and careful programming. Longer piezo life happens because instead of driving the transducer disc only ever in one direction (deforming the disc and reducing sound and quality), it drives it in both directions keeping the disc uniform.
OK. I have tried to understand the info supplied in this thread, as well as the sn754410 IC.
If my understanding is correct, it was mentioned :
polymorph:
It is not a wise idea to feed a piezo with pulsating DC. It may damage the piezo.
this was a bit confusing as the horn has a + and - symbol on the terminals.
However, I later found the toneAC library, and reading seems have me thinking along these lines :
when driving the piezo ( via a 2N2222 transistor ) from only 1 pwm output pin -- pwm is used to set the duty cycle at 50% so that the piezo is repeatedly 'activated' at the required frequency, and after each activation the piezo resets as the output pin shuts down, and the pull down resistor discharges the piezo. At the next frequency 'loop' the output pin again activated the piezo. So it relies on a natural 'fall back' after each pulse.
With the toneAC library, we use 2 output pins, and these are used to activate the piezo with the first pin ( in my mind, 'activate' = a metal disc being pushed up like in a small solenoid ) for the first 50% of the frequency cycle, and then using the second pin to push the disc back down in the second half of the cycle.
Does this sound about right ?
If correct, then I should be able to use the sn754410 as in the attached diagram to control the piezo.
I am guessing that if I wanted to control the volume of the piezo, I would only need to adjust the supply voltage to pin 8.
Connected the existing single horn as in the attached diagram, and used the toneAC library - so simple to use
Code to generate a test sound for 400ms, repeated with a 4 second interval.
// code adapted from the toneAC library examples
// Connect your piezo buzzer (without internal oscillator) or speaker to these pins:
// Pins 11 & 12 - ATmega2560/2561, ATmega1280/1281, Mega
// Be sure to include an inline 100 ohm resistor on one pin as you normally do when connecting a piezo or speaker.
#include <toneAC.h>
void setup() {
}
void loop() {
delay(4000);
toneAC(1500);
delay(400);
toneAC();
}
Sound volume appears higher with toneAC than when using the tone library and only 1 pwm pin - kids were complaining from the next room.
Tomorrow I will connect the 3 piezo horns and test again.
I am using a 12VDC 5A power supply on pin 8 of the sn754410 , so think I have plenty of power to drive the 3 horns.
Once completed and working, I am thinking to add a second horn at the finish line of the pool, to signal that all lanes times are clear and swimmers can exit the pool. My intention is to use the same H-bridge, and the same PWM pins ( join sn754410 pins 2 + 15, and 7 + 10 ) so both sides of the H-bridge get the pwm outputs from the Mega. Control is with a digital output High to the H-bridge pin 1 or pin 9 ( to enable the relevant side of the H-bridge, so sets which horn is to be activated ) .