Image Source
The SD Card Module is used for transferring data to and from the memory card. It allows for mass storage that we can be used in our project especially in data logging. And this tutorial aims to play audio files with your Arduino in decent quality from SD card.
What Will I Learn?
- How to use SD Card module
- Playing music with the use of Arduino
Requirements
- Arduino Uno
- SD Card Module
- SD Card
- Speaker
- Connecting Wires
Difficulty
- Basic
Tutorial Contents
Step 1: Physical Connection from SD Card Module to Arduino Uno
Connect the following:
- VCC to 5V of Arduino Uno
- GND to GND of Arduino Uno
- CS to pin 4 of Arduino Uno
- SCK to pin 13 of Arduino Uno
- MOSI to pin 11 of Arduino Uno
- MISO to pin 12 of Arduino Uno
- the 5V of speaker to pin 9 of Arduino Uno
- GND of speaker to GND of Arduino Uno
Step 2: Software Connection
- Connect the USB Cable to a PC/Laptop
- Open your Arduino IDE, change your board to Arduino Uno: Go to Tools > Board: > Arduino/Genuino Uno
- And also, change the Port settings: Go to Tools > Port: > COM6 (Arduino/ Genuino Uno)
- Then, download the library TMRpcm for asynchronous playback of PCM/WAV files direct from SD card. After downloading, extract the file and copy the folder then Go to your Program Files and find the Arduino Folder > libraries then paste the folder of TMCprm.
Step 3: Converting Audio to WAV
- Go to Audio to WAV Converter this will convert your mp3 file into WAV.
Change the bit resolution to 8 bit, sampling rate to 16000Hz, audio channels to mono. And in advanced options choose the PCM unsigned 8-bit then, convert the file. This will allow the arduino to play the audio file.
Step 4: The Code
- Copy the code then compile and run.
My Circuit:
Tip to remember: Before saving an audio file to the SD Card make sure it is WAV formatted because Arduino can only read a PCM signal which the WAV format has.
Thanks for reading! Hope you learn something.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
okay sir thank you 🙂
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
your page is very successful indeed happy to come back to me
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @kimp0gi I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
5 lang ako ani. Hahahha congrats
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
hahaha wohoo!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit