How to Make an Audio Player with Speaker Using the Arduino Uno!




This Arduino project is a simple and fun project you can build in 10-15 minutes. The result of this make will be an Arduino audio player that plays “.wav” files. It consists of a speaker, a simple transistor acting as an amplifier, and a micro-SD card adapter with a micro-SD card in it where the .wav files are loaded and played.

How to Make an Audio Player with Speaker Using the Arduino Uno




Required Materials

Hardware:

  1. Arduino Uno (Any other Arduino except Duo will work)
  2. Micro-SD card adapter
  3. 8-ohm speaker
  4. Micro-SD Card
  5. Mini Breadboard
  6. BC 546b NPN transistor
  7. 7k Resistor
  8. Male-to-male jumpers

Software:

How Does it Work?

The Arduino in the circuit shown below loads the .wav files from the micro-SD card. It then generates a signal and outputs it through the speaker connected to digital pin 9. This makes the speaker create sounds and play music. It can play many different songs saved on the micro-SD card. In this tutorial, I have programmed the Arduino Audio Player to play ‘Rain Over Me”, by Pitbull and Marc Anthony.

The .wav files used in this circuit have a slight limitation in playing audio. Since a transistor is used as an amplifier, it cannot read complex .wav files. Therefore, the .wav files should be converted to have these dimensions:

-Samples Per second (Hz): 16000
-Channel: Mono
-Bits Per Sample: 8

Converting files to .wav file Format for Your Arduino Audio Player

You don’t need to install any software in order to convert the songs to .wav files. There’s an online music converter to do the work.

Follow the steps given below to make songs compatible with your Arduino audio player:

  1. Upload a music file or enter a link for the song or audio file to be converted. You can even choose files from Dropbox or Google Drive.
  2. In optional settings, change bit resolution to 8 bit.
  3. Change sampling rate to 16000 Hz.
  4. Change audio channels to Mono.
  5. Click on “Show advanced options”.
  6. Set the PCM format as PCM unsigned 8-bit.
  7. Click on “Convert” and the files are converted

Arduino-Audio

Formatting Your Micro-SD Card

  1. Download the SD Formatter tool.
  2. Run the tool as administrator.
  3. Select the proper drive to format. Give the card your favorite name by writing it on Volume label and click the “Format” button. It will prompt you with a couple of dialogues. Click on them and your card will be formatted perfectly!
  4. Add the previously converted .wav files to the card and save them with simple names such as ’81.wav’.

Preparing Your Circuit

MOSI – pin 11 on Arduino Uno/Duemilanove/Diecimila
MISO – pin 12 on Arduino Uno/Duemilanove/Diecimila
CLK – pin 13 on Arduino Uno/Duemilanove/Diecimila
CS – depends on your SD card shield or module.
Pin 4 is used here for consistency with this Arduino code




Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Using SSH keys
DE1-SoC: Using SSH keys

The standard Linux SD-Card images that you can get for the DE1-SoC board from the Terasic website have the SSH...

Close
Scroll to top