loading

Hi everyone, because I'm a big fan of GoT, I decided to make my own version of GoT Theme opening sound track. I know little about notes and beats, by following simple piano tutorial in YouTube, using Arduino pre-built functions with tones, trial and error and patience for 400+ lines code, I came up with full playing GoT theme.

Someone asked me if I can make a device that play when he/she enter his/her room and Star wars theme will play. I'm not a big fan of Star wars, that's why I choose GoT. Because I put an Infrared distance sensor, you can place this project inside your CR while pooping and sitting on you porcelain throne.haha.

Step 1: HARDWARE

You'll need:

Arduino

Mini-speaker or buzzer

Infrared Sensor(logic LOW)

Wires

Working Brains

Circuit Description:

I will not provide images for the circuit 'cause it so simple

1. Pin 4 of Arduino to buzzer/mini-speaker

2. Other terminal of buzzer/mini-speaker is connected to ground of Arduino

2. Pin 6 as input for you sensor signal pin, and the other two pins is for 5v and ground

of arduino

3. And add power supply or battery on your Arduino

Step 2: SOFTWARE

I'm going to fix some notes. And for now, I'll provide partial of my code. Open my uploaded txt file and upload the code on your Arduino.

Some useful info.

1. In order to create or mimic notes using microcontroller, you need to oscillate an output with define frequency.

2. Defined frequency has corresponding note, like DO-RE-MI-FA etc.

3. Arduino uses pre-built function("tone( pin# , frequency)"), this function uses timer interrupt to make an oscillating square wave.

4. Beats can apply through delay functions.

5. If some melody are repeating, use for loop.

SUPER SIMPLE project

ENJOY!!! :D

<p>As I looked at your code i didn't find it that easy.</p><p>My way to melodies on arduino is creating an 1-dimensional array including the notes and another including the note-&quot;value&quot; like this:</p><p>int melody[] = {<br> NOTE_E7, NOTE_E7, 0, 0, NOTE_E7,<br> 0, NOTE_C7, NOTE_E7, 0,<br> NOTE_G7, 0, 0, 0,<br> NOTE_G6, 0, 0, 0,<br>...<br>};</p><p>and </p><p>int noteDurations[] = {<br> 12,12,12,12,<br> 12,12,12,12,<br> 12,12,12,12,<br> 12,12,12,12,</p><p>...</p><p>};</p><p>Later on there's a little iteration trough the arrays.</p><p>It think this is much easier to edit.</p>
<p>Hi There, I'm very thrilled I finally found this! But I want to link it to a LDR. So if the light on the LDR darkens I want the tune to immediately stop. Can you, or anyone, help me with this? Now it continues playing until the tune is ended and only then the LDR reacts.</p>
<p>Put this:</p><p><strong>if(digitalRead(sensorPin)) return;</strong></p><p>before every tone() or notone() function call.</p>
<p>Hi, I just made this a couple of days ago. I was wondering if you could explain to me how to make/change the songs used in the code? Because I would like to make it so that whenever I go inside my room, the &quot;discovery/puzzle solved&quot; from LoZ would play with this</p>
<p>This is really cool. I'm going to make something like this for school. ;)</p>
<p>Enjoyed this one!... are you using a speaker or a piezo buzzer?</p>
<p>speaker from an old phone..</p>
<p>This is pretty cool....!</p>
<p>Thanks.:)</p>
<p>Yeah might have to make this to aggravate the gf.. LMAO</p>

About This Instructable

14,947views

4favorites

License:

More by untimony:Game Of Thrones Theme on Arduino Android tablet to Android PC Desktop Arduino Time-and-Sensor-Based Android Music Player 
Add instructable to: