The best way to learn about the Arduino is to play with the basic examples in the Arduino IDE. In this instructable I'm going to show you how to generate a melody from an Arduino. The Arduino might not have enough ram to stream music but it has sufficient ram to generate some common melody.

Note- An Arduino is not capable handling a speaker on its own, so an external amplifier is required.

So lets get started....

Step 1: Tools and Components

All that you need for this instructable is -

  • Arduino UNO
  • A Speaker with an amplifier
  • Alligator clips
  • Jumper wires

Step 2: Circuit

Well, there is not much of a circuit all you need is to clip the alligator clips as shown in the picture and connect one of the clips to Arduino ground and the other to Digital pin 8, with the help of some jumper wires. Make sure you do not touch the 3.5mm wire when the speaker is ON.

Step 3: Code

The code for a test melody can be found in the Arduino IDE under examples => digital => tone melody. The tone will only stream once you can run it again by hitting the reset button.

Or just copy the code below and paste it in the IDE.

<p>Thanks for this post. I will give it a try as it seems very &quot;straight forward&quot;. </p>
<p>Tried with and without an amplifier with both an earphone and a small speaker, everything worked fine. Hint: copy/paste the FOR in the SETUP to the LOOP and add a &quot;delay(500);&quot; so it keeps playing forever.</p>
<p>The Arduino can drive a speak all on it's own, very easily. It's got quite a bit of volume.</p>

About This Instructable




Bio: Hey I'm a College school student, I love to work on projects and Arduino powers most of them. Follow me @ https://www.facebook.com ...
More by ThisIsSteve:Linkit One Text to Speech Linkit One Kitchen Timer Intel Edison Talks to Linkit One 
Add instructable to: