Making sound on the arduino is an interesting project, this con be accomplish using different modules and devices depending on your project and choices. In this project, we'll be looking at the way you can make sound with a buzzer. Buzzer used by hobbyist come in two types: The active buzzer and the passive buzzer. For this project, we are going to be using an active buzzer. Check out my tutorial on using a passive buzzer.

An active buzzer will generate a tone using an internal oscillator, so all that is needed is a DC voltage. To generate tone with an active buzzer, all you need is a DC voltage. Most active buzzer can be powered with 3-5V.

An active buzzer can be controlled from an Arduino pin, very similar to the way you turn on and off an LED using digitalWrite.

Step 1: Materials

Active Buzzer

Arduino Board (Uno in this case)

Jumper wires

Step 2: Circuit Diagram

A simple schematic of how you can connect your active buzzer to the Arduino is show below. You can use any digital pin of the arduino for the positive pin and connect the negative pin to ground. There is need to use a resistor since the buzzer operates on 5V. You can recognize the positive pin by looking at the top side of the buzzer, you will a point marked "+", the pin on this side is the positive pin.

NOTE: Its not advisable to control the buzzer using analogWrite i.e. PWM.

Step 3: Working Code

The code below gives an example of how you can use the active buzzer.

// Code to make an active buzzer sound for 1 second and go off

//Author: Adesola Samuel

//Date: November, 2020.

//put the positive pin of the buzzer to pin 7

#define buzzerPin 7

void setup() {



//The buzzer on for 1 second and off for 1 second

void loop() {






Step 4: Application

The active buzzer can be use in alarm system. The system can be based on a motion sensing whereby the buzzer sound whenever motion is detected. You can also apply the buzzer in many other ways depending on your project and imagination.