Hello I am trying to use a arduino uno to have a loudspeaker play words. I have converted an audio file with 8 bit resolution, 16000 hertz sample radio and mono channel and put it on a micro SD card I put the micro SD into a adapter to be connected to the arduino uno. Just to make sure I did this right I put CS on pin 4, SCK on pin 13, MOSI on pin 11, and MISO on pin 12. Then I connected a loud speaker on pin 9 and uploaded this code.
Sorry if I made any errors but it uploaded to the arduino and every thing seemed fine except the loudspeaker would not play anything.
I tried a different code to make sure the loudspeaker worked and it did so it is not broken.
I put the micro SD into a adapter to be connected to the arduino uno. Just to make sure I did this right I put CS on pin 4, SCK on pin 13, MOSI on pin 11, and MISO on pin 12.
So is there level shifting components on this SD adapter card? SD cards run at 3V3 and the Arduino Uno runs at 5V. Putting a 5V signal into a 3V3 devide will cause damage in most cases.
I tried a different code to make sure the loudspeaker worked and it did so it is not broken.
What code?
How is the speaker connected? Serial capacitor and resistor?
What format is the SD card and is the file you are using at the top level?
This is a regular question answered many times before, most of the problems of this sort are caused by the incorrect format of the SD card.
Well the serial monitor did not say SD FAIL so I am pretty sure that the arduino is connected to the Micro SD card.
I connected the loudspeaker simply by putting the red wire in pin 9 and the black wire in ground.
The code I used for the loudspeaker was a simple tone(9, any number); sort of thing and it played notes up and down.
I do not know how to format an SD card so I looked it up and it is a way to delete files right? If so I only had 2 files in all as it is a new card and I deleted one but named the other file a different name.
I do not know what a top level file is. I just converted a recording to a wav file with the 8 bits,16,000 hertz, and mono channel.
So is one of these reasons the reason this is not working?
Thank you for your response.
Then put your file at the top level, that means not in any folder but where you get to when you open the SD driver on your computer. Then try the code again.
How big is this SD card anyway?
It is 32 gigabytes.
You probably will have to tell me step by step on how to create a top level file because I try to look it up and all I get is how to make top level folders.
You probably will have to tell me step by step on how to create a top level file
Really?
On your laptop click on the SD card icon. A windows opens up showing the top level of the card. Drag the file you want to use into this window. Then eject the SD card and remove it from your laptop.
Thanks for the picture but it is not clear enough to actually see any detail of your wiring. I notice you are still connecting the speaker direct to the Arduino. Why do you think I told you not to do this?
What is likely to be wrong now is your audio file. Can you post that?
Yeah for some reason it is not letting me make a diagram.
What do you mean about not connecting the speaker directly to the arduino? How should I connect it?
Here is the audio file.
Yeah for some reason it is not letting me make a diagram
Make or post?
When it does not let you it will say why.
Correct it won’t accept a .wav file you have to zip it up.
Speaker should be connected speaker - to ground speaker + to one end of a 120R resistor. Other end of resistor to the - side of a 47uF capacitor. Then the + end of the capacitor to the Arduino pin.
It is a series circuit so the actual order of these components doesn’t matter.
So here is the diagram now. The last pin for the adapter is ground and what you are saying is to add a resistor and capacitor to the positive pin of the speaker?
If yo have the picture in an image format, like png or jpg it will load automatically.
You have connected the SD cards to Vcc of the Arduino!!!!!!
Does the SD card board have a voltage regulator in it?
SD cards run from 3V3. The Vcc of an Arduino has what ever is plugged into the power jack minus 0.7V on it.
are saying is to add a resistor and capacitor to the positive pin of the speaker?