How to use a Piezo Buzzer with Arduino | Active and passive Buzzer Tutorial

Interface Piezo Buzzer with Arduino | Active and Passive Buzzer

Active and Passive Buzzer



Piezo Buzzer - A Piezoelectric buzzer, is a small, round device that can be used to generate around noise that is perfect for fire alarms and fire alarms.
An active buzzer produces a loud single noise whereas a Passive buzzer produces a variety of noise between 1.5 kHz to 2.5 kHz by switching it on and off different frequencies either using PWM or delay.

Working - Piezo contains a very thin plate inside that vibrates or moves to produce a loud noise when a current (alternating current) is applied. It is very simple to use because buzzers is not polarized and can be connected in either direction.

Video link: https://youtu.be/iutrqwSBUHo

In this experiment, we will try out both the Piezo Active buzzer and the Piezo Passive buzzer.

Apparatus Required: 1 Piezo Active Buzzer, 1 Piezo Passive Buzzer, Connecting wires, 1 Breadboard

Piezo Active Buzzer

Procedure:

  1. First of all, connect the Active buzzer to the breadboard. 
  2. Now connect the positive end (see the sticker or the leg which is bigger in length) of the Active buzzer to Arduino's digital pin 8 (red wire). 
  3. At last, connect the negative end of the Active buzzer to the ground (GND). 
  4. The connection is completed for Active Buzzer.


Arduino Sketch:
int buzzerPin = 8; 


void setup () 
{   
  pinMode (buzzerPin, OUTPUT); 

void loop ()
{   
digitalWrite (buzzerPin, HIGH);  
delay (500);   
digitalWrite (buzzerPin, LOW);   
delay (500); 

Piezo Passive Buzzer

Procedure
Note: The connection for the Passive buzzer is the same as of Active buzzer, therefore only change the buzzer i.e., replace the Active buzzer with the Passive buzzer.
Now that you have done that upload the sketch that is given below.

Arduino Sketch:

int buzzer = 8; // set the buzzer control digital IO pin 
 void setup()
 {  pinMode(buzzer, OUTPUT); // set pin 9 as output
 } 
 void loop() {  
for (int i = 0; i < 100; i++) {  // make a sound   
digitalWrite(buzzer, HIGH); // send high signal to buzzer    
delay(1); // delay 1ms   
digitalWrite(buzzer, LOW); // send low signal to buzzer   
delay(1);  
}  
delay(50);  
for (int j = 0; j < 100; j++) { //make another sound   
digitalWrite(buzzer, HIGH);   
delay(2); // delay 2ms   
digitalWrite(buzzer, LOW);   
delay(2);  
}  
delay(100); 

Post a Comment

0 Comments