KARR control panel on the dash of a 1986 Dodge Omni..
In 1997, I was trying to build a wearable computer, called the PandaScope, using some embedded PC hardware from a variety of sources. The result was too big and bulky to be truly wearable, and so the project was shelved and I kept the parts (which cost over US$2000 at the time) in a box, gathering dust.
In February, 2000, I heard about a device called the Lp3 that would allow any PC with a parallel port to play MP3's. So I took the old parts of the PandaScope out of the box, applied appropriate amounts of sweat and duct tape, and KARR was born.
So what does it do? At the moment, I mostly use it to play Mp3's. Mp3 is a digital music compression scheme that can reduce the size of a music file by a factor of ten without noticable reduction in quality (although audiophiles will argue the point). With only a two gigabyte hard drive, KARR can store over twenty hours of encoded music. I've programmed in a number of simple features such as 'start', 'stop', 'skip', and 'shuffle'; KARR has all the benefits of an in-car CD changer for a fraction of the cost.
KARR is also a lot more flexible and interesting than a consumer-grade CD changer that would cost $3000 at a stereo shop. In theory, KARR can do anything a desktop 486/100 PC can do.
The core of KARR was originally intended for use as a wearable computing system - eg, a PC that you can carry around with you, that's 'always on' and 'always available'. This differs from laptops and PDAs in that you generally don't have to dig it out/open it up/turn it on - it's 'always there'.
For more information on wearable computing, refer to the MIT Media Laboratory web site at http://wearables.www.media.mit.edu/projects/wearables/.
Typical CardPC. This image is from the Cell Computing web site. For more information about Cell Computing's CardPC devices, visit http://www.cellcomputing.com/third/prodp200.html
KARR is based on a CardPC, which is a system developed by SMOS, Cell Computing, Oki, and others. The CardPC is a credit-card sized motherboard with a 300+ pin 'EASI' connector. EASI carries all the signals normally found on a full-sized PC/AT motherboard, including serial ports, IDE hard drive interface, VGA, keyboard, and so on. Several wearable computing designs use the CardPC motherboard, including the HackMan, a wearable computer developed by Rehmi Post at MIT.
Parvus Complete Scalable CPU carrier board and a CardPC. The image on the right is from the Parvus web site. For more information about Parvus, visit http://www.parvus.com/
Generally, CardPC motherboards are inserted into a carrier board to turn the physically-small EASI connector into something a little more familiar, such as the .1-inch headers commonly used inside desktop PCs. KARR uses a Parvus Scalable CPU card, which is a PC/104-based carrier for CardPCs.
For more information about the PC/104 embedded PC
For more information about the PC/104 embedded PC standard, visit http://www.pc104.com/whatis.html
KARR uses an off-the-shelf Lp3 to decode MP3 files. The Lp3 player simply plugs into the parallel port cable from the CPU card, and has 1/8-inch female jacks for headphones and line out. The Lp3 supports stereo Mp3 playback at over 200 kilobits per second and CD sample rates (44.1 khz).
A male-to-male 1/8-inch stereo cable is used to connect the line-out jack on the Lp3 to the CD In jack on the vehicle's stereo. I could have also used a CD-to-Casette adapter here if the car stereo lacked the CD In jack.
KARR supports ordinary PS/2 mouse, keyboard, and VGA ports, as well as an LCD interfaces for driving laptop-style LCD panel displays. However, none of these are suitable for use while driving.
A VGA LCD interface is a workable but expensive solution, and requires modification to the CardPC's BIOS. A cheaper and simpler option is a Matrix Orbital display. These are serially-interfaced, self-contained LCD display modules suitable for use with a PC's serial port (aka a COM port).
Matrix Orbital GLK24064 LCD display with generic membrane keypad. For more information about Matrix Orbital's displays, visit http://www.matrix-orbital.com/
Matrix Orbital displays are available in a variety of sizes, from ten to forty columns, and from two to eight rows. All Matrix Orbital displays are backlit and can run from a single 5-volt input. Displays may also include a keypad encoder or an AT-style keyboard interface. Some displays support simple line and bitmap graphical display.
KARR uses the GLK24064, which is a 240x64-pixel graphical display that also supports up to 30 columns by 8 rows of text. Like all Matrix Orbital displays, it is backlit and runs from a single five-volt power supply. This model also includes a five-by-five keypad encoder.
KARR uses a four-by-four keypad from Digikey for input. The keypad module plugs directly into the keypad encoder on the LK24064, which transmits keystrokes over the same serial interface that drives the display. The display module plugs into a standard 9-pin serial connector from the CPU card.
Tri-M Engineering V-104 Vehicular Computer Power Supply. For more information about Tri-M Engineering, visit http://www.tri-m.com/
The power supply for KARR is a V-104 Vehicle Power Supply from Tri-M Engineering. This is a PC/104-compliant card that turns inputs from 8 to 30 volts into PC/104 supply voltages and provides power through the bus, eliminating the need for additional connectors to the computer.
The V-104 is available with a variety of options, including A/C input, connections to a batter backup, battery recharging from input power, and -5 and -12 outputs. This V-104 includes +12 volt output, so that it can drive a desktop hard drive. The total power rating of the V-104 is 25 watts, which is more than enough to drive the CPU (at 10 watts), hard drive (at 7 watts), and LCD display (at less than one watt).
The V/104 uses the car's cigarette lighter port as a 12-volt power supply. The Lp3 requires a 9-volt power supply. Since a PC internally only has a 5-volt line (too little) and a 12-volt line (too much), the Lp3 takes its power from a seperate voltage converter. In this case, an ordinary Radio Shack power adapter is used. A splitter is used to allow the main computer and Lp3 to share the same cigarette lighter port.
I'm no expert on power supplies. However, I've gotten a few ideas about embedded power supply design from experimentation and various sources:
Generic two gigabyte desktop hard drive, in a plastic VHS clamshell case.
KARR uses a standard two-gigabyte desktop hard drive for storage. The drive plugs into the IDE interface on the CPU card and is driven by the +5 and +12 volt outputs on the V-104 power supply. Any IDE hard drive can be used, within the limitations of available power (about 10 watts).
The CPU card provides all the usual PC expansion ports, including IDE, floppy, CGA, VGA, a parellel port, a pair of serial ports, and PS/2 mouse and keyboard ports.
Intelec PCMCIA104 PC Card adapter, shown with 3Com Etherlink PC Card. For more information about Intelec's PC Card adapters, visit http://www.intelec-tech.com/products.html#PCMCIA104.
KARR is also equipped with an Intelec PC Card adapter. This is a PC/104 device that will accept up to two Type II PC cards. Currently this interface is only used for an ethernet connection during bench-testing, and for changing the Mp3 files on the hard drive.
KARR runs Linux, a UNIX-like operating system whose components are available undef GNU and other public license. In particular, KARR runs a subset of the Slackware version 7 distribution of Linux. This distribution was selected because it is easy to trim Slackware down to an embedded configuration.
Slackware was installed by attaching KARR's hard drive to a desktop PC and running the normal install procedure. The hard drive was then removed and installed in KARR. In the particular configuration used here, the operating system takes up less than 300 megs and includes a full development environment for working on KARR when a host PC is not available.
It is worth noting that it is possible to trim Linux down even further. Some embedded distributions fit in 64, 32, 16, or 4 megs, and are suitable for embedding on flash memory devices.
The Lp3 is designed to play back Mp3 files using a hardware CODEC. The Lp3 comes with a kernel module for the Linux operating system and provides a standard file-like interface (/dev/lp3-0). This means that playing back an Lp3 is a simple matter of streaming the Mp3 file to /dev/lp3-0.
It is necessary to monitor the state of the Lp3 using ioctl() command LP3_IOCGLEN. This command returns the amount of data remaining in the kernel module's buffer. Closing the file prematurely will cause this buffer to be discarded, and the last 30-60 seconds of the track will not be played. Therefore, our application must wait after copying the last part of the file to the driver for this buffer to be emptied. It is further advisable to wait an additional ten seconds after the buffer is emptied for the Lp3 hardware to finish playing through its internal (hardware) buffer, for similar reasons.
For a full discussion of the Lp3 driver for the Linux kernel, see Lp3's Linux documentation at http://lp3music.com/downloads/linux/linux.driver.spec.R2.pdf.
The Matrix Orbital LCD panel interfaces to the PC through a standard RS-232 (COM) port. Reading and writing this display is a simple matter of reading and writing to /dev/ttyS0. However, the GLK24064 display module does not understand carriage returns or linefeeds. Also, the keypad only sends ASCII characters A through Y, and does not send carriage returns. Therefore, it's not practical to make a termcap entry and treat it as another terminal. It is necessary to do some screen management in the application (eg, re-implement some of the functionality in Curses.)
The application software that drives KARR is written in Perl, a scripting language suited to rapid prototypes of embedded applications. The Perl driver program opens several files for the LCD and the Lp3 and drives them using a select() loop.
ETI Half-Cube PC/104 Enclosure. For more information about ETI, please visit http://www.etiworld.com/home/index.html
The PC/104 cards are mounted in an Enclosure Technologies Incorporated (ETI) Half-Cube. This is a special metal enclosure designed for up to four PC/104 cards with a generous inch or so on three sides to allow for cables and connectors. It also has knock-outs for PC/AT-type serial, parallel, and keyboard ports.
Electronic components of KARR, including Card PC, PC/104 carrier board, power supply, PC Card adapter, LCD display, keypad, hard drive, Lp3 player, and the Lp3's 9 volt power adapter.
CardPC inserted into Parvus carrier board, and attached to ETI case as the bottom card in the PC/104 stack.
The Card PC inserts into a clip on the underside of the Parvus Scalable CPU. The heat sink and DRAM port on the Card PC make it about a quarter inch thicker than the PC/104 standard, so this card MUST be mounted on the bottom of the stack.
Similarly, the V-104 power supply is covered by a big piece of sheet metal. While it's not impossible to stack cards on top of the V-104, it would interfere with heat sink operation, so I put the power supply on top of the stack. The heat sink makes contact with the top of the enclosure, providing better heat dissipation. There are two flanges on the outer edges of the heat sink that must be bent back about 45 degrees to get them to fit in the half-cube.
The assembled PC/104 stack of three cards, with the power supply on top, the CPU on the bottom, and the PC Card adapter in the middle. Note the blue 100-mil connectors for AT-style interface cables on top of the CPU card. Ribbon cables are run from these connectors through either side of the stack to interface to other hardware.
The PC Card adapter is located in the middle of the stack. The three cards stack neatly on the PC/104 connectors, and the whole assembly fits neatly in the ETI Half-Cube.
The complete wiring harness for KARR.
The CPU card provides PC/AT standard .1-inch headers for all the usual peripherals. Connectors can be found at any computer store. Some have to be modified to remove strain reliefs and so on that would interfere with stacking the cards. It's possible to stack more PC/104 cards on top of these when the cables are all lying flat and exit the stack from the left or right sides.
The VGA, keyboard, and serial cables run out the left side of the stack. Serial connectors are mounted in the knockouts on the front panel. The keyboard and VGA cables are routed outside the case through the DB-25 knockout.
A 12-volt extension cord plugs into the input of the V-104 power supply. The cable enters the case through the round knockout on the front panel. The ETI case came with a rubber gasket for this knockout. This is used to prevent the cable from rubbing against the sharp edges of the enclosure.
Karr uses a standard PC internal hard drive connector on the outputs of the V-104 to provide a convenient means of powering off-board peripherals. A Y-splitter is used to run power seperately to the hard drive and the LCD. One end exits the case on the left, the other exits through the DB-25 knockout in the front panel of the case.
ALL the cables passing throught the DB-25 knockout are wrapped with electrical tape to prevent them from wearing on the edges of the apeture.
The hard drive is placed inside a VHS clamshell case. A small notch is cut in one end of the case to run cables into the enclosure.
Extra-strength velcro and cable ties are used to attach various parts of KARR to the vehicle dash.
While the CPU and other electronics are the most expensive parts of KARR, the cabling is the most time-consuming. As much as possible, common AT-style cables and connectors are used to reduce the number of unusual cabling requirements.
Control panel and keypad mounted on the dash of a 1986 Dodge Omni. Note use of velcro to retain cables in a neater bundle.
System unit, hard drive, and Lp3 installed in a cavity in the console of a 1986 Dodge Omni. Note the arrangement of cabling.
In my car, there's a convenient seven-inch square tray at the base of the console that fits the hard drive and CPU unit perfectly. I run the serial cable, LCD cable, and stereo cable up the left side of the dash and secure them with a strip tie. The power cables go to the cigarette lighter on the right side. The LCD sits on the dash, with velcro holding the keypad and cable bundle in place, so that it won't slide around.
KARR includes standard PS/2 keyboard and VGA cables so that you can attach it to ordinary dekstop PC hardware. I recommend getting a seperate cheap VGA monitor and PS/2 keyboard for testing.
I use a regulated 3-amp, 12-volt DC power supply to drive KARR on the workbench. You can get something like this at any good electronics store. I used the female end of a 12-volt power extension cable to attach the power supply to KARR.
Operating system installation, configuration, and boot procedures are left as an exercise to the reader.
The CardPC CPU was the most expensive component of KARR, and the one most likely to be replaced in alternative implementations. Any other 386 or higher PC is sufficient. There are dozens of other PC/104-based single-board computers that could replace the CardPC.
Substitution of another CPU card might free up enough room on the bottom of the CPU stack to allow use of a 2.5" notebook computer hard drive inside the case. In this case, it's best to get a CPU card that has a 2mm hard drive header instead of the 0.1 inch headers used for desktops.
Timeline, Inc. is a surplus company that has $90 486/25 embedded PC's intended for use as Point-of-Sale systems. These units include all the usual PC hardware, a bay for a notebook hard drive, and a built-in UPS.
A friend of mine is experimenting with a Biscuit PC from Advantech. These are small, inexpensive, low-power PCs. Some include onboard Sound Blaster-compatible hardware and CPUs up to a Pentium 233, so they could play the Mp3's back through software, eliminating the need for the Lp3. While not as cheap as the Timeline 486, these are still likely to be cheaper than any other similar PC/104 solution.
The following people have provided support for the KARR project:
Thanks also to Ingrid Lancaster at EMJ Embedded, May Liu at Tri-M Engineering, and Bryan Karas at Future Standard for assistance in obtaining the specialty components present in KARR.
Any suggestions or comments are welcome. Please direct them to firstname.lastname@example.org