This one is my favorite project. When comes to listening music on a system that is made by you feels you great. Components need you are given below:
If you want to make simple music system with much limited volume then you need:
Upload these arduino codes:
#include <SD.h> // need to include the SD library
#define SD_ChipSelectPin 10 // using digital pin 10 on arduino uno 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm;
void setup()
{
tmrpcm.speakerPin=9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
//Complimentary Output or Dual Speakers
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");
}
void loop() {
// put your main code here, to run repeatedly:
}
If you have any querry please ask in comments.
If you want to make simple music system with much limited volume then you need:
- SD Card Adapter Module
- Arduino(UNO or MINI)
- SD card
- Connecting Wires
- Speaker(0.5W, 8Ohm)
Select some music files and convert them to ".wav" format using format factory or click this to convert online(as in picture).
Now its time to make connections. Connect all the wires as shown.
Upload these arduino codes:
#include <SD.h> // need to include the SD library
#define SD_ChipSelectPin 10 // using digital pin 10 on arduino uno 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm;
void setup()
{
tmrpcm.speakerPin=9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
//Complimentary Output or Dual Speakers
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");
}
void loop() {
// put your main code here, to run repeatedly:
}
If you have any querry please ask in comments.
Comments
Post a Comment