Edit footer

Active Buzzer

About

Active buzzers have a oscillating source built into them, so a simple DC voltage will activate the buzzer. Though simple to use, the downside of the active buzzer is that the tone of the buzzer is fixed at a particular frequency and the loudness is more or less fixed. These are mainly useful for signaling or an alarm.

Starter Code

int buzzerPin = 4;

void setup() {
  pinMode(buzzerPin, OUTPUT); // initialize digital pin 4 as an output
}

void loop() {
  digitalWrite(buzzerPin, HIGH); // turn the buzzer on (HIGH is the voltage level)
  delay(1000); // wait for a second
  digitalWrite(buzzerPin, LOW); // turn the buzzer off by making the voltage LOW
  delay(1000); // wait for a second
}

Resources

https://www.instructables.com/ACTIVE-BUZZER-WITH-ARDUINO-UNO-R3/

×

Subscribe

The latest tutorials sent straight to your inbox.