A “buzzer” is an electrical device that makes an alarm sound. It is usually used to indicate when someone has pressed a button or to give a warning sound. Buzzers come in different shapes and sizes.
In this tutorial, we will learn how to use a buzzer to make an alarm tone that works every minute as a clock alarm.
Connect the wires between the passive buzzer and the Arduino, as shown in the image below.
Connections from the Arduino to the passive buzzer:
• Arduino GND pin → buzzer GND pin (- pin)
• Arduino pin 11 → buzzer VCC pin (+ pin)
Now access the serial monitor on your Arduino IDE by clicking on the magnifying glass icon at the top right corner.
Now, as seen in the image below, the serial monitor displays the status of the buzzer whenever it is turned on. The state is displayed every one minute due to the delay we added in our code. You will also hear the tone that the buzzer makes every minute and lasts for half a second.