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:
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?
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.
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.
marco_c:
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.
jhanarato:
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).
jhanarato:
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.
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: