Hello
Im gonna explain my circuit and wiring and will ask the question after the code below
Im making a project that plays sound from an sd card through a speaker
Have an arduino uno along with an sd card shield
And made an amplifier circuit using the lm386 and a 0.5w speaker
The amplifier circuit i used is in this link http://www.circuitbasics.com/wp-content/uploads/2015/04/LM386-Audio-Amplifier-Great-Sounding-Amp-Diagram.png
from this webpage
Build a Great Sounding Audio Amplifier (with Bass Boost) from the LM386
The wiring goes as follows
-From sd card shield to arduino
Vcc -> 5v (ard)
GND -> GND (ard)
MOSI -> PIN 11
MISO -> PIN 12
CLK -> PIN13
CS -> PIN4
-from arduino to amply circuit
Pin 9 -> audio in +
GND -> audio in -
Power supply for amply circuit at 9v
Arduino powered from usb port
Audio file on sd card is unsigned 8bit
Sample rate @16khz
Audio mono
Now for the code
#include "SD.h"
#define SD_ChipSelectPin 4
#include "TMRpcm.h"
#include "SPI.h" TMRpcm tmrpcm;
void setup(){
tmrpcm.speakerPin = 9;
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD fail");
return; }
tmrpcm.setVolume(4);
tmrpcm.play("rain.wav"); }
void loop(){ }
----------------------
Now for my question upon making the amplifier circuit i tested it using my phone 3.5 mm audio jack
The quality and sound level were pleasing
that is ofcaorse at a fixed volume and gain on the amply circuit.
But when i hooked up the arduino with sd card shield the sound was terrible at volume level "6" on the code
Even when i tried different set of gain and volume on the amplifier circuit
The volume level that did NOT sound terrible is when i set the volume to "4" or lower on the code
but again that was substantially lower than my phones did
Is there anything i can do to make sound better or at least same as my phone outputed?