Gogo:Tronics - Parts and Supplies For Electronic Enthusiasts
Your Cart

Gogo:Tronics

JQ8400 MP3 Player Module

The JQ8400 modules are simple modules which can play standard mono or stereo MP3 files, you can control (only) with a serial communications protocol (JQ8400 Arduino Library available), if you would like a module you can control with just some buttons no programming then see the JQ6500 instead. 

Models

JQ8400-TF

JQ8400-TF has a Micro SD card (aka TransFlash TF Card) slot so you can simply put your MP3 files on a Micro SD, this is the best option if you have a larger number of MP3s or larger MP3 sizes.  If you are making a music player, this is the one you want.

JQ8400-FL

JQ8400-FL has an onboard 32Mbit (4 Mega Byte) Flash drive, simply plug into your computer using a Micro USB cable and it will appear as a 4 megabyte drive you can copy your MP3 files directly to.

This is a good option if you just need a few small low bitrate MP3s which won’t change often.  If you are making a game with a few pew-pew sounds, perfect. 


General Playing Features 

The JQ8400 has a number of features in regards to how you can play files.

  • Play, Pause, Fast Forward (skip ahead), Rewind (skip back), Stop Playing
  • Skip to Next File, Previous File, Next Folder, Previous Folder
  • Auto repeat one file, all files, all files in same folder, random files across whole device, or random files in a single folder
  • Increase/Decrease/Set the Volume
  • Set equalizer, Normal, Pop, Classic, Rock, Jazz
  • A-B looping within a track (play track 1 from second A to second B repeatedly)
  • Play or seek to files by the FAT index number
  • Play files by a numeric1 folder and name (eg /01/001.mp3)
  • Play folder by numeric1 name (eg /01/*.mp3)
  • Interrupt a playing track and play another track (by FAT index), then return to the playing track (eg “we break into your programming with a special announcement” type of thing), in the library I call this “interjecting”.
  • Play a sequence of specially named2 files in a given sequence (which may have repetitions).

1 The limitation of two digit folder names (”00” .. “99”) and 3 digit file names (“000.mp3” .. “999.mp3”) only applies when you wish to play a file by name, you can name your folders and files pretty much anything and use next/previous or select by FAT index.  This limitation is also technically one of the Arduino library and for compatibility with the JQ6500 which has this as a hardware limit, however while the JQ8400 can “search play” for arbitrary file names the practicality is limited so sticking with 2/3 digit is better all around, actually using the FAT index selection methods is better all around as it will save you a lot of memory.

2 Sequence playing (datasheet calls it “combination”, but it’s really a sequence) in hardware is a bit odd, the files must be in a folder called “ZH” and they must have 2 character names, I recommend 2 digits, but you can use any 2 characters if you want.  The Arduino library calls this playSequenceByFileNumber (for numeric names 00.mp3 to 99.mp3) and playSequenceyFileName (for character names, any 2 ascii characters with .mp3 extension).  Again these must be in a folder called “ZH”.

Voltage and Power Supply

On the subject of voltage, the datasheet says 3.3 to 5V, best for 4.2V

I usually power at 5v.  

IO is 3.3v only, the only one you need to worrk about there is when you have a 5v microcontroller (Arduino) then you must use a 1k resistor in series between Microcontroller (Arduino) TX and JQ8400 RX. 

Insufficient Power Symptoms

The most common problem you will experience when your power supply is not up to the task is a “tick tick tick tick” type of sound, usually followed by a reset, either at the start of playing a track or sometime during (when the volume of the track increases). 

A computer USB port is not sufficient, if you want to power from the USB socket then I suggest to use a USB power supply capable of 1A at least, and a reasonable quality cable able to deliver that full 1A without dropping much voltage – remember, if your cable is long or poor or both then it throws volts away that the MP3 player needs!

The BUSY LED

People may confuse the BUSY LED with a power led, this led lights when playing, when not playing the LED will not light at all, this is normal, the BUSY LED lights when playing.  If your LED doesn’t light and you can’t get it to play either, then see the insufficient power symptoms above.

MP3 Format

The devices can play most Stereo MP3 files.   

On the off-chance you get a file that it can’t play simply re-encoding is the fix – I use the LAME Audio Encoder to re-encode “lame -m s inFile.mp3 outFile.mp3”, see below for other tips about re-encoding files.

The following sampling rates are supported:  8 / 11.025 / 12 / 16 / 22.05 / 24 / 32 / 44.1 / 48 kHz

Tips for Re-encoding files

For the JQ8400-FL particularly due to the limited space in the on board flash, you may wish (need) to re-encode your MP3 files to shrink them, using a lower bitrate.  The utility program “lame” can do this on the command line easily for Linux and Mac (obviously once you install it) the phone preset reduces the files to 16kHz and 16kbps which can reduce files significantly (with commensurate loss of quality).

$ lame --preset phone inputFile.mp3 outputFile.mp3

Or to really get it down, add -B 8 --resample 8 to the command in order to bring it down to 8kHz and 8kbps.

On Windows, try winLAME

For the JQ8400-TF, you might as well stick with higher quality and get a bigger SD Card :-) 

Uploading to the on-board memory.

This only applies to the JQ8400-FL with on-board memory.  Simply connect to your computer with a standard Micro-USB cable, and it will appear as a (small) flash drive, just like any other flash drive.  Copy your files to it as you please.

Uploading to an SD Card

Does not involve the JQ8400, put your SD Card into an SD Card reader and copy files to it.  As long as it is FAT formatted, should be fine. 

Audio Output

The modules both feature a built in speaker driver for a single (Left Channel or Mono) speaker on the SPK+ and SPK- pins, the volume of this output can be controlled.

I do not know specifications of the speaker, but from previous experience I would guess 3W, 8 Ohm.  

Additionally the Left and Right stereo channels are output on the DAC-R and DAC-L pins which you can feed into an amplifier or pre-amp along with a ground, I believe these are 0-3v relative to module ground.

External Speakers with Headphone Cut Off

From time to time, I’ve been asked how best to have it so when you plug in headphones, the speakers cut off.  This can be accomplished using the following parts…

Here is a schematic diagram of the general idea (click for bigger)

Control Methods & Wiring

The only control method available for the JQ8400 is via serial communications, an Arduino library s available to do this for you.

  1. Complete control with an easy to use Arduino Library for the JQ8400, this gives you the most control with some extra features such as equalizer modes, looping options, direct access to up to 65535 files on the SD Card, track names etc.
  2. Complete control by Serial communication protocol over TX/RX

Full Control with Arduino Library

For those of you using an Arduino, a library has been provided which gives you full control over just 2 pins (by default D8 and D9, but it’s up to you).

Full wiring details and download link complete with example code are available on github here:

JQ8400_Serial Arduino Library

Raw Serial Communications Details

If you’re not using the Arduino platform, or you want to write your own library, the serial comms protocol details can be found in this English translation of the JQ8400 datasheet.  The baud rate is always 9600, 8N1

Request commands are sent as a number of bytes, the first byte is always 0xAA, followed by a command byte, a byte indicating the number of data bytes (0-255), the data bytes if any, and a checksum byte.   The checksum is just the low 8 bits of the sum of all bytes previous in the command. 

Responses are not sent for all commands, for those that are, the format followes the request format.

It is relatively straight forward, I do suggest to take a look at implementation of the Arduino library referenced above as this will assist you in developing your own.

Again, if you are an Arduino programmer, just grab the library I wrote for you.  

The BUSY Pin

The devices have a pin called BUSY, when the module is playing a file then the BUSY pin outputs about 2.4 to 2.7v, when the module is idle it outputs 0v.  Please note that this voltage is not sufficient to register as a HIGH on a 5v microcontroller (like an Arduino), or not reliably at least.  So if you want to look at this pin you should either read it as an analog value, or level shift it from 2.7 up to 5v using your method of choice so you can reliably read it.

The ONELINE Pin 

Simple answer don’t connect to anything.

I think going from the Chinese datasheet that it is some one-wire type protocol instead of using serial TX/RX, but that it is somewhat timing dependant and rather sketchy in information.  So in other words, don’t use it, don’t connect it to anything. 

The USB DP and USB DM Pins (JQ8400-TF Only) 

I suspect these (obviously Data+ and Data-) are not useful and probably used for programming the device at the factory, but feel free to experiment.

The Datasheet

Here is the (rough) English Translation

Here is a full zip of the original Chinese datasheet, examples (7zip format), and a Windows executable program of some description – I strongly recommend you do not run the executable on a machine you care about, I do not know if it is safe (maybe it’s bad, maybe it is spyware, maybe it is going to trash your files.. I have no idea), use a Virtual Machine.   The password on the zip file is JQ8400

Here is the Chinese datasheet for the JQ6500, pro-tip, copy and paste from the datasheet into google translate.