25
Lesson 6 Playing Music
Overview
In this lesson, you will learn how to program the UNO R3 or MEGA 2560 board to control a
passive buzzer, and then make the passive buzzer play music.
Components Required
Name
Qty
Name
Qty
UNO R3 or MEGA 2560
1
1KΩ Resistor
3
Passive Buzzer
1
LED
3
220Ω Resistor
1
Breadboard
1
NPN Transistor (S8050)
1
DuPont Wire
10
Component Introduction
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 like the active buzzer. The
principle of passive buzzer is using PWM to generate audio signal by making the air vibrate.
As long as you change the vibration frequency appropriately, it will generate different sounds.
And the frequency should be limited between 2KHz and 5KHz.
Summary of Contents for Ultimate Starter Kit for Arduino
Page 1: ......
Page 2: ......
Page 3: ......
Page 17: ...17 Wiring Diagram Result LED is lit up and went out gradually like breathing...
Page 24: ...24 Wiring Diagram Result The buzzer will ring for 2s and then mute for 2s...
Page 26: ...26 Result The passive buzzer will play music and the LED blink simultaneously Wiring Diagram...
Page 74: ......
Page 79: ...79 Wiring Diagram...