lauantai 9. heinäkuuta 2016

Modding car stereo head unit with Arduino and Raspberry Pi: Part 1

AN OVERPOWERED SOLUTION TO A BARELY EXISTING PROBLEM!

First you need a 2000s car stereo head unit like this AIWA/Sony CDC-R237 from 2003. It's barely useful as-is because it doesn't even support MP3 CDs.


Let me tell you, these units have some interesting properties. Or at least this one does:

It sounds quite nice. I wouldn't call it hi-fi, but it isn't afraid of any frequencies and it very nicely avoids sounding too "sharp" or "digital"; I like it. It works very well for the kind of funky space dance videogame remix stuff that I listen to. It will turn out all of what makes that sound can be re-used.

The large front panel buttons are implemented by individual switches with a very snappy feel, which I, frankly, require; I can't stand the rubbery crap they use on cheap units. The front panel display contains 8 14-segment characters, a 9-segment progress bar and a bunch of miscellaneous symbols. I consider something like this to be the best user interface that a car music player can have. Maximum clarity and minimal distraction.

So, let's open it!



The optical drive is a module that can be removed by removing a few screws and one cable. It consumes most of the space inside the unit but contains nothing else than what is needed for reading the disc and putting out a line-level stereo audio signal. It is controlled by the main microcontroller by a serial protocol of some kind. It can be just picked out and everything else still works. So, we do that. (Beware: units that support MP3 CDs probably differ from this.)



The removable front panel contains an LC75854E LCD controller and it is almost entirely controlled by the serial protocol of this IC. The datasheet from 1999 is readily available. We will certainly make use of that. The digital potentiometer, eject button, AUX input and operating voltages are wired separately.


So, what's putting out the sound to the speakers? What we have here is a very common construction in car stereo head units: It's just an integrated four channel power amplifier IC - this time from Toshiba - a TA8272H.

The inputs to this power amplifier can be traced out to a weird muting circuit implemented with discrete transistors, and then we find out that they come from this IC, marked LC75421. The datasheet is available, and tells us that this is a volume controller chip controlled by a serial protocol. Like the LCD controller, we can just carefully read the protocol spec and control the thing. In addition to just controlling volume, it supports input selection from 5 stereo sources, it has bass, treble, balance and fader controls, a bunch of other stuff and outputs 4 channels as required by car stereo systems.




So, it's all fun, games and serial protocols!

Well, not really. Tracing out things on the PCB is generally not fun. The power management circuitry on this thing is practically impossible to fully understand and I had to take some shortcuts to get it all powered up. Also, working with these kinds of single-sided PCBs with no plated holes is a pain in the butt because the copper tends to peel off, and consequently snap off.

Regardless, eventually I managed to find enough spots to inject control signals into to get it all powered up.

The way this works from the factory is that the main MCU is always fed 5V power, and there's a whole bunch of signals coming out from it. For example, it appears there is a separate control signal for the MUTE and STANDBY inputs of the power amplifier, and in addition to those there's this weird discrete mute circuitry - and some of those require an another section of the PCB to be powered up, by yet another control signal. It creates quite the puzzle.

Basically, once you've spent an hour and gotten nowhere, you just solder a wire onto the base of a transistor and get on with it. Make sure to leave one of the mute circuits functional though; you don't want the pops and cracks that otherwise happen when things switch on and off.




So, now we have a head unit in which the original MCU is cut off from everything and instead an Arduino Nano manages the power and controls the LCD, the buttons and the volume controller.

...To be continued.

1 kommentti:

  1. Great blog, Thanks For Sharing very useful information. We Can Fit offer mobile car audio installation and fit all aspects of in car entertainment equipment, sat navs and parking sensors - nationwide mobile service, we come

    VastaaPoista