Introduction: LinkIt One Tutorials - #12 Audio Player

About: Focussing currently on supplying open source software to the masses. I supply linux CDs and DVDs across Europe, as well as mirror various open source projects. Currently I mirror openoffice.org http://rsync.…

In this tutorial we are going to be making an audio player.

The LinkIt One can natively play MP3, AAC, AMR and WAV files via the headphone and microphone jack.

Although you could question the need to play audio files, consider the difference between a hallowe'en pumpkin with LEDs and the same one with LEDs that says random things when you approach it.

Step 1: Materials Required

LinkIt One board

MicroSD card with audio files
32GB Class 10 maximum, files stored in /
Filetypes: MP3, WAV, AAC, AMR.

Headphones

Breadboard

Pushbutton

2 male to male jumper wires

Arduino IDE

Step 2: Program the LinkIt One With the AudioPlayer.ino Sketch

Disconnect all hardware from the LinkIt One.

Connect the LinkIt One to the computer and start the Arduino IDE.

Download the attached sketch and load it into the Arduino IDE.

Upload the sketch to the LinkIt One board.

Remove the USB cable from the LinkIt One board.

Step 3: Connect the Parts to the LinkIt One

Disconnect the LinkIt One from the USB cable.

We will now install the micro SD card into the dedicated slot on the LinkIt One:
Turn the LinkIt One board over and you will see a large silver piece of metal in the centre of the board and a smaller silver piece of metal to one side.

The smaller one is the piece we are interested in.

For future reference this is a combined SD card and SIM card slot. The SIM card goes into the top where you can see a number and the SD card plugs into the side, directly above the micro USB port.

Insert the SD card into the SD card slot, gold pins upwards and towards the board. Push the SD card in gently until it is flush with the edge of the LinkIt one board.

Slowly remove your finger from the SD card. I say slowly because the SD card is spring loaded and if it is not fully in position it has a tendency to fly across the room. Try finding an SD card that has gone behind the television.

If the SD card stayed in place and pushing it again you felt no movement it is in place.

To remove the SD card, push the edge firmly to release the internal catch which will eject the card so it can be pulled from the slot.

Turn the board over so you are looking at it the correct way up.

There is a small switch next to the word LinkIt which is usually set to SPI. Slide it to the other end which reads SD.
This enables the SD card slot but at the expense of pins D10 - D13 (so not more blinking onboard LED - it will always be lit while the switch is at the SD end)

Insert the headphones into the headphone jack next to the USB port. It looks like a headphone socket.

Insert the Grove LCD RGB Backlight connector as described in my previous tutorials (SCL/SDA/5V/GND).

Connect a pushbutton to the breadboard and wire it between GND and D4 on the LinkIt One.

Ensure the BAT/USB switch is set to USB and connect the Li-Ion battery.

To switch on the audio player slide the BAT/USB switch to BAT.


To make the audio play, press the switch once. It will then play each track in turn.

To skip a track, press the button again.

The LCD screen will display the filename (or part of it) while playing.

Step 4: Where Next?

Maybe the audio is too loud or too quiet. Adding a volume control could be an option.

Build a case for it from a box.

Update the sketch so it can use playlist files.

Play the songs in a random order.

Connect it to an external amplifier or FM transmitter to have your own radio station piped around your home or office.

Make a talking pumpkin for hallowe'en.

Experiment, have fun.

Remember to switch the SD/SPI switch bback to SPI when you are no longer using the SD card