This works with buzzers, it seems useless with plain piezo crystals... is it?
A.
* Moved by moderator to a slightly better forum. *
This works with buzzers, it seems useless with plain piezo crystals... is it?
A.
* Moved by moderator to a slightly better forum. *
nobody? :)
So: 3 months ago you tried to resurrect a thread that had been dead for 9 years!
Unsurprisingly, it didn't wake up!
Your question is unclear: what do you mean by "buzzers" and "plain piezo crystals" - how are you distinguishing the two? Why do you say it works for one and not the other?
EDIT:
Was originally appended to this thread, in the 'Tutorials' section: https://www.avrfreaks.net/forum/h...
hello awneil, thanx for making it happen, it finally resurrected :)
sorry for not being clear. with plain piezo I mean a piezo disk. A buzzer is made with a piezo disk PLUS a couple of other components.
I bought a greetings card with a piezo disk that sounds quite noisy, but when I run my tunes with arduino it is much soft, that's why I approached this thread. I followed daqq's suggestions but with no improvement.
Note that you can embed images in posts
Instructions here: https://www.avrfreaks.net/wiki/em...
Note also that something looking like this:
might actually be nothing more than a plain piezo disc in a plastic housing.
But, yes: the OP applies to plain piezo discs.
The key things, as the OP says, are:
the OP applies to plain piezo discs.
Whether or not in a plastic housing.
I added this post rather than editing the original because that would still have messed-up all the images: https://www.avrfreaks.net/comment...
well, the plastic housing can only be a resonator, but many often people buy buzzers like this:
I would recommend daqq suggestion to get a louder sound with this buzzers but not with the "naked" disks.
The key things, as the OP says, are: Use complementary (push-pull) drive;
and can you tell me where David speaks about push-pull drive?
well, the plastic housing can only be a resonator
Well, it also provides mechanical protection & mounting. Don't know how well they are "tuned" to maximise volume ... ?
but many often people buy buzzers like this:
Yes, I'd call that a "Buzzer".
Note that it includes the electronics to generate the tone; the only control you have with these is to turn the tone on or off - there is no way to adjust volume or pitch.
Here's one I prepared earlier:
It uses both of the "tricks" described.
I only know one thing, that I followed David's suggestions with a buzzer AND with a disk.
The buzzer beeps louder, the disk doesn't.
All the rest does't help this thread.
and can you tell me where David speaks about push-pull drive?
Right here:
If you connect it this way:| AVR PIN1|----| | |---/| | | | PIEZO | |___ | PIN2|----| \| |And make sure that PIN1 is always the logic negation of PIN2 the setup will act like this:
You put 1 (+5V) on the PIN1, therefore on PIN2 is 0 (0V). The crystal will expand to lenght_a.
Now you put 0 on PIN1 and 1 on PIN2. The crystal will SHRINK to length_b, which is LESS than lenght_default.
So the difference is about a double.
yes, I followed all that with no improvement.
Does your buzzer make a sound when you connect + to 5volts and - to gnd?
if so you have a buzzer which has an internal driver, you can only turn these on/off!
if not, then you have a bare element, and must drive it with a audio signal(between 5-10kHz), if driven by two pins as described above then the sound will be louder then when driven by only one pin.
Jim
I followed all that with no improvement.
No improvement over what?
Ciao Jim,
I have a bare element (the disk. NO plastic housing, nothing, only the two wires to + and -) and I drive it with AtTiny85 to provide the audio-rate oscillation +3V / 0V. But I get no difference between the two systems. I can say the disk I am using is this type:
and NOT this type:
don't know if this can make the difference but still...
A.
...and since the problem might be in the code here it is:
here is the original loop with one driven pin (and black to GND):
digitalWrite(Pin1, HIGH); delayMicroseconds(50); digitalWrite(Pin1, LOW); delayMicroseconds(50);
and this is the loop with David's suggestion with the two pins driven separately:
digitalWrite(Pin1, HIGH); digitalWrite(Pin2, LOW); delayMicroseconds(50); digitalWrite(Pin1, LOW); digitalWrite(Pin2, HIGH); delayMicroseconds(50);
if anybody can help me to solve this I would be grateful
Just what is the response characteristic of the piezo at 10KHz?
What is the outside diam of your bender? From that we can find its response freq.
Jim
Hello :)
Thank you all for your help.
diameter is 27mm but I wouldn't focus too much on the resonance frequency because the chinese greetings card where I found it was playing melodies with many pitches ranging from about 3k to 7k Hz and it was enough loud for my needs. My loops run at about 5kHz which is not far but the loudness is mush less even if I change the speed. And of course the power is the same (3V)
Antonio
I am not sure about the timing of your arduino code, or the loop containing the two delayMicroseconds(50); instructions; however, this would indicate to me a 10KHz signal not 5KHz.
Ok, depending on the brand, Digikey shows 27mm dia benders range from 2kHz to 4.6kHz resonant freq., it will have the best sound at the resonant freq.
Yes it will work at other tones, but will be loudest at resonance.
You can drive these with voltages up to 30 volts but will need drivers for that, it may be 3 volts (6 volts diff) is not enough for the sound level you seek.
In the code you posted above (50us delays) your pushing 10kHz! Try using 100us delays and see what happens.
Jim
Edit (us, instead of ms)
This is no longer a Tutorial - it is now a common "why isn't my stuff working?" thread ...
still, I don't think it0s a question of resonance. In time I tried many values with different range of frequencies and the one I posted above is just one of them.
Since the same piezo with the same power was pretty much louder in the chinese greetings card than in my super simple circuit, maybe there was some sort of amp in the chip.
This is not about "my stuff doesn't work" this is about daqq's method that I can say that it did not work to me "As it is". Maybe other people will come across this topic to look for a solution, this is why forums exist.
A.
Not disputing that it's a valid discussion to have on the forum.
But the Tutorials section is specifically reserved for Tutorials - see: https://www.avrfreaks.net/forum/p...
the same piezo with the same power was pretty much louder in the chinese greetings card
How do you know it's the same power?
If you have removed the piezo from a greetings card, it's possible that it got damaged in the process.
Also possible that the card itself acted as a "sounding board" - thus "amplifying" the signal.
I think the way these things are held can affect the sound?
maybe there was some sort of amp in the chip.
Possibly.
The way to find out would be to look at it with a scope...
digitalWrite(Pin1, HIGH); digitalWrite(Pin2, LOW); delayMicroseconds(50); digitalWrite(Pin1, LOW); digitalWrite(Pin2, HIGH); delayMicroseconds(50);
I don't do Arduino but, AIUI, digitalWrite() has a lot of overhead - so you are not going to be getting simultaneous switching of your 2 pins
So you'll be getting something like this
-----+ +-----+ | | | | | | +-+ +--+ +--+ | | | | | | +-----+ +-----
instead of this
-----+ +-----+ | | | | | | | | | | | | | | | +-----+ +-----
Some AVRs have the option of complementary PWM outputs to do exactly this - as does the SAMR21 shown in my photo from earlier
the Tutorials section is specifically reserved for Tutorials - see: https://www.avrfreaks.net/forum/p...
You are absolutely right. Sorry. And apologies to the forum members.
How do you know it's the same power?
I mean the same power supply, 2x1.5 batteries
If you have removed the piezo from a greetings card, it's possible that it got damaged in the process.
Also possible that the card itself acted as a "sounding board" - thus "amplifying" the signal.
I think the way these things are held can affect the sound?
Not damaged, I took many and did many tries.
I am very bad with hardware and electronics but I am good with sound and acoustics. I know when it's louder and I know audio frequencies.
But the overhead! this can be the answer. the ATtiny85 has pwm pins so I will follow your suggestion. AND I will look at it with a scope (I don't have one but will ask friends).
Thank you awneil
Antonio
OK, so...
I have to thank you so much guys because this thread is now solved.
My assumption was wrong and David's tutorial is flawless.
The problem was in my code and the headroom, as awneil noted.
I changed to pwm and everything went ok.
Thank you all again!
Antonio