Split from: [HARD] Make a piezo go louder without any extra parts

Go To Last Post
26 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This works with buzzers, it seems useless with plain piezo crystals... is it?

A.

 

* Moved by moderator to a slightly better forum. *

 

This topic has a solution.
Last Edited: Fri. Feb 24, 2017 - 12:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nobody? :) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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: http://www.avrfreaks.net/forum/h...

 

Last Edited: Thu. Feb 23, 2017 - 11:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

Last Edited: Thu. Feb 23, 2017 - 11:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that you can embed images in posts

 

 

 

Instructions here: http://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:

  1. Use complementary (push-pull) drive;
  2. Use the disc's resonant frequency.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote:
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: http://www.avrfreaks.net/comment...

 

angry

Last Edited: Thu. Feb 23, 2017 - 06:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well, the plastic housing can only be a resonator, but many often people buy buzzers like this:

 

opened buzzer

 

 

I would recommend daqq suggestion to get a louder sound with this buzzers but not with the "naked" disks.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
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?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admant wrote:
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.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admant wrote:
and can you tell me where David speaks about push-pull drive?

 

Right here:

daqq wrote:
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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes, I followed all that with no improvement.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

admant wrote:
I followed all that with no improvement.

No improvement over what?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

Last Edited: Thu. Feb 23, 2017 - 11:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

...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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just what is the response characteristic of the piezo at 10KHz?

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the outside diam of your bender?  From that we can find its response freq.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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)

 

Last Edited: Thu. Feb 23, 2017 - 09:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is no longer a Tutorial - it is now a common "why isn't my stuff working?" thread ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

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.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Not disputing that it's a valid discussion to have on the forum.

 

But the Tutorials section is specifically reserved  for Tutorials - see: http://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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

the Tutorials section is specifically reserved  for Tutorials - see: http://www.avrfreaks.net/forum/p...

 

You are absolutely right. Sorry. And apologies to the forum members.

 

awneil wrote:

How do you know it's the same power?

 

I mean the same power supply, 2x1.5 batteries

 

awneil wrote:

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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