5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10

Arduino UNO R3/MEGA 2560 R3 Project 7: Active Buzzer

Posted by Fiona Su on


Active buzzer is widely used as a sound making element on computer, printer, alarm, electronic toy, telephone, timer, etc. It has an inner vibration source. Simply connect it with 5V power supply, it can buzz continuously.

Hardware List

  • Buzzer*1
  • Control board*1
  • Breadboard*1
  • Breadboard jumper wire*2

Video Tutorial


Connection for REV4:


Connection for 2560 R3:


When connecting the circuit, pay attention to the positive and the negative poles of the buzzer.
In the photo, you can see there are red and black lines. When the circuit is finished, you can begin the programming.

Sample Code:

Program is simple. You can control the buzzer by outputting high/low level.

int buzzer=8;// initialize digital IO pin that controls the buzzer
void setup() 
  pinMode(buzzer,OUTPUT);// set pin mode as “output”
void loop() 
digitalWrite(buzzer, HIGH); // produce sound


After downloading the program, the buzzer experiment is completed. You can see the buzzer is ringing.

All Tutorial



Leave a comment

Please note, comments must be approved before they are published