| Marsette Vona: | DNE Music Player |
|
|
This is a handmade miniature digital music player with removable MicroSD media built into a pair of Philips HS-820 behind-neck headphones. The parts cost is about $90, including the phones, a custom circuit board, and a 1GB MicroSD card. All the necessary design files and instructions are included below.
An in-headphone player has no wires to get tangled or to catch on things, so it's great for listening to music while you exercise or move around. It appears this is not the only in-headphone player around, but it may be the only one with removable media. And it is probably the only one you can build yourself, from scratch.
You control the player with a miniature joystick, which is the silver protrusion in the images. The player beeps to indicate power up/down; the only visual display on the player itself is a single blue LED blinkenlight.
The firmware for this project is free software, and the hardware designs and documentation are free for non-commercial use, as detailed below. Please enjoy this information, and let me know if you build one for yourself.
| ||
| Fits in a shirt pocket. |
|
|
|
|
The heart of the player is a VLSI VS1002D audio codec chip, which supports MP3, WAV, and PCM music formats. The current version of the firmware will play all and only files ending in ".mp3", case insensitive, in a directory named DNE off the root directory of a FAT12/16/32 formatted MicroSD card. You can store other files and directories on the card and they will be ignored by the player. If you're interested, it's probably possible to improve the firmware to support additional filename patterns and/or subdirectories.
To add or remove songs you can use any MicroSD card reader attached to your computer. The song play order is currently determined by the order of the entries in the FAT, which is likely the order in which you have added the files to the card. If you want to manipulate the order more conveniently you can try using some FAT manipulation tools. Again, it should be possible to extend the firmware to support other models of play order, for example randomized, alphabetized, or even based on playlist files.
You can use filenames longer than the old 8.3 DOS standard, but the firmware will see only the 8.3 compatibility name.
The current version of the player contains no code which could write data to the MicroSD card, and does detect card presence, so the card should be safely hot-pluggable.
I find the sound quality of this player to be entirely acceptable, especially for entertainment while exercising, though it is not audiophile. You may hear some slight noise during periods of silence or very quiet content. The player is capable of quite loud playback without too much distortion, which is great for exercising in noisy places.
The joystick has five switches: one for each direction, and one for a center press. To actuate the direction switches it's best to press it from the side rather than putting your finger on the end and tipping it, since that usually causes the center button to be pressed also.
Press and hold the center of the joystick to turn the player on. You will see the LED flash and hear a beep (which is quiet, and may not be very audible if you are not actually wearing the player or if the environment is noisy). The player will immediately begin playing the first song. The LED will flash whenever a joystick button is pressed and about once every five seconds while the player is in pause mode.
While the player is on, the up and down switches of the joystick control the volume, and the forward and back switches skip to the next and previous songs. A short tap on the center button pauses or resumes play. A long press on the center button initiates powerdown, which is indicated with another beep and a series of rapid flashes of the LED.
A new fully charged battery lasts for about six hours of playback at moderate volume. When the battery is depleted the player will shut itself down. If the battery is very low, the player may not power on at all, or may shut down immediately after power up.
The player includes an external charger which draws power either from a USB port on your computer or from a DC wall transformer (aka a wall-wart). In addition, you can buy USB-socket power adapters, such as the Griffin PowerDuo, both for your car and for wall sockets. I find this the most convenient option, in addition to charging direct from a computer.
To initiate charging, apply power in some way to the charger and then plug the charger into the player. The LED on the charger (not the player) will illuminate while charging is ongoing, and will go out when the charge is complete. It takes about 90 minutes to charge a fully depleted battery from the USB socket. Powering the charger from a wall transformer connected to the DC input jack on the charger will shorten the charging time as the charger will allow current flow greater than the USB limit of 500mA in this case.
The player uses a Lithium Polymer battery similar to those common in modern cellphones and wireless headsets. You do not need to wait for the battery to be totally dead to recharge, nor do you need to fully recharge the battery in order to use the player.
Wearing the player while charging is not recommended, as it is during this time that the battery may be most susceptible to damage if it is faulty. Please see the disclaimer below.
Here are the files you'll need to build this project. Before getting started, though, read on for details and tips on construction, and be sure to note the known design defects listed below.
Note that the pricing listed in the bill of materials may of course change over time, and does not include shipping and handling costs or minimum order quantities.
All parts are available from common sources such as DigiKey and sparkfun, with nominal sources listed in the bill of materials. I had the board fabbed by sparkfun's BatchPCB service. Both the player and charger circuits are fabbed on one board; you score them along a silkscreen parting line to break them apart.
| ||
| The completed project and the tools I used. |
This project uses modern miniaturized SMT components to achieve minimal size. While it is true that there is a lot of expensive equipment available which can help with assembly and rework of these components, I did manage to assemble and debug the player using only the tools shown above.
Some form of magnification is probably obligatory unless you have extraordinary vision. I use an inexpensive binocular microscope I got on ebay, mounted to a custom swing arm. I find the 20X magnification setting good in cases where I don't need to see ultra-fine detail but need a wider field of view. The 40X setting is useful for checking the details of solder joints and for finding hairline breaks or shorts.
For soldering I use an older Weller iron with a fine tip. I got this used on ebay for under $50. I actually prefer this older technology to the newer light-weight precision soldering systems, as those have very low thermal mass and never dynamically heat fast enough not to frustrate me.
Other tools of note in the figure, from left to right and back to front:
Consult the various pages of the PDF schematics and layout document for the component placement. In many cases I omitted the silkscreen labels to save space, so be careful and work slowly, comparing the actual board with the design.
For each fine-pitch SMT component, solder only one pad at first. Check alignment and orientation of the component (Are you sure pin 1 is in the right place? Is that capacitor polarized? If so the silkscreen band indicates the anode) and adjust as necessary, then solder a second pad, check alignment again, and then solder the rest of the pads. Try to avoid solder bridges but do not worry if they occur, simply use some solder wick (wet it first with the flux pen so it works) to remove the bridge, leaving just the intended solder between the pins and their pads.
You may find that you need to de-solder one of the chips if you make a mistake orienting it, or if you think you may have a faulty or damaged chip. This can be challenging or nearly impossible to do using only solder wick, especially if you want to avoid damaging the chip and board further. If you have the money, this is one place where a hot air system can be very useful. Failing that, there are products available such as ChipQuik which are supposed to address this issue by alloying with the solder to lower its melting point, so that you can get all the pins on a chip molten simultaneously using only a soldering iron. I have not yet tried any of these.
I used some translucent heat-shrink tubing to package the charger, which allows you to see through to the board, as pictured above. Note that if you don't intend to use the wall-wart powering option then it is not necessary to populate the corresponding components on the charger. These are clearly delineated as optional in the bill of materials.
I also used heat shrink to protect the portion of the player which protrudes from the headphones. After several months of use a problem turned up with this method though: eventually some moisture collected inside the tubing and caused corrosion in the circuitry, which ruined the battery. I recommend trying a silicone conformal coating intended for sealing PCBs instead.
In a few places you'll need to attach wires to the boards, for example, for the headphone speakers. Be sure to stress relieve these connections in some way or they will break. I used some dabs of hot-melt glue for this purpose, although this may not be a great idea as the hot-melt material may be corrosive to the metal contacts in the long term. Here as well there are epoxies and other formulations intended for the purpose.
Here are some views of the fully populated player board (the charger board is pictured above).
|
|
As can be seen in the image below, the player exposes three connectors together at the end of the board, which is exposed a bit outside the right headphone. The round connector at left is the jack for attaching the charger, and the lower slot at right is for the MicroSD. The horizontal row connector above the slot is a 7-pin section of 0.1 inch header I added to create a debug port. This is optional but recommended if you plan on tweaking the firmware. I use this pinout:
| ||
| End view showing connectors and battery. |
I recommend you buy several pairs of headphones, since they are fragile when you disassemble them and it is easy to make a mistake. Each phone consists of two halves which are snapped together. I find that the back end of an exacto number 11 blade works well as a prying tool to separate the case halves. Hold the tip of the blade in the knife handle, insert the blade and twist gently at the four locations of the snaps, which are identifiable as the rectangular shapes around the periphery of the case in the right image below.
You'll need to open up the left phone to remove the original input cable (no need for it now!) and to rewire the speaker to the leads which cross through to the right phone. Save the removed input cable, you can use it to make the charger cord.
The right phone will need more surgery. Remove the screws and examine the attachment to the headband carefully. The correct rotation of the gray plastic circle will detach it from the dome assembly at the end of the headband. You'll need to cut a central void into the gray plastic circle, a tricky task especially since it is important not to damage the remaining annulus which you'll need to hold the right phone securely to the headband when you re-assemble. I used an exacto very carefully while rotating the plastic piece in a machining fixture. You might also try to create a central hole first by twisting a drill through the plastic (by hand) and then enlarging the hole by careful carving.
The darker plastic piece, through which the screws were removed, will need a hole and notch cut in it as indicated. Again, I did this carefully with an exacto knife.
To finish assembly of the player, I used a 1/4 inch #0-80 flat head machine screw to hold the PCB in the headphones, through a mounting hole which lines up with one of the original screw locations in the headphone plastics. You may want to slightly enlarge the screw hole (I used a #56 twist drill) in the plastic so that it is not destroyed by the #0-80 threads, which are larger than those of the original screw. You'll also need to counterbore the hole in the PCB if you want the screw to end up flush, which you can do either by twisting a counterbore bit by hand or probably with an exacto knife. Be sure to cover the back of the player PCB with an insulator, for example kapton tape, so that it is not shorted by the metal of the adjacent headphone speaker.
|
|
The joystick switch itself will arrive as a complete unit, but you will need to add an extension of some sort to the stick so that it protrudes far enough out of the headphone to manipulate comfortably. I turned a little shaft 3/16 inch diameter by about 0.3 inches long from aluminum on a Sherline mini-lathe and counterbored one end of it to press-fit onto the stick. At first I didn't realize I'd pushed it too far down and it was interfering with the switching mechanism, so watch for that. If you don't have access to a lathe it should be possible to make an acceptable joystick extension some other way.
Aligning the hole for the joystick in the outside of the headphone is another job that needs to be done carefully. I had to enlarge the hole several times with careful carving until it did not impede the operation of the joystick switches. The final diameter is about 0.26 inches.
The firmware is developed in C and is built with GNU make and gcc-avr. I used avrdude and the AVRISP2 programmer pictured above to flash it to the Atmel processor on the player. You can either solder a temporary connector to the test points on the player PCB for this or you can build a debug port as described above.
As I debugged the player I of course found a few flaws in the design. I have not had time to rev it yet, so these flaws are still present in the design documents above:
This page itself, along with the design files linked above, including the circuit schematics, PCB layouts, sourcecode, bill of materials, and other files, are Copyright © Marsette A. Vona, III 2007, with the exception of those portions of the sourcecode which are copyrighted by ChaN.
The sourcecode is licensed under the GNU GPL V2.0. Other content provided herein, including this web page, the schematics, PCB layouts, bill of materials, and other files, are licensed under the Creative Commons Attribution-NonCommercial 3.0 license.
I once had the great fortune to take an introductory electronics class taught at Dartmouth by professor W. D. Stratton, a brilliant man with a contagious passion for electronics. In this class he famously told a story of his first date, over half a century ago, with the woman who, it was rumored, was to become his wife. To impress her, he built a miniature radio receiver which he brought on the date in his shirt pocket. This was quite a feat of miniaturization at the time; it required, however, a rather long antenna. This he snaked down the arm of his coat, which created a bit of an embarrassing tangle when a waiter helped him with the coat...
Over six years ago I saw ChaN's original handmade MP3 player. To me this is a work of pure and beautiful art. In 2007 ChaN again spurred me on with his very timely and coincidental release of the elegant FatFS FAT filesystem implementation for small embedded systems, which he even somehow clarivoiantly updated to include the data forwarding feature I use for transfers from the MicroSD to the VS1002D just as I was writing the firmware. Without this library I could very likely still be in the throes of firmware hell. So, ChaN, though we've never met or even exchanged introductions, thank you, twice.
My friend Marty Byl was a partner in our initial effort back in 2001, which didn't succeed after I left school and moved to California (I've since returned). Over time the concept evolved through several different forms and into and out of various levels of vapor. At one point my friend Brent Knopf and his wife were nice enough to let me stay at their place during a trip to Portland Oregon, where I spent a good deal of time working on the player.
For the last several years I have been a PhD student in the lab of Daniela Rus at MIT, and I'm especially grateful and thankful to her for providing a great environment where I've learned a ton about modern practice in electronics and embedded systems. A very large amount of this knowledge has come from my co-students, especially Iuliu Vasilescu and Carrick Detweiler, and from other members of our lab and surrounding labs.
Even after all that help, I probably still would not have completed the project if it weren't for my wonderful girlfriend Melissa King, who is both understanding and supportive as I spend many hours building things and writing code, and who also gave me the final impetus to make the player really work in time to give it to her as a gift this summer. Thank you Melissa.
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
| vona@mit.edu | © 2008 Marsette Vona | Thu Mar 13 16:14:42 EDT 2008 |