I drive the least interesting car in the world, a gray 2004 Toyota Camry. To stave off death from boredom while driving, I use a tape adapter connected to an A2DP receiver to wirelessly listen to music from my iPhone. A few weeks ago, the tape deck developed an extremely irritating clicking noise. The easy options, the ones that most Camry owners would choose, would be to turn on the radio, get an FM transmitter for the iPhone, listen to CDs, or just let the tape deck click. Being an engineer, I refuse pick the easy option, but rather the one that seems best, which inevitably devolves into a weekend of hacking, cursing, and setting things on fire, with a best case of eventually restoring the object of interest to something resembling a functioning state.
The plan was to enable direct auxiliary input, which the Internet claimed was possible on this model. The backup plan was to resolve the clicking noise by just unplugging the tape motor, which we assumed was unnecessary to operate the adapter. My roommate Will and I popped the head unit out of the car with much effort and two trips to the hardware store. Apparently stealing a radio isn’t easy, even from your own car.
Attempting to power the unit off of the 12v rail of a 350w ATX power supply resulted in it shutting off immediately. With a 450w PSU connected to the battery and accessory voltage lines, a tiny laptop speaker from my spare parts bin connected to the massive amp, and another speaker being used as an antenna, we managed to pull in the beautiful sound of late 70’s hits on FM radio.
I’m not entirely sure what happened, but Will managed to break the tape deck in about a dozen different ways over the course of the next couple of hours. It wouldn’t play at all without the drive gears spinning, it refused to eject tapes because it believed it was empty, and still, the clicking gear clicked.
It was then up to me to get aux in working. Apparently, Toyotas from around my model year use AVC-Lan, a communications bus based on IEBus for the head unit to connect to things like a CD changer. There is some pretty solid research across the web on how to emulate a device on the bus to message the head unit to use its aux input. I used the circuit and software from SigmaObjects, as it required only parts I already had or could get from Halted. The code there is designed for an ATmega8, but with some trial and error, I managed to port it to the current ATmega48/88/168 series. Unfortunately, the code doesn’t mention being under any permissive license, so I can’t share my modifications.
While hooking it up to the head unit, the wire connecting the device to ground actually burst into flames, burning part of a connector and melting copper. On later inspection, we found that the wires were extremely high gauge internally, and it is likely that only a single thin strand was carrying the current in the area that caught fire. Miraculously, neither the radio nor the ATmega168 was damaged by the incident. I switched to lower gauge higher quality wire, checked my car insurance terms relating to explosion due to user error, and continued.
After a few more hours of debugging, I realized that I had the two data lines backwards, and after switching them it worked instantly. We repurposed the TAPE button to switch to aux in. I taped the board down, put the head unit back together, and we stuck it back into the car. There was an unnerving startup delay the first few times, but I am now the proud owner of a gray 2004 Toyota Camry with auxiliary audio input… and no tape deck.