In previous post, the project was how to play music using sd card adapter, arduino. In this project the different thing is that we will use amplifier in this project to amplify our music. If you would made that project you will notice that volume was too low. So to make music louder we use amplifier.
Here in this project we will use IC 6283 audio amplifier. So, the things that you need are:
#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.
Now you are ready to rock.
Here in this project we will use IC 6283 audio amplifier. So, the things that you need are:
- SD Card Adapter
- Arduino(Nano or UNO)
- Audio Amplifier Circuit(IC 6283)
- SD Card
- Connecting Wires
- Speaker(With this amplifier you can use upto 20watt speaker).
Connections of IC 6283 amplifier.
You can use any amplifier circuit other than this. This amplifier is dual channel, you can use one chanel. As in picture two speakers are connected, you can use single speaker.
So first choose some music files that you like most. Now you have to convert these files to "wav." format in order to play through SD Card Adapter Module. You can convert these files using Format Factory or online(click here).
Now its time to make connections.
Upload these codes to your arduino:
#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.
Now you are ready to rock.
Comments
Post a Comment