I am having trouble with my circuit. I am trying to make a circuit that will play a wav file that I have uploaded onto an sd card. An sd card module is connected to the arduino board with a speaker. I have already formatted the WAV file correctly and I am honestly not sure what I am doing wrong. All the components have been tested and they all work. I am not sure if I coded something incorrectly. I would really appreciate it if someone could help me out with this. The code is below.
I am also using an Arduino UNO board and I am able to upload a code and the code is verified and compiled. The weird thing is that IDE says that it is uploaded onto the board but no sound is being played at all. Therer is no error found when I try to upload
The weird thing is that IDE says that it is uploaded onto the board but no sound is being played at all.
That is not weird. All the compiler cares about it that the syntax of the code you wrote is sufficient for it to be able to translate it into machine code. What that machine code does when it actually runs is down to your code and the associated hardware connected to your Arduino.
The compiled can not possibly know if your code will do what you want because it can not read your mind only your code.
It looks like you have connected the player to pins 0 and 1. That means it only stands a chance of working if you disconnect it from the USB port. Then you will need to supply power to the Arduino separately.
I am currently making a project to play an audio(WAV) aloud using an 8 ohm speaker, a micro sd card, a micro sd card module and an Arduino uno. I have tried numerous tutorials and such to try and generate a sound but the audio will simply not play. When I tried to listen, there was no sound. When it was connected to a larger self powered speaker, only static would play. The module is working because it was able to write and interact with the sd card. The speaker is working because when I used the tone() function I was able to ply a series of beeps. At this point I am willingness to completely start over but it needs to happen soon. If anyone had an idea of how I can use the above materials to create something which will play a WAV file, please help me.
however since arduino chips are not really intended for the purpose. the playback is somewhat low quality and mono and eats up all your board's proccessing power while playing. also you need to convert your wavs to a very specific format and sample rate.
you can get little mp3/wav player modules for very cheap that can be controlled by arduino. they are much easier to set up, you usually don't have to reformat your sound files. they play higher quality and they playback in stereo. and most sopport mp3 too.
ive tryed a couple different ones and I reccommend an YX5300.
seems to be the easiest hookup and works well.
Grumpy_Mike:
It looks like you have connected the player to pins 0 and 1. That means it only stands a chance of working if you disconnect it from the USB port. Then you will need to supply power to the Arduino separately.
The speaker is connected to the other arduino GND and pin 9.
What advice can someone give that will make this work. If you have a different schematic or code that you think will work better, I am completely open to that as well.
taterking:
you can get little mp3/wav player modules for very cheap that can be controlled by arduino. they are much easier to set up, you usually don't have to reformat your sound files. they play higher quality and they playback in stereo. and most sopport mp3 too.
ive tryed a couple different ones and I reccommend an YX5300.
seems to be the easiest hookup and works well.
How should I code this circuit in order to allow the audio to play? Also is there a specific brand of this module that needs to be bought? Thanks!
the chip you are looking for is a YX5300. comes right up with a google. im sure there are different people making them but they all work the same. has 4 wires total. power, ground and serial connection.
it also has the SD card slot built into the bottom of the module. all you have to do is give it basic serial commands to control it. should be simple enough to google a tutorial. if you have any problems let me know.