Introduction: Arduino Playing the Melody With the Sd Card

This project is in SD card loaded stolen melody is provided by command sent from the serial monitor.
If you want to add the application var.siz 6-melody melody melody file must be the same as the name of the specified code name.

The components are used:

Arduino UNO

SD card reader


Step 1: Arduino Code

//pin in sd card input module ** MOSI – pin 11 ** MISO – pin 12** CLK – pin 13** CS – pin 4

#include <SD.h>// SD card library

#define Sd_Chip_pin 4

#include <TMRpcm.h>// playing the melody library

char val;TMRpcm tmrpcm; // Create a melody function

void setup()

{ Serial.begin(9600);

tmrpcm.speakerPin = 9; // 9 pin to attach digital speakers + leg

if (!SD.begin(Sd_Chip_pin)) {

// sd module bağlanma return; } }

void loop()

{ if (Serial.available())

{ delay(100);

while(Serial.available() > 0)

{ val =;

if (val == ‘1’) { // 1 steal 1.wav file sends data“1.wav”);


else if(val == ‘2’)

{ // 2.wav 2 sends data to steal files“2.wav”); }

else if(val == ‘3’)

{ // 3.wav sends data to steal files“3.wav”); }

else if(val == ‘4’)

{ // 4.wav 4 sends data to steal files“4.wav”); }

else if(val == ‘5’)

{ // 5.wav 5 sends data to steal files“5.wav”); }

else if(val == ‘6’){ //6.wav 6 sends data to steal files“6.wav”);





Step 2: Video


sentiner made it! (author)2016-11-27


I have an error in uploading .

How can i solve this???

Screenshot (1).png
ffink made it! (author)2015-10-05

does it matter to the arduino what resistance the speakerphone has?

nazmo76 made it! (author)nazmo762015-11-19

Sorry if I interfere, but if you are talking about the impedance of the speaker (it's kinda the same of a resistance but in an alternative circuit, like with sound), as long as your speaker is little as the one the author used, everything should be fine.

smandal13 made it! (author)2015-08-18


sezgingul made it! (author)2015-08-16

Atul N Yadav use arduino mp3 module for your project.example project, I will publish in the coming days.

Atul N Yadav made it! (author)2015-08-16

Great stuff.....I wish to build a capacitive touch alphabetical board. So it would be like playing alphabet A,B,C.....when kids touch the Alphabet on board.......I guess I have to find wav files :)

Thanks :)

sezgingul made it! (author)2015-08-16

thank you Saiyam and Optimus_Grime

P0tat07 change information to English

Saiyam made it! (author)2015-08-15

Nicely done!

Optimus_Grime made it! (author)2015-08-15

Hey this is a great instructable!!

P0tat07 made it! (author)2015-08-15

This looks like it will aid me in my quest to make an electronic drum kit! Hope it won't be to hard to use this in English.

About This Instructable




Bio: Mechanical engineer, Entrepreneur, Maker, robotic systems expert and Robimek founder
More by sezgingul:Arduino Mini CNC Making Robot Hand With  Plastic PipesUse of Microphone Module
Add instructable to: