Melody LED Music Button - Arduino Creative Projects – Kuongshun Electronic Shop
  • ·Tel: +86-755-23956813 ·Email: info@kuongshun.cn
Wish List

Melody LED Music Button - Arduino Creative Projects

The experiment combines a buzzer, many LED light, a matrix keyboard, and Arduino UNO R3 board, controlling the LED to make different tones by pressing the button, and can play the entire piece of music. At the same time as the buzzer sounds, the LED water lamp will also produce the effect of sound waves according to the level of the tone.

 

 

 

 

 

 

Item List

1x Arduino UNO board
1x USB cable
9x Led
1x Breadboard
Many Cable
1x 100Ω resistor
1x Passive buzzer

 

The Buzzer

According to the principle of sound generation, it is divided into voltage buzzer and electromagnetic buzzer. Here we use electromagnetic buzzer.After the power is turned on, the diaphragm vibrates periodically.

It should be noted that the vocalization is caused by a magnetic field generated by an electric current inside, which causes the diaphragm to vibrate for an instant.

If the internal is always DC, we can only hear a short sound. What should I do if I need continuous sounds (such as playing simple songs)? Just add an AC drive circuit. Can drive the simplest square wave.Here we are using a passive buzzer.

Below I list some of the frequency of the notation:

D1

262

M1

523

H1

1045

D2

293

M2

586

H2

1171

D3

329

M3

658

H3

1316

D4

349

M4

697

H4

1393

D5

392

M5

783

H5

1563

D6

440

M6

879

H6

1755

D7

494

M7

987

H7

1971


These frequencies are used in the parameters of tone() to generate a fixed frequency PWM signal to drive the buzzer to sound. The vocalization time can also be controlled by parameters.

 

 

8x8 Matrix Keyboard

The matrix keyboard consists of 16 buttons and circuits. Each button has two interfaces. The interface on one side is connected to the pin defined on the arduino as the output high level, and the other side is connected to the pin defined as the input on the arduino.

When the button is pressed, the input pin will detect a high level and it will be judged in the program that the button is pressed. The matrix keyboard is to divide 4 of the 16 buttons horizontally and 4 vertically, and determine which button is pressed according to the horizontal and vertical coordinates.Four of the eight pins are connected to the output and four are connected to the input.

8x8 matrix keyboard 

   

  

 

 

 

  

 

 

 

Circuit Schematic

Melody LED Music Button  

 

 

 

  

 

 

   

 

 

 

 

 

 

 

 

 

 

 

Code

 

 

Leave a comment

Your Name *

Email address *

Message