Project 7 Active buzzer

1. Introduction Active buzzer is a sound making element, widely used 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.

2. Hardware required

  • Buzzer *1

  • Arduino board *1

  • Breadboard *1

  • USB cable *1

  • Breadboard jumper wires * 2

3. Connection for REV4

4. Connection for 2560 R3:

When connecting the circuit, pay attention to the positive and 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 programming.

5. Sample program Program is simple. You 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
}

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