2.10 Active Buzzer

Overview

In this lesson, you will get to know about active buzzer. As a type of electronic buzzer with an integrated structure, active buzzer is supplied by DC power, widely used in computer, alarm, electronic toy, telephone, timer and other electronic products or voice devices.

Fritzing Circuit

../_images/image448.png

In this example, we use the digital pin 9 to drive the buzzer and extend the cathode of the Buzzer to GND and its anode to the digital pin 9.

Schematic Diagram

../_images/image450.png

Code

Note

  • You can open the file 2.10_activeBuzzer.ino under the path of sunfounder_vincent_kit_for_arduino\code\2.10_activeBuzzer directly.

  • Or copy this code into Arduino IDE 1/2.

  • Or click Open Code to open it in Web Editor.

  • Then Upload the Code to the board.

When you finish uploading the codes to the Mega2560 board, you can hear the beep—beep emitted from the buzzer. If you want to know more about the detail code explanation, please refer to Part 1-1.2 Digital Write.

1.2 Digital Write

Phenomenon Picture

../_images/image121.jpeg