A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices, timers, and confirmation of user input such as a mouse click or keystroke.
If a buzzer operates from a low enough voltage and draws low enough current, it can be interfaced directly to an Arduino Uno pin.The buzzer used in this example can operate from a voltage between 3 to 28V and draws only 4mA of current at 12V. When the current drawn by the buzzer was measured at 5V, it was found that it only drew about 1.1mA which is well within the drive capability of an Arduino Uno pin.
In this circuit, the positive lead of the buzzer is connected to pin 13 of the Arduino, the negative lead of the buzzer is connected to GND.
The Blink Arduino example program can be used to test the circuit. This is a program that is built into the Arduino IDE and can be found under File → Examples → 1.Basics → Blink
The Blink sketch will switch the buzzer on and off continuously.