Lithium ION
Published © GPL3+

Active and Passive Buzzer- Discussed

let's have a look on the buzzers working and internal circuitry. How to Operate with different buzzers using Arduino

BeginnerFull instructions provided1 hour3,880
Active and Passive Buzzer- Discussed

Things used in this project

Hardware components

Buzzer
Buzzer
×1
Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

PCBWAY

Hand tools and fabrication machines

Breadboard, 170 Pin
Breadboard, 170 Pin
10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long

Story

Read more

Schematics

Active Buzzer

Passive Buzzer

Code

Active Buzzer

Arduino
int buzzerPin = 8;
int buttonPin = 7;
void setup() {
pinMode(buzzerPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
digitalWrite(buzzerPin, HIGH);
}
if (buttonState == HIGH) {
digitalWrite(buzzerPin, LOW);
}
}

Passive Buzzer

Arduino
int buzzerPin = 8;
void setup() {
pinMode(buzzerPin, OUTPUT);
tone(buzzerPin, 1000, 2000);
}
void loop() {
tone(buzzerPin, 440); // A4
delay(1000);
tone(buzzerPin, 494); // B4
delay(1000);
tone(buzzerPin, 523); // C4
delay(1000);
tone(buzzerPin, 587); // D4
delay(1000);
tone(buzzerPin, 659); // E4
delay(1000);
tone(buzzerPin, 698); // F4
delay(1000);
tone(buzzerPin, 784); // G4
delay(1000);
noTone(buzzerPin);
delay(1000);
}

Credits

Lithium ION

Lithium ION

51 projects • 33 followers
A passionate electronics DIY boy. Currently improving in Embedded systems, soldering and programming.

Comments