Pages: [1]   Go Down
Author Topic: How to wire a piezoelectric buzzer  (Read 155 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear fellow hackers,

I have bought a few components from Jaycar. (The Australian equivalent to Radio Shack) I have already had success constructing a breadboard with a blinking LED. So far so good. The next component I'd like to attach is a piezoelectric buzzer. The component description is here:

http://www.jaycar.com.au/productView.asp?ID=AB3466

A fellow on the #arduino channel said this might draw too much current and damage the board (the board is actually a Freetronics Eleven, if that matters). So I would like some help setting up the circuit. Also, I was informed that you don't need to use the tone() function with a buzzer - is that right?

Thanks in advance!

Jhanarato Bhikkhu
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 27
Posts: 1178
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to google this? I am sure there is a lot out there about this. It is very basic and most beginners go through this phase?

You need to use the tone() function because to get a sound you need to vibrate the piezo at high frequency. Tone() will do that, or you can do it in your own code.

10 seconds on the site turned this up http://arduino.cc/en/Tutorial/Tone
« Last Edit: October 28, 2013, 04:43:24 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear marco_c,

Indeed I have googled this, and I did look at the tone() example. However, I do not know whether a piezoelectric buzzer works in the same way as a speaker. One fellow on IRC suggested that you don't need to use tone() at all. What would happen if I just connected one lead to 5V and the other to GND? Also, I got some advice on #arduino indicating I might need to use a transistor. There is no transistor specified in the tone() tutorial. Perhaps he meant "resistor", but I don't really know.

Sorry to be a pain.

J.R.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4538
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to google this? I am sure there is a lot out there about this. It is very basic and most beginners go through this phase?

You need to use the tone() function because to get a sound you need to vibrate the piezo at high frequency. Tone() will do that, or you can do it in your own code.

10 seconds on the site turned this up http://arduino.cc/en/Tutorial/Tone

"Buzzers" usually output a fixed frequency tone all by themselves when you apply voltage. The tone() function won't work with them.

Logged

No, I don't answer questions sent in private messages...

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4538
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What would happen if I just connected one lead to 5V and the other to GND?

Probably not much. The buzzer is designed for 12V operation, you'll need an external power supply to use it (or a voltage booster module).

Also, I got some advice on #arduino indicating I might need to use a transistor.

You need a transistor if the current needed for the device is more than 20-30 milliamps or the voltage is higher then 5V and you want to use an external power supply.
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks fungus,

I think I understand now. Basically the buzzer needs a voltage switched on and off very quickly. Looking at the Jaycar page for the buzzer it is rated at 6-14VDC. So, it needs more voltage than the arduino can supply, right? Actually I wanted to get this component:

http://www.jaycar.com.au/productView.asp?ID=AB3462

It is rated at 3-16VDC, so might this work? It wasn't in stock, so I ended up with this:

http://www.jaycar.com.au/productView.asp?ID=AB3466

Thanks again, fungus. :-)

J.R.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4538
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I understand now. Basically the buzzer needs a voltage switched on and off very quickly.

The ones I've seen switch it on and off themselves, internally.

You just apply a constant voltage and they buzz.


Actually I wanted to get this component:

http://www.jaycar.com.au/productView.asp?ID=AB3462

It is rated at 3-16VDC, so might this work?

That one should work, yes. Voltas and amps are within Arduino range.

Thanks again, fungus. :-)

Karma is added using the little green crosses on the left...
Logged

No, I don't answer questions sent in private messages...

Offline Offline
Edison Member
*
Karma: 27
Posts: 2033
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This buzzer has a fixed noise frequency,   which means it will generate that sound frequency itself  if you simply apply a sufficient voltage.

You don't have to generate any oscillating voltage yourself to drive it.

Logged

Pages: [1]   Go Up
Jump to: