Brijesh Singh
Published © GPL3+

DIY Song Player with Arduino Uno

Make a simple Audio Song Player using Arduino Uno and MicroSD card

BeginnerFull instructions provided3 hours26,585
DIY Song Player with Arduino Uno

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Catalex MicroSD card adapter Module
×1
Speaker 8Ω 1/2W
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Transistor 2n3904
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Optional if implementing circuit on breadboard

Story

Read more

Schematics

Arduino Song Player Circuit

Code

Arduino Song Player

Arduino
/*
 *  First we need to convert mp3 file to wav file with below setting
 *  bit resolution : 8 Bit
 *  sampling rate  : 32000 Hz
 *  audio channel  : stereo
 *  
 *  to convert mp3 visit link: https://audio.online-convert.com/convert-to-wav
 */
#include <SimpleSDAudio.h>

void setup() {
  
  SdPlay.setSDCSPin(4); // sd card cs pin
  if (!SdPlay.init(SSDA_MODE_FULLRATE | SSDA_MODE_MONO | SSDA_MODE_AUTOWORKER)) // setting mode 
  { 
    while(1); 
  }

}

int count = 1;
void loop(void)
{
  
  switch (count) {
      case 1:
        if(!SdPlay.setFile("music1.wav")) // music name file
          { 
            while(1);          
          }
          count = 2;
        break;
      case 2:
        if(!SdPlay.setFile("music2.wav")) // music name file
          { 
            while(1);
          }
          count = 3;
        break;
      case 3:
        if(!SdPlay.setFile("music3.wav")) // music name file
          { 
            while(1);
          }
          count = 1;
        break;
    }
    
  SdPlay.play(); // play music
  
  while(!SdPlay.isStopped())
    { 
      ;
    }

}

Credits

Brijesh Singh

Brijesh Singh

23 projects • 38 followers
Utilizing the spare time to Make and Share DIY Electronics and IoT projects with the online maker community.

Comments