Mini-piano With Sample Tune

by 682324 in Circuits > Arduino

231 Views, 0 Favorites, 0 Comments

Mini-piano With Sample Tune

download.png

mini-piano that can play a tune. once you start the simulation it will play a well known Christmas song for you to try and replay with the five piano notes given to you.

Supplies

download.png
download.png

You'll need:

-Five 10k Ohm resistors

-Five pushbuttons

-Buzzer/Piezo

-Breadboard

-Arduino

Setting Up Pushbuttons

download.png

First we are going to connect the Arduino to the breadboard, then add the five pushbuttons in a row as well as connect one of the pins (terminal 1a) to power on the breadboard.

Adding Resistors

download.png

once the pushbutton are on we are now going to add the 10k ohm resistors to terminal 2a on the pushbuttons, the reason why we do this is because resistors limit the amount of current going to certain components in the circuit and to prevent a short to ground when the pushbutton is pressed

Connecting Buzzer

download.png

Next step is to add the Buzzer/Piezo. you can add it anywhere you have space on the breadboard as long as the buzzer pin connects to the right input on Arduino Uno.

Code

download.png
download.png

Once the circuit is set up the last step is to add the code.