Dementia Friendly Media Player

by techno-womble in Circuits > Assistive Tech

7431 Views, 132 Favorites, 0 Comments

Dementia Friendly Media Player

final.jpg

Music can have a profound benefit for people with dementia. In addition to it's entertainment value it can provide a link to the past, unlocking memories and is increasingly forming part of dementia care. Sadly, many modern home entertainment products are not dementia friendly having complex user interfaces.

The media player described here behaves like a basic radio with just two controls - a 'tuning dial' that selects the 'station' and a volume control. In this case a 'station' is a folder of audio files stored on a memory card. The idea is that the user simply turns the dial until they hear something they like. The 'station' files are then played in a random sequence.

It's just like a radio that only plays good music with no adverts!

Supplies

The dementia friendly media player requires only a handful of components costing around £20 :-

  1. Arduino single board micro-controller. I used an Arduino UNO but any compatible model should work.
  2. DFPlayer compatible MP3 module. I used the low cost Sodial MP3-TF-16P
  3. MicroSD card for music storage
  4. Rotary encoder for 'tuning'
  5. 10K ohm potentiometer for volume control
  6. 1K ohm resistor
  7. Perfboard for assembly
  8. External power supply (9-12V @2A recommended)
  9. Loudspeaker (3ohm @ 5W or similar)

A basic electronics toolkit will also be required together with a PC running the Arduino IDE to upload the sketch.

The Hardware

mp3.png

The heart of the media player is the DFPlayer MP3 module. This combines an MP3 decoder, SD card reader and a 3 Watt mono amplifier in a small, low cost package. The MP3 module is controlled by an Arduino microcontroller. Only a few connections are required to the DFPlayer module:-

  1. +5V (pin1)
  2. Serial receive (pin2)
  3. Serial transmit (pin 3)
  4. Output to speaker (pins 6 and 8)
  5. Ground (pins 7 and 10)
  6. Busy (pin 16)

The Arduino takes input from a rotary encoder (the tuning control) and a potentiometer (volume control). The Busy pin from the DFPlayer module is connected to Digital pin 6 of the Arduino.

The breadboard prototype wiring is shown above. Note the 1K resistor between the Arduino and the Serial RX pin of the MP3 module. This is required to interface the 5V Arduino to the 3.3V DFPlayer.

Also note that the DFPlayer module requires a stable power supply and is unlikely to work correctly using just USB power. I took the 5V supply from the Arduino which, in turn, is powered via an external PSU. While this worked you may wish to consider a separate supply for the MP3 module.

The Software

IMG_20191127_103918294.jpg

The Arduino sketch that controls the media player is relatively straightforward. The main loop is executed 100 times per second and performs three functions:-

  1. Check the status of the 'tuning' encoder
  2. Check the status of the volume pot
  3. Check whether the playback of the current track has finished.

The playback status is determined by polling the 'busy' pin of the DFPlayer module which is linked to digital pin 6 of the Arduino Uno.

void loop () {
  boolean busy = false;
  delay (10);    
  if (myDFPlayer.available())  myDFPlayer.read();     // needed to keep ack buffer clean 
  checkVol();  
  checkTuning(); 
  busy = digitalRead(busyPin);                        // check if current track is finished 
  if (busy == 1) { playStation();    
    delay(300);                                        // wait for busy pin  }
  }
} 

Extensive debugging code is included in the sketch. This sends regular status messages via the IDE serial port to assist troubleshooting. It can be switched on or off by editing line 14.

boolean serialDebug = false;                     // enable/disable troubleshooting     

Similarly, the order in which the tracks are played can be changed from random to sequential by editing line 15

boolean randomTrackPlay = true;                  // randomise the track order

Two external libraries must be included for the sketch to compile correctly - SoftwareSerial.h and DFRobotDFPlayerMini.h

The complete sketch can be found on my GitHub page.

Organising the Music

music files.png

The music files are copied to an SD card which is placed in the DFPlayer card slot. This project treats each directory on the SD card as a 'station' that can be selected via the tuning control.

The files must be organised in a specific manner to be recognised. Files are stored in directories named 01, 02, etc. The directory names must be two digits long with a leading 'zero' i.e. 01 up to a maximum of 99.

Within each directory the audio files must be named 001.mp3, 002.mp3 up to 999.mp3. Each file name is three digits long with leading 'zeros' and an mp3 file extension. The DFPlayer module will also replay .WAV files though I have not tried this.

The file naming convention used by the module makes it difficult to identify which track is which but this does not matter for this application as files are played randomly.

I ripped my mothers CD collection to 128kbs MP3s and organised the music by genre, placing all opera, orchestral, soundtrack etc. tracks in their own directories. This resulted in a small number of stations each with a large number of tracks - similar to a real radio.

Final Assembly

internal.jpg

For this build I used an old Bakelite radio case that has been sitting on my bookshelf for several decades waiting for a suitable project. Not only is it a nice looking item but it is instantly recognisable as a radio and has just the two controls making it perfect for this project. The biggest problem I faced was getting the old fashioned knobs to fit the modern pot and encoder. Some filing and heat shrink tubing solved the problem.

The simple circuitry didn't warrant making a PCB so I hand wired the unit using a UNO prototype breakout board as shown above.

Future enhancements will include a switched volume control to turn the unit on and off. This is currently done at the power socket. Some internal LEDs will be added to show whether the unit is powered.

The media player works as intended and my mother instinctively knew how to operate it, which was the main aim of the project. Not having to navigate an incomprehensible remote control means that her musical memories are always to hand.

The random, radio style interface also provides a refreshingly immediate way to listen to any music collection - next job is to make one for myself and load it up with Classic Rock!