loading

A while ago, I stumbled over a component called DFPlayer. It's a tiny component that allows to play mp3 from an micro SD card (for less that 10€!).

http://www.dfrobot.com/wiki/index.php/DFPlayer_Min...

Since I was sick of using my smartphone as an alarm clock just to have music to wake me, I decided to build an alarm clock with it.

Step 1: Required Components

  • 1x DFPlayer (7,80 Euro)
  • 1x Arduino UNI (20 Euro)
  • 1x LCD Display (20x4, ~10 Euro)
  • 4x 10k Resistors
  • 2x 1k Resistors
  • 1x 10k Poti
  • 1x Rotary Encoder (1,50 Euro)
  • 3x Push Buttons
  • 1x Visaton FRS 8 Speaker (10 Euro)
  • Some cables for wiring and circuit board(s)

Additionally you may want an adjusting knob for the rotary encoder, a frame for the display and a case. My father made an oak case for me which looks pretty nice.

Step 2: Arduino Setup

  • Connect the Arduino via USB to your PC.
  • Make sure that you have the Arduino IDE installed.
  • Download the .ino the attached .ino file and the additional 3x zip files
  • The Arduino IDE provides a wizard where can select the zip file to include a new library.(Sketch -> Include Libraries ...): Install all 3x libraries using this wizard

The .ino file should compile now and you can upload it to your arduino.

Step 3: Wire Components

Before soldering everything together, I recommend using a breadboard to prototype everything.

I created a fritzing image to help with that. You should check the correct wiring of the DFPlayer by using the provided link. You can find a description of the DFPlayer's pins there, but assuming the 5V+ pin is in the upper left corner, the wiring should match as shown on the picture.

Step 4: Build Everything Into the Case

The step varies depending on what case you have chosen to use. I've added some pictures here to show the steps I've done to wire everything into my oak case. I decided to build smaller circuits on smaller circuit boards to have checkpoints where I can verify that everything is still working.

