Simple Arduino Sound Board (Arduino Leonardo)
by tanyaa_wuu in Circuits > Arduino
368 Views, 1 Favorites, 0 Comments
Simple Arduino Sound Board (Arduino Leonardo)
This project teaches you how to make a simple Arduino sound board, using three buttons and a buzzer. Each button will have a corresponding note and the buzzer will play three different notes. In the end, you can also make a melody using the 3 notes C,D & E to play the first 2 bars of "Butterfly", a Mandarin nursery rhyme. This project is useful as the buttons can help you model piano keyboards and you can learn to play a simple rhythm or song.
Inspiration for This Project
I got the inspiration for this project on:
Materials You Will Need
- an Arduino board
- a breadboard
- an USB Cable
- 10 x Jumper wires
- 3 x Buttons
- 3 x blue ohm resistors
- 1x buzzer
- Your laptop (to connect to Arduino)
How to Make This Project
Follow the images to connect the jumper wires and ohm resistor with the buttons and buzzer. The three buttons are connected the same way (one button is connected to digital pin 2, one is connected to digital pin 3~ and one is connected to digital pin 4) After you finished making your product, plug the USB cable to the laptop so your Arduino board gets the code and the project should work.
Note: You should prepare more jumper wires just incase
Uploading and Changing My Code
The modified code (that you can copy and paste):
https://create.arduino.cc/editor/tanyaaaaa/86510ce...
What I modified: I changed each individual tone in the code to change the pitch of each note to create the notes for the song, for example:
Original code: tone(buzzPin, 1000, 300)
Changed code: tone(buzzPin, 300, 300)
This makes the modified code have a lower pitch than the original code and all 3 buttons now have different pitches than the original.
tone(buzzPin, 300, 300)= note C (Do)
tone(buzzPin, 400, 300)= note D (Re)
tone(buzzPin, 500, 300)= note E (Mi)
Done :)
Find a shoebox to put your finished Arduino product inside (optional)
How to make the box: Cut a hole on top on the lid of the box so that the buzzer and the 3 buttons can poke through
Final Product (Playing "Butterfly"):