Arduino 3 – Buzzers

Investigate

There are two kinds of buzzer, active buzzer and passive buzzer.
An active buzzer is widely used as a sound making element on computers, printers, alarms, electronic toys, telephones and timers.
It has an inner vibration source.
Simply connect it with 5V power supply, it can buzz continuously.

In This Lesson

In this lesson, we will use the Arduino to drive an active buzzer.
The active buzzer inside has a simple oscillator circuit which can convert constant direct current into a certain frequency pulse signal.
Once active buzzer receives a high level, it will produce an audible beep.

Design

Create the buzzer as shown in the image.
Connect + lead to pin 8.
Connect – lead to Gnd pin.




Develop – Code


int buzzer = 8;
void setup()
{
pinMode(buzzer, OUTPUT);
}
void loop()
{
digitalWrite(buzzer, HIGH);
}

Challenge

Using your skill of installing a switch, create a circuit with a buzzer and a switch.

Sketch you circuit in your book.