Update: It is in a box - no longer have the Audi. If I get something new for the Subaru, it'll be based around a cell phone instead.
So I had been thinking of building a mp3 audio player for my car for some time now, but never could quite convince myself it would be worth it, primarily due to the lack of a usable interface in a car.
Well, once I bought the A4, I found out the stock stereo system has support for an external changer, and that with a bit of work, I could make the mp3 player operate like and emulate a normal cd changer. Then, the primary interface would be the stereo itself. Perfect - this was all I needed to get started.
Before I built anything, I knew there was a few requirements I wanted to meet, after reading about numerous other mp3 player and in-car computer projects. These are:
- It had to be small. I did not want a ATX sized case taking up room in the trunk area.
- Along the lines of the first one: No big power inverters. No point in going from 12V DC to 120V AC back to 12V DC. So this ruled out any off the shelf computer power supplies.
- Back to the user interface: I didn't want to install any keyboard (wireless or not), LCD monitor, mouse, etc. In short, it had to some extent feel like part of the car.
- It should be relatively cheap, preferably under $200-$300 (max).
- Use off the shelf components where applicable. Many of my projects end up creating sub-projects, and nothing gets finished. So, use what is already built as much as possible.
Before this project even got started I had identified what main board I wanted to use. I was just looking for an excuse to buy one.
This is an Intel XScale based board out of a Linksys product. Basically, it has these peripherals/specs out of the box:
- 8MB Flash
- 32MB SDRAM
- 2 USB 2.0 Ports
- 1 Network port
- Running at 133Mhz
With a slight bit of modification, it now has:
- 3 additional USB 2.0 ports (the extra wires running off the top)
- 1 Bidirection serial port (used for console access)
- 1 Receive only serial port (currently unused)
- Running at 266Mhz
As you can see in the second and third pictures, I brought the extra ports out on a header.
The board was never powered up with the Linksys firmware; it was out of the box, and reflashed with a Linux 2.6 kernel. :)
Mostly for my own reference, the pinout of this cable is as follows. The pin number corresponds to the multipin connector, the wire color to the wire inside the mp3 player case. CDC refers to the CD Changer.
- CDC Data In (Green/Black)
- CDC Data Out (Green)
- CDC Clock (Blue)
- CAN High (White)
- CAN Low (White/Black)
- Battery (Orange)
- Battery (Red)
- Switched Battery (Red/Black)
- Ground (Black)
The multiple battery lines (pin 6 and 7) were originally put place in case I want to pull more power than a single 22 guage wire in the cable reasonable hold (0.92A max). Of course, there is only one ground wire, so that makes it a bit pointless (oops). This is a non-issue because the project is currently fused at 1A.
The CAN bus lines are currently unused, but provide connection to the Audi Infotainment CAN bus.
To emulate a Audi changer, which uses the same protocol as the panasonic changers, I'm using the firmware the guys at http://www.k9spud.com/vwcdpic/ developed, with a number of modifications of my own:
- Accept serial commands to change the display (time, track, cd #). The stock firmware is primarily intended for simple audio input enabling, not a full mp3 player capable of managing the display on its own. This way, for example, when a track changes on the mp3 player, the display is immediately updated. There was no support for this feature.
- Various button remappings for Symphony II stereos.
- Remove all bit banging serial routines. The microcontroller I am using has a full serial UART, so this isn't necessary.
Once I finalize the changes to the firmware, I'll post them here (project is under GPL).
See the Developers Area on the VWCDPIC site for more information about their project.
This board pretty much only has USB, so anything I attached to it (other than the serial console port) had to be USB. The two peripherals it was missing: audio output, and mass storage (for the mp3s). Actually, there is one other not mentioned, a simple USB to serial adapter that is used to connect the changer emulator.
For audio output, I'm using a Turtle Beach Audio Advantage micro device. This works well with the stock linux kernel, since it correctly supports the USB audio device specification. I'm getting a slight bit of distortion on some select frequencies, which I haven't tried to track down yet. Other than that, it has worked well.
For storage, I've enclosed a 30GB 2.5" IDE drive in a USB2 enclosure, made by coolmax. This was picked up from a local Fry's. The drive was loaned to me by a friend (thanks Lorin!) since my 10GB one started getting IO errors on it, and wouldn't hold all my music. The 5V line to this device is connected straight to the power supply, instead of the USB port, so I don't have to worry about it drawing more than the 500mA maximum on the USB port.
Originally, I intended to just buy a case and put everything it in, but I was unable to find one that fit the specific size requirements I had. There is a shelf in the glove box that is the perfect location for this computer, so the case was designed to fit there. Its approximate size is 7" x 5" x 1.5".
The cost of the acrylic pieces, purchased at Tap Plastics, was $9, and the aluminum top and bottom panels were $12, cut to size at Metal Supermarkets (both local stores). Miscellaneous screws, standoffs, and other hardware brought the case price to around $30.