Ardumotive Arduino Greek Playground
  • Home
    • About us
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware
Available Languages
Picture
Picture

Introduction 

Picture
In this tutorial you will learn how to use a passive buzzer module with Arduino.Passive Buzzers is passive because it hasn't system that produces sound or sound on its own. It is necessary for the Buzzer a microcontroller, like an Arduino to produce sound.

What you will need - Hardware

For this tutorial you will need:
  • Arduino uno
  • Breadboard
  • Passive buzzer module
Picture

The Circuit

Picture
The connections are pretty easy, see the image above with breadboard circuit schematic.

The code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Arduino tutorial - Passive Buzzer Module 
   More info and circuit: http://www.ardumotive.com
   Dev: Giannis Vasilakis // Date: 12/11/2017  */
   
int buzzer = 8 ;
void setup ()
{
  pinMode (buzzer, OUTPUT) ;
}
void loop ()
{
  unsigned char i, j ;
  while (1)
  {
    for (i = 0; i <80; i++) // When a frequency sound
    {
      digitalWrite (buzzer, HIGH) ; //send tone
      delay (1) ;
      digitalWrite (buzzer, LOW) ; //no tone
      delay (1) ;
    }
    for (i = 0; i <100; i++) 
    {
      digitalWrite (buzzer, HIGH) ;
      delay (2) ;
      digitalWrite (buzzer, LOW) ;
      delay (2) ;
    }
  }
}
Download the code from here and open it with Arduino IDE.
passive_buzzer.zip
File Size: 0 kb
File Type: zip
Download File

Well done!

Picture
You have successfully completed one more Arduino "How to" tutorial and you learned how to use the passive buzzer module. I hope you liked this, let me know in the comments.


Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates