Simple Audio Player

by DangerousTim in Circuits > Microcontrollers

9001 Views, 132 Favorites, 0 Comments

Simple Audio Player

5666e02615be4d147d0002cc.jpeg
DSC_4643.JPG
DSC_4645.JPG

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!)

Project Details and Materials Required...

DSC_4581.JPG

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:

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

Solder the Buttons...

buttons.png
DSC_4603.JPG
DSC_4604.JPG

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;
  • Connect the LCD Screen...

    DSC_4605.JPG
    DSC_4607.JPG
    DSC_4633.JPG

    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!

    Connect the Button PCB...

    DSC_4611.JPG

    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.
  • Add Songs to a MicroSD Card...

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

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

    Transfer songs to SD card:

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

    Insert the SD Card...

    DSC_4614.JPG

    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.

    Connect Battery...

    DSC_4609.JPG
    DSC_4650.JPG

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

    Connect Earphones...

    DSC_4654.JPG

    Play!

    DSC_4646.JPG
    DSC_4648.JPG
    DSC_4634.JPG
    DSC_4645.JPG

    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!