Jumbleum-Mono MP3 Music Player

2.3K915

Intro: Jumbleum-Mono MP3 Music Player

This project is a smaller, Mono version of my previous Jumbleum Player.

I have simplified the design to make it compact enough to fit in a small 3d-Printed case.

The main features are:

  • The tunes are "jumbled-up" (shuffled) to prevent repeats.
  • It is easy to use

The case can be fixed to the top of a small speaker cabinet.( I used an old Eltax bipolar rear surround speaker).

It is controlled either by the rotary-encoder knob or by an infra-red remote.

Two addressable RGB LEDs mounted behind the front panel provide mood lighting.

STEP 1: Circuit Diagram and Description

This design has a single, smaller Amplifier module (TPA3110) than in my original Jumbleum Player.

I have arranged everything to fit on a small square PCB about 77 x 77 mm (3" x 3").

Microchip PIC Microcontroller

The heart of the circuit is a Microchip PIC18F14K50 microcontroller. This chip was chosen as it has just enough memory available to jumble-up the music, fairly small (20 pins) and low cost. It is programmed in Assembler Language to control a DFplayer Mini MP3 module using a serial data protocol. (9600 Baud).

DFplayer MP3 module
The DFplayer module is a very low cost device for playing MP3 files using a built in Micro-SD Card holder. It has a 24-bit DAC output and 2 Watt Amplifier (Not used in this project). This module is easily available from eBay.

D-SUN Voltage regulator module
The PIC microcontroller, DFplayer module and RGB LEDs are powered at 5V by a D-Sun 3 Amp high efficiency switching regulator module. (available from eBay). The regulator module has a variable resistor which must be adjusted to output exactly 5 Volts before connecting it to any part of the circuit.

Alternatively there is a similar version of the D-SUN regulator module available from some eBay sellers that has a fixed 5V output. It looks identical to the original module except the small variable resistor has been replaced by a 44.2KOhm (63C) SMD resistor.

TPA3110 Amplifier Module (mono (PBTL))

This TPA3110 Class D (Digital) 30W PBTL mono power amplifier module (Type HW-328) is smaller than the one I used in my original design.

The Standby/Mute function reduces noise between tunes and while the player is stopped or paused.

It is powered directly from the external DC power supply which can be between 8 to 19.5 Volts.

Addressable RGB LEDs
Mood and status lighting is provided by two addressable RGB LEDs. (5mm through hole type PL9823.

Rotary Encoder

The player volume can be controlled by the rotary encoder.

On each turn of the knob, the PIC senses the turn direction and sends commands to the player to set the new volume level. The selected volume level is saved to the PIC eeprom to be retained even after power-off.

The Rotary Encoder Button
A short press instructs the PIC to select a new tune. If the the button is held pressed for a few seconds, the PIC stops the current tune and mutes the amp. The next press of the button selects and plays a new tune.

Remote Control
A VS1838B IR 38Khz remote sensor allows the player to be controlled by an NEC protocol IR remote control. The remote controls all functions: Volume, Next Track, Stop and EQ selection plus Pause/Resume.

STEP 2: Construction

I designed the PCB with Kicad and made it using the "Toner transfer method" on a double-sided board (approx. 77 x 77 mm) (3 x 3")

See the two PDF files at the end of this section (one for each copper layer).

Print them on to toner transfer paper using a laser printer at 100% scale. The two transfer sheets need to be precisely aligned.(I got best results using special transfer paper (thin glossy yellow sheets) obtained from eBay or AliExpress).

( My printer had a low toner density issue which caused some "pitting" in the transfer . I had to repair that manually using a "Sharpie" pen).

The D-SUN regulator needs to be prepared by soldering pairs of 2.54mm header pins to the component side of the module input and output holes as shown in the photo. (this allows the module to be fitted upside-down on the pcb ).

Connect a DC supply (about 9-12 V) to the IN+ and IN- pins and measure the voltage on the OUT+ and OUT- pins. Adjust the small variable resistor to get the voltage as close to 5.00V as possible.

The resistor adjustment is very sensitive, if 5.00V is difficult to achieve, set it slightly below.

The TPA3110 Amp module can be fitted with header pins on the underside for soldering to the PCB.

The LEDs and IR sensor leads need to be carefully bent so they protrude at the front of the PCB but not foul the front panel. (Put a piece of insulating tape on the board under the IR sensor in case the leads ever get pushed down against the PCB).

The Rotary encoder should be kept perfectly upright - check as you solder each of the two mounting lugs.

STEP 3: Software

Here is the HEX file firmware for the PIC18F14K50 microcontroller.

(It is exactly the same firmware as used in my original Jumbleum player)

STEP 4: Preparing the Memory Card and MP3 Files

The player uses a Micro SD-card with a capacity up to 32GB.

Before first use, the memory card will need to be formatted using a PC.

If the card capacity is less than 4GB , PCs usually automatically use the FAT or FAT16 file system (which is fine). If the card is more than 4GB you may need to manually select FAT32 file system when formatting for it to work.

If you have a music collection too large to fit on your memory card, use a music manager program such as MediaMonkey to create a new playlist. Edit the new playlist and sort by “random” to mix-up all of your music collection. Then choose the “Send To” option and then “Folder Copy” and select to copy to the drive letter for your memory card. MediaMonkey will then copy a random selection of your music collection to the memory card until it is full.

STEP 5: Initial Checks

Insert your Micro SD-card containing music files.

Connect the cable from the amp to your speaker. Then plug-in the power adaptor.

At power-on the RGB LEDs should glow blue.

The DFplayer has a red or blue led which should light when it starts playing.

The RGB LEDs should begin slowly changing colour.

Turn the knob to check it controls the volume correctly.

Press the button and the next tune should play.

Adjust the variable resistor to get the best volume range from your speaker. (I needed to turn the resistor fully clockwise as my speaker was not loud enough otherwise).

STEP 6: Remote Control Setup

This player supports the NEC remote control protocol.

It is pre-programmed to work with the remote shown in the photo above.

I bought it from eBay (described as: HX1838 VS1838 Arduino Infrared IR Wireless Remote Control Sensor Module Kits).

It came complete with the IR sensor on a small PCB. It has the arrow buttons below the keypad as shown in the photo. (A similar type available marked "KEYES" with the arrow buttons above the keypad has different keycodes requiring you to program it as shown below).

If your remote control is not exactly the same as the photo above, it will need to be setup:

  • Hold the Encoder button pressed and turn on the power. (The LED should flash light green)
  • Release the button (LED stops flashing and stays light green).
  • Press the remote button you want to use for NEXT Tune e.g. " > " The player should then start playing a tune and the LED goes Red.
  • Press the remote button to use for VOLUME UP e.g. " ^ " The LED should go Yellow.
  • Press the remote button to use for VOLUME DOWN e.g. " v " The LED should go Green
  • Press the remote button to use for STOP e.g. “OK” The LED should go Sky Blue
  • Press the remote button to use for PAUSE e.g. “#” The LED should go Violet
  • Press the remote button to use for EQ e.g. “1” The LED should go White for 1.5 seconds Then the LED flashes Green
  • Press the Encoder button until the LED stops flashing - to save the settings.

STEP 7: Optional "User Friendly" Remote Control

The original remote control I got from eBay has small tactile "click" buttons and does not fit well in the hand.

I found a better one that is much easier to hold, with very large rubber buttons.

It is available on eBay and AliExpress, described as "Big Button Universal TV Remote Control for Seniors/Elderly"

This is actually a "learning" remote which requires the original remote to program it.

Programming the Universal learning remote

  1. Place it head-to-head with the original remote (about 2-5cm apart)
  2. Hold the red "Power" and ^ buttons pressed until the red led starts flashing. (learning mode enabled)
  3. Press the button you want to program (on the learning remote), until the led stays lit.
  4. Press and hold the corresponding original remote button for about 3 seconds - until the led starts flashing.

Repeat steps 3-4 for each button to learn.

NOTE. The learning remote exits "learning mode" if non of its buttons are pressed for 10 seconds.

The learning remote programming procedure is a bit unreliable - you may need to repeat the learning procedure for some buttons if they don't operate the player correctly. (Try repositioning the two remotes slightly and don't move the remotes while pressing buttons).

Button selection

I set the "Power" button for "Stop".

The + and - buttons for volume.

The ^ and v buttons both for "next tune"

The "mute" button for "Pause"

and the "F" button for "Equalisation" selection

STEP 8: Problem Diagnosis

The player LEDs can help diagnose any problems with the SD-card or hardware:

  • LEDs rapidly flash Blue - Either No SD-card or files found. If this happens at power-on - Check the SD-card is correctly formatted and mp3 files are present. If this happens while playing, it could be a problem reading a file due to a slow or incompatible SD-card. Try using a different SD-card.
  • LEDs rapidly flash Red - timeout waiting for Dfplayer module to initialise. This can occur at power-on if the dfplayer module fails to initialise within 5 seconds. It could be caused by a slow or incompatible SD-card, a faulty Dfplayer module or a circuit fault. Try using a different sdcard. If still the same, remove the SD-card and power-on. The LED should now flash Green if the Dfplayer is working. If it still flashes Red, check all wiring or replace the Dfplayer module.
  • LEDs rapidly flash Green - No SD-card found at power-on. Insert an SD-card.

STEP 9: 3d Printed Case

I customised the case using OpenSCAD and the "Ultimate box maker by Heartman" on Thingiverse.com.

I modified it to suit my PCB and added cut-outs and holes for the controls, power etc.

It is printed in Silver/Grey PLA for the base and top to match my speaker and White for the front and back panels.

The PCB can be fixed to the base with four M2 screws and nuts. (drill a suitable sized hole in the case base through the centre of four of the standoffs for fitting screws).

The top and base panels clip together.

The encoder knob was also 3d printed using the "Customizable Knob! by charliearmorycom" on Thingiverse.com.

This was also an OpenSCAD file which I customised until I liked the appearance, and printed it in White PLA.

The encoder shaft I used has a "D" shape which required a small grub screw to hold the knob in place.

12 Comments

Hi unusualelectronics,

I am intriged by both players that you designed. I am seriously thinking of maiking one for the randomize feature.

I have not worked with PICs in at least 7+ years; I also see that in Canada the PIC required is about $25 with shipping.

I do have a few of the PIC18F25K20 DIPs. It looks like they have more than enough Flash and RAM.

Do you think the PIC18F14K50 code could be ported to the PIC18F25K20?


I did play around with the DFPlayer with an Arduino which is 5 volt, and recall that a dropping diode was required to reduce the voltage to the DFPlayer which has a max voltage spec of 4.2 vdc.

I wonder if this is possibly where the noise may be coming from?

Any advice you have would be greatly appreciated; I will be breadboarding a DFPlayer module today with an ESP8266 Wemos which is 3.3 vdc just to see if I can get some files to play again.

I have a BIM board that still has most of the circuit intact, so I have a starting point.

Have a Great Day!

Bob D

Update: Mar 25, 2024

I found the root cause of the Jumbleum not reading the SD card.

-I had the DFPlayer module installed backwards.

All wiring was correct, the module had to be turned 180 degrees on the test board.

This now works great!

I am very happy with how quick the player starts, and it really does scramble the songs very well! I have been listening for several hours and have not heard the same song twice.

I will post a picture of the completed project soon.

Thanks unusualelectronics for a very neat project; well done!

Bob D.

Hi again,

I did a lot more testing with cards and DFPlayer modules.

All 4 of my DFPlayer modules are identified with:

DFPlayer Mini

JL Chip: AA19HFF851-94

HW247 A

-I see you indicated in your Instructables write indicated that there could be issues if the DFPlayer did not have the correct chip.

My working test circuit works will all 4 DFPlayers, and with all the SD cards , so I think the issue is something else.

Note:

My test circuit had a 2.2 K Ohm resistor connected to the Rx pin to ground and this works.

-I tried connecting it this way with your circuit with no change - the unit starts with a blue LED, than after about 8 seconds goes flashing green.

-I also added the diode in series with the VCC input of the DFPlayer with no change in operation.

Question:

Is there any way that an oscilator setting isn't set right in my PickitPlus set up?

-I don't have time now, but I could take a snip of the setting that I see when I load the hex file with the PickitPlus.

I will do more testing on Sunday when I have some time; have a great day!

Bob D



Hi again; thank you for the reply.

I will continue to test further, it appears that the DFPlayer is seen, just not the SD card.

I will take another DFPlayer that is 100% working and try it in the Jumbleum tonight.

I am so close to the finish line here.. just need the final sprint!

Have a great day!

Bob D.

Hi Unusualelectronics,

I loaded the hex file and tested all pin outs from the PIC to the DFPlayer.

I am getting a blue light at start up, then it flashes green.

-I swapped out the DFPlayer and 2 other cards as well with the same result.

I will format another SD card tonight, can you confirm if the songs need to be loaded within a single folder OR without any folders?

=all my cards have folders (one with artists, another is in the folder 01 with songs as 001.mp3 and the 3rd card just has songs that are mp3 with no folder)

-all give the same result of blue light, then the flashing green.

-I have even remove the card and started the player, then inserted the card with no better results.

Question: how long should it take when the Jumbleum is 1st powered before you hear music or see a light on the DF player flash?

Thank you for any assistance.

Bob D.

As far as I remember, it still worked with files in separate folders.

Hi Unusualelectronics,

I now am ready to program the PIC with my newly updated PickIt Plus using the .hex file you provided.

Question: Is it ok to have my music files in artist folders on the SD card?

I will post a picture when I have a completed, working player

Bob D.

Hello and thank you for the reply,

I think that your method is the the route I need to take; I will order a few of the PIC chips from Digikey as you pointed out.

I may have a few questions as I tackle this build, thank you agaion for sharing this unique project!

Bob D

Hello,

I think the Amazon marketplace seller you found is not the best option, They sell for about $5 plus shipping from places such as Digikey or Mouser in Canada.

It is possible to modify the code to work on a PIC18F25K20 but it would take time to do it and the pcb would need to be redesigned.

The DFplayer datasheet says it works at 3.2 to 5V and typically 4.2V. When I made it I found no advantage in using a diode.

The hissing or clicking noise was caused by limited grounding within the DFplayer module and was really only noticeable when listening to quiet music sections with the volume turned up with high quality speakers.

Great project! Did you solve the audio noise issue with the stereo version?
The DFPlayer module makes some background noise while accessing the memory card. This appears to be a DFPlayer module design issue.
Both my designs try to reduce the noise by muting the amplifier whenever music is not playing (when the module flags it is not busy).
There can still be a bit of noise between tracks though as the module flags itself as busy again a short while before it actually starts playing the next track. I tried to compensate for this by adding a small delay after the module flags busy before un-muting the amplifier.
I made a Chime Clock that used the DFPlayer that made no noise at all and also operated it using serial comms. I used a low-noise power supply. Have you 'scoped the DFPlayer power for noise? Rich