Playing human voice on arduino SD card

We are trying to play a sound by using arduino and SD card.But when we start the circuit, the wav file in the Sd card speaker doesnt play the sound.We first thought the problem was in the speaker bu when we tested it, it worked well.Did anyone had the same problem?How can we fix the problem?Here is the code :

#include <SD.h>
#include <TMRpcm.h>

#define SD_ChipSelectPin 4

TMRpcm tmrpcm;

void setup() {
tmrpcm.speakerPin = 9;

if(!SD.begin(SD_ChipSelectPin)) {
return;
}
tmrpcm.setVolume(6);
tmrpcm.play("deneme.wav");

}
void loop() {
// put your main code here, to run repeatedly:

}

...I've never used TMRpcm.

.We first thought the problem was in the speaker bu when we tested it, it worked well.

Do you have an amplifier, or "powered" computer speakers, etc.? The Arduino can't directly-drive a 4 or 8-Ohm speaker.

void loop() {
 // put your main code here, to run repeatedly:


}

IF your file does play once, you'll be stuck in an infinite do-nothing loop until you power-cycle or reset your Arduino.

And, that "put your code here" is a note to you, the programmer. It really doesn't belong in your finished program. :wink:

Thank you but there is no sound coming from the speaker while using SD card.I have searched amplifers but they make the sound come much better.

Thank you but there is no sound coming from the speaker while using SD card.I have searched amplifers but they make the sound come much better

If you have powered computer speakers, try them (but see below).

The Arduino is rated for 40mA "absolute maximum". And we know the Arduino runs at 5V so from [u]Ohm's Law[/u] we can calculate a MINIMUM resistance (or impedance) of 125 Ohms.

Audio amplifiers (and powered speakers) typically have an input impedance of 10K - 100K Ohms.

But, DON'T connect the Arduino to your home stereo because the Arduino doesn't have a true-analog output. TMRpcm puts-out a "nasty" 5V high-frequency PWM signal and "bad things" can happen if you feed it into an amplifier, especially if you don't filter it. If you have expensive powered computer speakers you may not want to take a chance with them either... :frowning:

What is the format of your wav file? TMRpcm.h will only play a limited range of options.

BTW a schematic/diagram showing how everything is connected or even one picture clearly showing the complete connected project would be a lot more useful than just pictures of unidentified individual components.

Steve

here is the circuit

You need an audio amplifier.

Connecting a speaker directly to a port pin can destroy the pin, and possibly even the Arduino.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.