so for the last few months worth of mail bags I've been acquiring quite the
assortment of music player type modules there's this one which is a radio and
mp3 player here's that crappy little audio card or
USB audio thing for the laptop remote control for that there's this one that
showed up in the recent mail bag there's another mp3 player I think it's is that
an FM radio as well no this is a Bluetooth mp3 player with SD card slot
then there's these tiny little FM radio modules but today we're going to play
with this most recent one which is called a DF player mini and it comes not
with the SD card in it but it comes with the pins already on it and I did a bit
of looking around and I was able to find the manufacturer seems to be DF robot I
was able to find their webpage that has a fair description of the thing and here
it is on DF DF robots website this is almost a datasheet explains the thing in
its various different applications and modes and whatnot at its core it's just
a mp3 player but it does a few other things it can drive speakers directly or
it can output line level just from the digital analog converter it appears to
be able to connect to a USB memory device and use that for its source of
music though I don't really think I'm going to play with that that much
normally it uses its built-in micro SD and these are the interesting things
over here for me anyway the different to address key
lines to ioki wines or i/o lines and if we scroll down so there is some command
language stuff and whatnot but there's three different modes or
ways of controlling it this address key mode basically on address key 1 & 2 you
can hook up a matrix of you know buttons and with different resistors in series
with them to ground onto that one so you can control any number of functions just
from the one pin play mode loop all play/pause previous and next and volume
and direct access to four different segments or audio files and on the other
key with the same values of resistors but going to the other input you have
access to another bunch of another 10 audio segments so you can either use it
as just normal mp3 player to just play all of them loophole is what it calls it
or you can jump directly to a specific segment which goes back to their
description up here somewhere to use it for voice prompts and voice
and Alex Benson or not you can just have it and sitting there not playing or
looping a standard message and then when you hit one of these buttons it will
jump immediately to one of the one of the specific segments which is pretty
cool the other way of doing it is using the to aisle buttons are the i/o lines
and with those you can just drive them directly to get previous or next track
and volume plus and minus and then if you want on the address keys you can put
a couple of buttons on with no resistor same as you were
up here and you can go directly to say what one or segment five so you can put
something special on those ones or you can connect it to the TX and rx pins and
connect it to an Arduino so I'm going to play I'm going to go back to the
workbench and set up all three of these different scenarios I'm not going to go
through every single possible button I'm not gonna set up all twenty buttons that
would be silly but I'm gonna set up a handful of them and I'll use the demo
code that comes with it also from from DF robots web page they've got a library
Arduino library with a couple of a couple of bits of code to go with it and
actually this is one of the ones that I'm going to need to show you show you
basically it just plays three seconds of each song and then skips to the next one
and then there's a bit I've modified that a little bit and I'll tinker with
that too and it comes with this other piece of code called full function which
has in it every possible function that you can do so you wouldn't want to run
this one just as it is because it would just go berserk and do all manner of
stuff interestingly though there is a function you can have multiple folders
or directories and you can go directly to any file within those so know then
back to the bench
alright here I have it just set on a breadboard I've got one of the speaker
lines and ground connected to a speaker I don't have a second so I don't have
room on my bench for a second speaker and it doesn't really matter for this
demo I've got five volts coming from my usual little power supply here into that
of it and I've got ground a good power just on a little jumper down here
speakers and just one wire to tap pins with connected also to go so whole turn
power on a little bit of noise and stuff seems to default just to doing nothing
but if I tap I owe one which is next volume - next if you tap it and volume -
they hold it that's kind of cool then grounds in in the second pin the third
pin in is IO - which is previous if you tap it and volume up if you hold it so
that's the absolute most basic mode that you can get it in however it plays the
song that is playing and then it pauses and waits for you to do something it
doesn't loop them in this basic mode so it's not probably not the best thing to
to use for playing a portable pocket mp3 player something the other two lines
what are those called 81 and 82 if you remember from seeing the datasheet they
will directly access a couple of songs
so this one 81 always access is satsang one the beginning out and right now -
and 82 directly accesses song 5 now that I'm calling them song 1 or segment 1 is
what they call them 2 3 4 5 that's not the name of them they can be named any
arbitrary thing you want that is the order in which you copied them to the SD
card so basically their order in the fellow location table
that table which if you're changing files on there frequently probably will
be a pain if you're trying to directly access though I don't know something to
think about if you want to use this for a sound effects box or something but if
you load it once and forget it and just use it that probably wouldn't be a
headache so no let's try this in the second mode which is a bunch of buttons
and resistors I've only got what I've got here for resistors plus the two
direct access modes I'm just gonna hook all this up and I'll be right back okay
so here we are back after a little break for me to hook this guy all up so I've
got the first two buttons just connected directly to aisle 1 and I 2 which are
the next and previous and volumes and then the rest of these I've got these
three I've got hooked up to where is that going et tu through three different
resistors to direct access three different songs and this other one I got
connected to a d1 and got this one direct so that that Drex axis like song
five and then I've got no I'm sorry song one that's a d1 right and the other
button is pause play so that's through a 33 K resistor that goes straight to the
song go straight to another song straight to another song straight
tournesol but it's always the song is that that resistor you select
and then these two again next previous volume up volume down so you could get a
fairly basic just normal mp3 function out of this just with a few resistors
and buttons you could have it set to loop all which is 50 1k resistor on this
on this line sorry if I wanted to just tap that at the beginning and then if I
needed to make a special announcement just go directly to that song or I
picture those as voice announcements now what I is a just a guy might use that
for I don't know maybe use it for platform announcements on my model
railroad I don't know so all those same functions are also available through the
Arduino connection which I will set up for you now okay back again this is all
disconnected although I could have left it connected those pins will still
function but now I have the Arduino and I have it programmed to I'll show you
the code in a second but basically I've got it out one of the
demo sketches and modified it slightly so that I've got direct access to some
songs on on a few of the pins and Anquan along it set up as a next so let's just
try pin two
pin3 there we go turn the volume up a little bit here
just using that long hold mode so pin -
yeah pin - I got set up as a next pin three goes directly to this one every
time hit next and go back to that one pin four goes directly to a different
song pin five I don't think I've got a little pin six know
so there's that and then I can still use these buttons to go back and next if I
had the button board connected or no it's coming out or I can volume down so
I think that's pretty slick so basically anything you can put in a program you
can use to tell it any of the functions that's available that we looked at
earlier on the india functions on the buttons so play mode up-down looping the
loads and whatnot
oh and the other thing I think I told this thing from top of the sketch to
just go into a loop all so now it should well actually let's take a look at the
sketch and I'll just leave the music running in the background so this is the
get started sketch one of the two sketches that comes with it it's got a
bunch of stuff in it that I'm not going to show you it's got a serial or it uses
the serial print to dump stuff out to the serum they are doing a serial
monitor but when I have the laptop connected to the Arduino while it's
playing music there's a horrendous background noise which i think is coming
on the ground of the USB from my laptop so I'm not gonna assault your ears with
that because you'll hate it but it does some diagnostics off the top sets the
volume they I think set it to ten I set it to 15 just for the speaker I'm using
and starts playing the first one and then their script just every well they
had a set to three seconds I changed it to five just it's the next button every
five every yeah every three or five seconds depending what you're told it
and then there's a bunch of error messages again that dump out onto the
Syria or the serial monitor which I haven't
experimented with because it assaults my ears
and here's the modified sketch that we're listening to right now I just set
some some pins to input with pull ups and set it to mid-range volume I was
experimenting there and that's commented out but the last thing it does before it
leaves a set up is enable loop all so it just plays everything on the SD card on
unless you tell it to do something different which is what happens in the
loop just digital Reed pin 3 4 & 5 yeah t 3 4 & 5 & pin 2 as we saw hits
the next button pin 3 goes to song 1 pin 4 goes to song 2 and pin 5 list of song
3 and as you saw it goes immediately there to there's no waiting and no pause
so you could use this without putting it into loop mode you could put a bunch of
sound effects on it and trigger the sound effects from a button board or
something that might be fun if you needed to have a bunch of sound effects
just sitting waiting for you you could either use for 15 of them directly from
the buttons with resistors or an unlimited amount from from buttons
connected to your Arduino all kinds of things you could do with this cool
little toy unfortunately being just a standard mp3 player isn't really what
this thing's made for but that's okay mp3 players are cheap ubiquitous and on
your phone and everywhere else so there's no real need to do one here I'm
gonna go back to the workbench now I think I'm tired of staring at code
all right so that's just a quick little experiment with this thing I've been
spending a lot more time than what you saw if you've been watching my channel
you know that I can kind of allergic to code the modified code that you saw that
I'd created on the screen there probably took me about three or four hours to get
it all debug than working right and everything this button board and
figuring everything else out half an hour that simple little chunk of code
pulling my hair out anyway I think this is a cool little module for what it does
you think of a few different uses for word if you can think of other uses for
it down in the description and it was super cheap it was out of came out of a
mailbag a couple of weeks ago I'm pretty sure it was only a Bakker team and for
that you could embed noises and push buttons into anything you want oh that's
that's it for today I know it's not the biggest project in the world but that
was just tinkering and thought I'd bring you along for the ride thanks for
watching if you have anything to say as always down in the comments I'll talk to
you again