How To Make Arduino Tone Player?

Arduino Tone Player

Hello friends, how are you ? Today in this tutorial we are going to make "Arduino Tone Player".

Arduino is an excellent way to simplify and speed up your microcontroller projects, thanks to its community of developers who have made almost everything look simple. There are lots of Arduino projects out here for you to try and have fun. Some of your projects might need some sounds action to notify about something or just to impress the viewers. What if I told you that almost any theme songs that could be played on a piano can be mimicked on your Arduino with the help of a simple program and a cheap Piezo speaker?
In this tutorial we will learn how simple and easy it is to Play Melody on Piezo Buzzer or Speaker using the Arduino tone () function. At the end of this tutorial you will be able to play some famous tones of Harry Potter theme song, Despacito etc. Check the Video at the end.

  Required Components:

  1. Arduino (any version – UNO is used here)
  2. Piezo Speaker/Buzzer or any other 8ohm speaker.
  3. Breadboard
  4. Connecting Wires
  5. 100 ohm resistor

  Circuit Diagram:





  Software Part:

Here I am going to play Harry Potter theme song. At first, you have to download the MIDI version of the song which you want to play with Arduino Tone Player. It is very easy, just search in google like this " harry potter theme song MIDI download ". There are many websites which are providing these without money. so just download the MIDI file.You can also download your favourite MIDI file from hereThey have a good collection. Then we have to convert the MIDI file to arduino code. For this open this website.



It will look like this-






Click on "Choose File"-






Select the MIDI file-






Then scroll down and click on "Submit"-






Then it will look like this-





Now copy the whole code. Open Arduino IDE. And then paste the code-




First change the tone pin 4 to 8 as we use digital pin 8. Now you can change the Tempo value  And the Melody value. But before this read the comment highlighted on the image.
Now upload your code to Arduino. And your Arduino Tone Player is now ready.



You can get the complete tutorial in this video. 






Despacito cover with Arduino Tone Player





Thanks friends. Have a nice day.







SHARE THIS

Author:

Previous Post
Next Post