Introduction: Arduino Music

This is a tutorial on how to make music using the arduino. This reminds me of the music that was made for the old Nintendo system when there was no such thing as a DSP (digital signal processor), Back then all they had was 0V and 5V to play with. However, if you toggle these high/low at certain frequencies and pipe the voltage to a piezo speaker you can get what is basically video game music!


Items you will need:

  • arduino
  • piezo speaker
  • 100ohm Resistor
  • small switch

Step 1: Hardware Setup

First you will need to make the connections as follows.

The speaker will be connected through the 100ohm resistor to D8 on the Arduino board. Then you will connect the switch to port d12 and the other side to ground as shown.

Step 2: The Coding

Now you will flash the super_mario code to your board that has the different pitches and frequency timing to support the simple super mario theme in it.

To change the melody you will use the pitches.h file to see what notes and octaves are defined. All you need to do is change the melody[] array. Now so far as the timing I based it all on 1sec intervals so a 8th note is 1000/8 and a quarter note is 1000/4. you can change this timing to increase/decrease the tempo.

Here are some links to the videos:

Audio Challenge

Participated in the
Audio Challenge