Help with Audio player

I'm trying to play audio through a speaker (8 ohm 0.25w) via an amplification module (lm386). The sounds come from a 32gb sd card in a micro sd adapter connected to the arduino. Each file is an 8 bit wav 88200 mhz. Every time I run the code I wrote it makes a "cilck" noise, then sort of hums/buzzes, not playing the required sounds.


 
#include <SPI.h>     // include Arduino SPI library
#include <SD.h>      // include Arduino SD library
#include "TMRpcm.h"  // include TMRpcm library
 

 
TMRpcm audio;

 
void setup(void) {
  Serial.begin(9600);
 
  Serial.print("Initializing SD card...");
  if (!SD.begin(10)) {
    Serial.println("failed!");
    while(true);  // stay here.
  }
  Serial.println("OK!");
 
  audio.speakerPin = 3;  
 
  audio.setVolume(7); 

  audio.play("1.wav");
 
}
 
// main loop
void loop() {
  
}
 

Here's a wiring diagram

Doesn't the SD card require a ground connection?

I believe that a Uno is limited to 9 as speakerPin.

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