Simple Audio Player

Simple Audio Player

The MediaTek LinkIt ONE board is truly jam-packed with goodies, with features like GPS, GSM, GPRS, WiFi and BLE, all of which are on a board with the form factor of an Arduino UNO. What really left me (and many others) so impressed was that this board costs only about $60, and one receives an Li-ion battery and some antennas along with it too! Yayy, we can’t wait to start making stuff!

To be honest, what really made me excited about this board was that it has Audio out (a 4-pin AUX pin connector built-in). Why? You see, phones aren’t allowed in my school, so I wanted to make a audio player from scratch which I could take to school. As the audio player would be bare circuit boards, I could easily pass it off as a physics project, say.

The Linkit ONE is the perfect board for this purpose; it already has a built-in SD card socket and an Audio Out, so very few external components are required. In addition to that, there are code examples which explain how to use this feature.

Features of Audio Player:

  • Can play .wav, .mp3, .aac, and .amr files
  • Can use SD card upto 32GB
  • Informative LCD screen
  • Minimal external components, so easy to use
  • 1050mAh battery (with built in charger)
  • Easy to make
  • Portable
  • Looks like any other electronics project (if you go to a school where devices aren’t allowed, you can take this Audio player along and not get caught!)

Task 1: Project Details and Materials Required…

Simple Audio Player

Prerequesites: You should have your Mediatek Linkit ONE set up and ready to upload sketches to.

Cost: ~$75 (including Linkit board, which is about $60)

Difficulty: Easy

Time Required: ~ 1 hour

Bill Of Materials:

  • Linkit One board (Seeed)
  • Li-ion battery (The linkit one box includes one)
  • General purpose PCB
  • Male headers
  • 5 push buttons
  • Grove I2C RGB LCD (Seeed)
  • Earphones or headphones or an AUX speaker (buy one here)

Task 2: Solder The Buttons…

Simple Audio Player
Simple Audio Player
Simple Audio Player

There are 5 buttons in all, each for Play/Pause, Next song, Previous song, Volume Up and Volume Down. The diagram above shows the arrangement of the buttons on the PCB along with the connections. Feel free to change the pin configurations (though remember to modify the code accordingly); here are my connections:

  • prevPin = 7;
  • playPin = 5;
  • nextPin = 3;
  • volumeUpPin = 4;
  • volumeDownPin = 6;

Task 3: Connect The LCD Screen…

Simple Audio Player
Simple Audio Player
Simple Audio Player

What’s great about the Linkit board is that it already has a grove 4 pin connector built-in, to which we can directly connect the LCD. No shield required!

Task 4: Connect The Button PCB…

Simple Audio Player

Here are the pin connections again:

  • prevPin = 7;
  • playPin = 5;
  • nextPin = 3;
  • volumeUpPin = 4;
  • volumeDownPin = 6;See the above picture and its tags for help.

Task 5: Add Songs To A MicroSD Card…

Convert The Songs to .mp3, .wav, or .aac (if it isn’t already)

  • Download an audio converter (like Media Human converter)
  • Select songs to convert
  • Convert songs to .mp3 (constant bitrate), .wav (though this creates HUGE files), or .aac (recommended, best sound quality)

Transfer songs to SD card:

Simple Audio Player

Make sure all the songs aren’t in a folder.

Task 6: Insert The SD card…

Simple Audio Player

Task 7: Upload The Code!

Below are two attachments: the main .ino file, and a .h header file. Download both of them, and then place them in a single folder names my_player. When you open this code, two tabs containing each file should be visible. Change the button pins if required.

Select the Linkit ONE board and correct COM port, and upload!

Note: The board sends debug messages on the serial COM port, which may be helpful if you are facing problems.

Simple Audio Player

chars.h

Simple Audio Player

my_player.ino

Task 8: Connect Battery…

Simple Audio Player
Simple Audio Player

Connect the battery as shown above. See the tags of the image to see how to switch on/off and charge the board.

Task 9: Connect Earphones…

Simple Audio Player

Task 10: Play!

Simple Audio Player
Simple Audio Player
Simple Audio Player
Simple Audio Player

I don’t know if I should be surprised, but the audio quality delivered by the LinkIt is pretty damn good! The screen periodically shows the volume level and battery percentage (because the screen is too small to display everything at once).

I hope you enjoy making stuff with your Linkit! Any comments, questions and suggestions are welcome!

microcontrollers – Simple Audio Player, in category: technology

Written by admin