Introduction: Arduino Tone Generator

Picture of Arduino Tone Generator

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

Picture of 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

Picture of 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

Picture of 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.


R Jordan Kreindler (author)2016-07-11

Thanks for this post. I will give it a try as it seems very "straight forward".

YuriSantosTeixeira made it! (author)2015-09-11

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 "delay(500);" so it keeps playing forever.

sspence (author)2015-09-09

The Arduino can drive a speak all on it's own, very easily. It's got quite a bit of volume.

About This Instructable




Bio: Hi, I just launched an Indigogo campaign support my projects by backing it.
More by ThisIsSteve:Linkit One Text to SpeechLinkit One Kitchen TimerIntel Edison Talks to Linkit One
Add instructable to: