0% found this document useful (0 votes)
43 views6 pages

Lesson 4 Active Buzzer

Uploaded by

cejek20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views6 pages

Lesson 4 Active Buzzer

Uploaded by

cejek20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

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

 2 * M-M Jumper Wires

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

int buzzer = 12;//the pin of the active buzzer

void setup()

pinMode(buzzer,OUTPUT);//initialize the buzzer pin as an output

void loop()

unsigned char i;

while(1)

//output an frequency

for(i=0;i<80;i++)

digitalWrite(buzzer,HIGH);

delay(1);//wait for 1ms

digitalWrite(buzzer,LOW);

delay(1);//wait for 1ms

//output another frequency

for(i=0;i<100;i++)
{

digitalWrite(buzzer,HIGH);

delay(2);//wait for 2ms

digitalWrite(buzzer,LOW);

delay(2);//wait for 2ms

Experimental Procedures

Step 1: Build the circuit

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.

Step 4: Upload the code to the RexQualis UNO R3 board.

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.

You might also like