Lesson 4 Active Buzzer
Lesson 4 Active Buzzer
Introduction
In this lesson, you will learn how to generate a sound with an active buzzer.
Hardware Required
1 * RexQualis UNO R3
1 * Breadboard
1 * Active buzzer
Principle
Active Buzzer
An active buzzer will generate a tone using an internal oscillator, so all that is
needed is a DC voltage. A passive buzzer requires an AC 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.
To identify them, if you apply a DC voltage to them and it buzzes, it's active.
As far as commands go if you want to control the pitch, you would need a
passive buzzer. PWM on the Arduino can be used to control the pitch and the
volume at the same time (which may or may not be what you want). If you
wanted to change just volume or just pitch I suppose some external circuitry
would be required to change the amplitude without changing the voltage, and
vice versa.
Code interpretation
void setup()
void loop()
unsigned char i;
while(1)
//output an frequency
for(i=0;i<80;i++)
digitalWrite(buzzer,HIGH);
digitalWrite(buzzer,LOW);
for(i=0;i<100;i++)
{
digitalWrite(buzzer,HIGH);
digitalWrite(buzzer,LOW);
Experimental Procedures
Schematic Diagram
Step 2: Open the code:Active_Buzzer_Code
Step 3: Attach Arduino UNO R3 board to your computer via
USB cable and check that the 'Board Type' and 'Serial Port' are
set correctly.
Now, Listen carefully, You can hear beeps from the active
buzzer .
If it isn’t working, make sure you have assembled the circuit
correctly, verified and uploaded the code to your board. For
how to upload the code and install the library, check Lesson 0
Preface.