HOW TO INTERFACE a PASSIVE BUZZER WITH ARDUINO

Introduction: HOW TO INTERFACE a PASSIVE BUZZER WITH ARDUINO

About: HIGHLY INTERESTED INTECH

Making sound on the arduino is an interesting project, this con be accomplish using different modules and devices depending on your project and choices. In this project, we'll be looking at the way you can make sound with a buzzer. Buzzer used by hobbyist come in two types: The active buzzer and the passive buzzer. For this project, we are going to be using an active buzzer. Check out my tutorial on using an active buzzer.

A passive buzzer requires a DC signal to make a sound. It is like an electromagnetic speaker, where a changing input signal produces the sound, rather than producing a tone automatically. Unlike the active buzzer that only requires a one-shot DC, the passive buzzer needs some technicality in producing note. Note that trying to use the passive buzzer without setting the output frequency will lead to production of no sound by the passive buzzer.

The Frequency you can pass to a passive buzzer ranges from 31 to 4978 with interval of 2 digits between consecutive frequencies e.g. 31-35-35 … You can study more on musical frequencies to fully understand each frequency. You can also check out my tutorial on “playing major notes with the passive buzzer”.

Step 1: Material

Arduino Board

Passive Buzzer

Jumper Wires

Step 2: Circuit DIagram

The circuit connection is very similar to the way you connect an LED to Arduino. The buzzer operates on 3-5V.

You can use any digital pin of the arduino for the positive pin and connect the negative pin to ground. There is need to use a resistor since the buzzer operates on 5V. You can recognize the positive pin by looking at the top side of the buzzer, you will a point marked "+", the pin on this side is the positive pin.

Step 3: Working Code

Below is an example code to control a passive buzzer.

void setup() {

// generates a 440Hz, 494Hz, 523Hz tones in output pin 7 with 2000ms of duration

tone(7, 440, 2000); //A

delay(1000);

tone(7, 494, 2000); //B

delay(1000);

tone(7, 523, 2000); //C

delay(1000);

// You can use the notone() function to stop the tone instead of using delay()

}

void loop() {

//Putting the code above in the loop function will make the tone be produced in a loop

}

Step 4: Application

As you can see from the example the passive buzzer can be used in many ways. One importance is also that it can fully work as an active buzzer, you just have to set it on your preferred frequency.

You can use the passive buzzer in creating music and different tones.

Be the First to Share

    Recommendations

    • Anything Goes Contest 2021

      Anything Goes Contest 2021
    • Fix It Speed Challenge

      Fix It Speed Challenge
    • Photography Challenge

      Photography Challenge

    Comments