Lesson 5 Passive Buzzer
Lesson 5 Passive Buzzer
Introduction
In this lesson, you will learn how to use a passive buzzer to generate eight
different sounds, each sound lasting 1 seconds: from Alto Do (262Hz), Re
(294Hz), Mi (330Hz), Fa (349Hz), So (392Hz), La (440Hz), Si (494Hz) to
Treble Do (524Hz).
Hardware Required
1 * RexQualis UNO R3
1 * Breadboard
1 * Passive buzzer
Principle
Passive Buzzer
a passive buzzer does not have such a source, so it will not beep if DC signals
are used; instead, you need to use square waves whose frequency is between
2K and 5K to drive it. The active buzzer is often more expensive than the
passive one because of multiple built-in oscillating circuits.
Code interpretation
int buzz = 12; //Not necessarily a PWM pin, any digital pin will
work!!!
int wait = 0;
void setup()
void loop()
wait = 500;
delay(1000);//wait for 1s
delay(1000);//wait for 1s
delay(1000);//wait for 1s
delay(1000);//wait for 1s
delay(1000);//wait for 1s
delay(1000);//wait for 1s
delay(1000);//wait for 1s
noTone(buzz);
Experimental Procedures
Schematic Diagram
Step 2: Open the code:Passive_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.