<p>Ups, my fault. I build this clock a year ago so excuse me if I forgot something.</p><p>You have to install the timer library.</p><p>How To: <a href="http://playground.arduino.cc/Code/Timer" rel="nofollow">http://playground.arduino.cc/Code/Timer</a></p><p>Download: <a href="https://github.com/JChristensen/Timer" rel="nofollow">https://github.com/JChristensen/Timer</a></p><p>The Arduino IDE also provides a wizard where can select the zip file to include a new library.(Sketch -&gt; Include Libraries ...)</p>
Thanks for a quick reply, I managed to upload your code, however I'm experiencing another problem. After wiring my lcd according to arduino, all I get on display are 2 rows of blocks (no characters) and no illumination. I checked the specification for my lcd here <br>https://www.adafruit.com/datasheets/TC2004A-01.pdf<br>And I can tell that the backlight pins are 15 and 16, whereas pin 15 on your diagram goes to arduino and does something else I presume. <br>I assume that other pins will be different too. <br>I'd appreciate it if you can help me out here, otherwise I'll just give up with this project.
<p>I compared the datasheet with the one I used:</p><p><a href="http://www.produktinfo.conrad.com/datenblaetter/175000-199999/181657-da-01-en-LCD_MOD_STN_BLAU_NEG_LED_WEISS_20X4.pdf" rel="nofollow">http://www.produktinfo.conrad.com/datenblaetter/17...</a></p><p>From what I can see the pins are the same. I recommend to prototype the lcd without any other components. I used the Adafruit tutorial for this:</p><p><a href="https://learn.adafruit.com/character-lcds/wiring-a-character-lcd" rel="nofollow">https://learn.adafruit.com/character-lcds/wiring-a...</a></p><p>The first step is to get the backlight running, so I hope this will help you.</p>
anyone can confirm this instructable works?<br>building it atm, got the screen working but using some old parts...<br>so would be nice if someone can confirm and i have to check parts<br><br>had it working but started up and it was frozen in ouhr menu, now i fried my 10k pot ;-p<br>waiting for parts
<p>Hi, Time.h attached to this tutorial is outdated. The new one can be found here: </p><p>https://github.com/PaulStoffregen/Time</p>
<p>Hi again, Ive been trying to upload your program to my Arduino and it keeps saying </p><p>Arduino: 1.6.8 (Windows 7), Board: &quot;Arduino/Genuino Uno&quot;</p><p>C:\Users\Golomp\Desktop\mephisto_V\mephisto_V.ino:3:19: fatal error: Timer.h: No such file or directory</p><p> #include &quot;Timer.h&quot;</p><p> ^</p><p>compilation terminated.</p><p>exit status 1</p><p>I installed some Time library but it hasnt resolved the issue. </p><p>Also I see that you have included a </p><p>#include &lt;DFPlayer_Mini_Mp3.h&gt; Library, where do I get it from?</p><p>Sorry to be a pain, I'm not a programmer so I dont have a clue.</p><p>Thanks!</p>
<p>To be honest, I can only guess since I only have some basic skills and I had to play around with rotary encoders a lot before I got a successful combination of code and hardware. My approach would be to connect the rotary encoder to the arduino and play around with the connections. Create a separate sketch for it using this logic:</p><p>/**</p><p> * The rotary encoder implementation</p><p> */</p><p>void updateEncoder(){</p><p> int MSB = digitalRead(encoderPin1); //MSB = most significant bit</p><p> int LSB = digitalRead(encoderPin2); //LSB = least significant bit</p><p> int encoded = (MSB &lt;&lt; 1) |LSB; //converting the 2 pin value to single number</p><p> int sum = (lastEncoded &lt;&lt; 2) | encoded; //adding it to the previous encoded value</p><p> //if(sum == 13 || sum == 4 || sum == 2 || sum == 11) encoderValue ++;</p><p> if(sum == 2) encoderValue --;//skip updates</p><p> //if(sum == 14 || sum == 7 || sum == 1 || sum == 8 ) encoderValue --;</p><p> if(sum == 1) encoderValue ++;//skip updates</p><p>} </p><p>Use the Serial.print to log the encoderValue and check if it is working as expected (I had to google this code, but can't remember where I got it).</p>
Hi, I'm preparing to make this mp3 player, I have almost all needed parts. I'm just wondering how to connect my encoder as it seems to have a different pinout than yours. Here is the eBay auction number <br>181956049541<br>Many thanks in advance. <br>
<p>Are these momentary switch buttons or latch switch?</p>
<p>Momentary switch buttons, this one:</p><p>http://www.conrad.com/ce/en/Search.html;jsessionid=07DD185D114B945F9143B6859DBF3877.ASTPCEN23?search=2050000219405&amp;searchType=mainSearchBar</p>
<p>Is it possible to use a potentiometer instead of a rotary encoder?</p>
<p>Technically yes, but I wouldn't recommend it. It is just to complicate to use the position of the potentiometer to calculate the current input value.</p>
<p>Does the microSD go in the back? or do you have to take it apart to put one in. Either way I love this project.</p>
<p>There is one photo of the last step where you can see a small opening on the back. This is where you can access the sd card. The dfplayer has a little spring inside the sd slot, so it jumps out.</p><p>A little bit of a hassle though: the mp3 files on the SD card must be numbered, starting with 0001_.., 0002_... etc. I've written a small program that renames the mp3 files I've selected automatically before I copy them on the SD.</p>
<p>the 10K pot is for dimming the screen i assume?</p>
<p>Yes, its for dimming the screen. I followed the adafruit tutorial for wiring lcds.</p>
<p>It looks so professional! Nice job!</p>
<p>Thanks!</p>

About This Instructable

5,641views

55favorites

License:

More by mfaust:The Maven Box: an Arduino Controller for Software Developers Arduino MP3 Alarm Clock 
Add instructable to: