O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  


 
Buy the book!
Car PC Hacks
By Damien Stolarz
July 2005
More Info

HACK
#53
Build an in-Car Macintosh
Check out how one programmer used OS X and a PowerMac G4 to meet his in-car computing needs
[Discuss (0) | Link to this hack]

Several years ago I got a job in Holland, and I needed a comfortable car for almost-monthly trips to the Czech Republic. I purchased a 1993 Tatra T6134Mi sedan with a rear-mounted 200-HP V8 engine. Ironically, although the car I purchased had been made for the Frankfurt auto show and was originally equipped with fully digital controls, a handful of computers, and features such as voice synthesis, the factory had replaced all this equipment and rewired it with more traditional controls after the show. The moment I bought it, I decided that a computer had to be put back in. I started to design my Tatra computer in the summer, and by Christmas I had a working installation.

The main features that I wanted my in-car computer to provide were a navigation system and the ability to play my MP3 collection—anyone who needs to make 1,000-km trips every month or has ever been lost in Copenhagen can understand the need for a lot of music and a good map.

Of course, I could simply have purchased dedicated navigation hardware (and a head unit that plays MP3s), but I was not very excited about the prospect of spending several thousand euros on a dedicated hardware solution and then having to wait for the manufacturer to release the maps that I needed of the Czech Republic. The use of a standard computer gave me much more freedom in terms of the configuration of the system and of potential software and hardware upgrades.

During the design and construction of my mobile Mac, I also decided to add some functionality that I hadn't anticipated, including communication with the engine controller and an on-board microcontroller for basic telemetric data.

Installing and Mounting the PC and Screen

I soon realized that the original dashboard of my Tatra didn't have an ideal place for a fixed mount of the 6.5" LCD screen, and that a retractable screen would also cause quite a few problems. I therefore decided to rebuild the whole dashboard from scratch. This also allowed me to replace the original gauges, which were not really high-tech (almost unreadable at night, for example). is a behind-the-dash look at the rear of the LCD.

Figure 2. The back of the LCD screen

The placement of the computer also had to be reconsidered. There was not enough space below the front seats for a PowerMac, so I had to abandon this idea and start thinking about how to install the computer in the trunk (which, in a Tatra, is located in the front of the car). I wanted to use the least possible trunk space for the computer, so in the end I decided to install it in a rectangular case attached to the rear wall of the trunk (see ).

Two important engineering issues to be dealt with were heat and water condensation. The main heat source in older PowerMacs is certainly the hard disk, and the parts that are most vulnerable to condensing humidity are the motherboard and the PCI cards. Based on this knowledge, I decided to separate these two parts of the system.

Figure 3. My PowerMac, on a plexiglass plate

I installed the motherboard in a fiberglass case and the hard disks on a console next to this case. At first I wanted to completely seal the motherboard case, but later I found that this was not really a good idea, particularly due to temperature changes affecting the air volume inside the case. To fix this problem, I installed two Gore-Tex valves on the case (). These valves are used in the automotive industry to allow air circulation in the headlight units while keeping any water on the outside.

I did not take any special measures for CPU cooling, although the CPU is mounted in a closed space with minimal air circulation—the 450-MHz G4 processor is known for its low cooling requirements, so I decided to wait and see how it went before over-engineering a solution to a problem that might not exist. This hunch proved to be correct, as even in 35° C days last summer with the computer running for 15 hours, I never had problems with CPU temperature, and the hard disks did not suffer any damage (even on the roads in the Czech Republic and Slovakia, which are not always up to civilized standards!).

Figure 4. A complete PowerMac G4 in the Tatra

Powering the PC

Although my final solution turned out to be simple and reliable, the power supply was probably the biggest problem I encountered during the whole installation. My very first idea was to use an uninterruptible power supply (UPS) without an internal battery, connected to the car's battery. This idea cost me two UPS units, both of whose transistors burned out. Even a 300W UPS was not able to handle the current surge that occurred when the computer started up.

My second idea was to use an inverter and the original 220V power supply. This almost worked—I say "almost" because, while it did power the computer, there was a 50-Hz noise on the audio output of the computer that I could not eliminate.

Fortunately, my third idea, a 12V ATX power supply, did work perfectly. I used a commercial Turbo-Cool power supply (see ) that works with input voltages of between 9V and 16V . The maximum rated power is only 100W, which is much less than the 250W of the original 220V power supply. However, the original power supply was designed for a workstation full of disks and PCI cards, which is certainly not my case. The only problem I have experienced so far is that the 5V output of the power supply is not capable of providing enough current for all of my USB devices, and this problem was very easy to address by using a USB hub powered by a special 5V power source . The very wide range of the input voltages ensures that the power source is able to power the computer even when I'm cranking the engine .

Figure 5. The original 220V and new 12V ATX power supplies

The power supply is controlled by the power-on signal from the motherboard, which has an idle current of about 100 mA. Accidental draining of the battery is not much of an issue, since this current is comparable to the idle current of other devices in the car (such as the alarm and the engine controller).

TIP

Motherboards usually draw more standby power—for instance, the VIA motherboards draw 300 mA without any devices attached. The drain of the PowerMac in this installation is quite low, but you might still want to invest in a startup controller , which will draw less than 10 mA. This is the best way to prevent battery drain, especially if the car is not driven (and recharged) daily.

Peripherals and Controls

There are several basic ways to control the computer, and most of them can be implemented using standard USB peripherals. Many people use touchscreens in similar installations. Although I also considered this option at the beginning, I rejected it pretty quickly. In my opinion, having to look at the screen while driving results in a loss of concentration that can be dangerous. Instead, I decided to use controls with fixed positions that can be used without looking at the screen.

The key control element in my installation is Griffin Technology's PowerMate rotating controller (http://www.griffintechnology.com/products/powermate), which is used not only for controlling the software , but also for starting up the computer. I also installed a row of buttons beneath the screen in the dashboard, for auxiliary functions. This is all shown in .

When I'm not driving, I can control all the functions of the computer using an infrared keyboard with a built in trackpoint that emulates a mouse. Rear-seat passengers can control the movie player and some other functions with another infrared device—Keyspan's Digital Media Remote (http://www.keyspan.com/products/usb/remote).

For convenience, I installed two USB connectors in the center console to allow ad-hoc connection of other USB devices when required (typically, a keyboard and a mouse).

Frontend Software

My Tatra PowerMac uses both standard and custom applications. I tried to use standard applications whenever possible; the custom applications mostly only provide a simplified user interface to some of the standard applications and some car-specific functions, such as the display of speed and fuel consumption.

The main application, called Tatra.app (http://sourceforge.net/projects/dash-mac), was written by Ondra Čada. It runs in full-screen mode and hides the standard OS X menu bar, as well as the Dock. Its screen is divided into several parts. At the top of the screen, there is a space for what we call a "compass module." The middle and biggest part contains eight slots, each of which can be used by different plug-in modules to display information and user interface elements.

The user can select which modules are installed in the eight slots of the main window, but even a module that is not currently displayed or has no user interface in any slot can display urgent messages or status information, using either icons or pop-up windows. The main application also provides the modules with the ability to speak messages, through Apple's text-to-speech technology. Spoken feedback allows the user to work with the computer without even looking at the screen.

A module can optionally have a special "setup" part, which is available through the main application in its setup mode. Unlike the main window and activated modules, the user can control it only by standard keyboard and mouse input, not via the PowerMate. (Obviously, this mode is not supposed to be used while driving.)

Here's a list of the modules I currently use:

  • Current speed

  • Current fuel consumption

  • Fuel status (consumed from last fill-up, remaining, range)

  • Fuel counter (resettable, multi-instance)

  • Distance counter (total)

  • Distance counter (resettable, multi-instance)

  • Stopwatch (resettable, multi-instance)

  • Countdown (multi-instance)

  • Vehicle data input (GUI-less, reads data from onboard systems)

  • Temperature module (internal CPU temperature and sensors in car)

  • MP3 player (controls iTunes using AppleScript)

  • System (switching between apps, turning off power, night display mode)

To support all these vehicle measurement modules, I connected a separate circuit board with its own microcontroller to the car's engine and installed five digital thermometers and a distance counter on the transmission. (For the interested, the microcontroller was designed and built by Tomáš Struziak, and the schematics can be found at http://aek4470.finalnet.cz/html/palpoc.htm.)

Movies and Music

In Tatra.app, modules can be "activated," or made responsive to the user's commands. shows an MP3 player module. In the normal state, the module displays information about the track currently being played. In the "active" state, the module displays a dialog box that allows the user to pause the playback and select the track and playlist to be played. All these functions are controllable using the PowerMate rotating controller, so the driver can cycle through the playlists without having to look away from the road.

Figure 8. An MP3 player Tatra.app module

I had originally planned to install a DVD drive in the center console, but after seeing the high quality of DivX/MPEG movies I decided to implement a video jukebox application instead of having DVDs strewn all around the car.

I wanted my computer to deliver multi-zone content (i.e., different audio and video in the front and back seats), so I developed another application that could play back a different movie on the second video card and reroute the corresponding audio to separate speakers or headphones. Like the main application, my movie player also runs in full-screen mode and uses a simple user interface, controllable by either the PowerMate controller or the Key-span infrared remote control. It can display the main window on any connected screen, so it can be used on the primary screen in the dashboard as well as on the secondary rear screen (). It provides only basic playback functions (choose a movie, play it, and pause it), but it gets the job done.

Figure 9. My movie-player program

See also:



O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.