Wednesday, November 11, 2009

DIY aux input cable for Kenwood car stereos

In order to achieve my master plan of abandoning CDs and converting entirely to digital/wireless music, I need to get an audio stream into my car stereo. It is a Kenwood kdc-mpv619. The front of the stereo has no input jacks. The back has output RCA plugs, but no inputs. The only way to get a signal into the stereo is to use the CD-changer connector. This is a 13-pin DIN connector that contains pins for the audio signals as well as CD changer control signals. Around the year 2001, Kenwood realized that people wanted to use the connector for aux input and started to sell an adapter ( CA-C1AUX ) to convert the 13-pin DIN into a pair of RCA input jacks. Prior to 2001, Kenwood models would not accept audio on the DIN connector until it had established digital communication with the CD changer. I know this because I had to get a CD changer and hi-jack the audio lines for an older Kenwood stereo that I have. Anyway I made a copy of the C1AUX adapter, and also helped myself to the power lines that are supplied in the DIN connector.http://pinouts.ru/Home/kenwood_head_pinout.shtml

The resistor is necessary to indicate that there is something connected, and that the stereo should make "aux" available in its menu of input selections.



So, it all worked fine, but the sound on the G1 was still horrible. No bass. No treble, but there didn't seem to be much distortion. It actually sounded pretty clean.

The next step will be to use a bluetooth receiver to feed audio into the car stereo.

Making twisted wiring harnesses with a hand drill

My dad learned this trick from a stereo installer when he worked at a Honda dealership. If you use similarly-sized wires, the resulting twist pattern is very uniform and professional-looking. Cut off a bunch of pieces of wire, then stuff all of the ends into a the drill chuck and clamp it down. Start the drill turning, and use your other hand to keep tension on the wires.

In this case, I made a wiring harness with a stereo audio cable and two power conductors.

Tuesday, November 10, 2009

Rooting and modding an HTC Dream (Google G1)

This project all started with my plan to abandon music CDs and use my G1 phone to carry all of my music. Here's how my ideal situation would work: When I get in my car, I would like to press a button and hear a series of random songs from my music collection that is stored on my computer. Note that I didn't say anything about connecting wires, syncing, downloading, looking through settings or album lists, etc. In the ideal plan, the music would all be handled seamlessly without any thought on my mind except "play".

By the way, I have been using MediaMonkey to handle my music, and I really like it:
http://www.mediamonkey.com

The G1 is a very flexible device, so I figured this would be no problem. However, there are problems. First, the audio quality coming out of the usb->headphone jack adapter on the G1 is truly dreadful. I am not being a stuck-up about this. I mean it's just plain bad. The sound has no bass (it seems anything below 150Hz is completely gone). There are a lot of compression artifacts evident in cymbal sounds, and the high-mids are unusually harsh-sounding. Finally, the overall amount of signal coming out of the headphone jack is very low. Before anyone accuses me of using low-quality MP3, let me say that I made these MP3 myself from CDs and used 320kbit for some test files. They are good MP3 and sound perfectly fine on normal sound systems.

So, connecting the G1 to my car's sound system via a headphone jack, while slightly inconvenient may not work at all because of the low quality. This prompted me to wonder if the Android software had any control over the sound output. As a matter of fact. It does, and it's possible the designers purposefully cut everything below 150Hz for use with speech-only audio.
http://forum.xda-developers.com/showthread.php?t=517745&page=120
Ah, nothing like a 120-page thread. I'm sure it will only take a few hours to read it.

Anyway, the short story is that a developer named meltus has found three audio files in the system/etc directory of the android operating system that have some effect on the sound processing. I was intrigued and wanted to edit the files myself to see how much of the audio quality was dependent upon software. Unfortunately, the android system will not allow anyone to edit system files (even me, the owner of the damn phone). I instantly decided to "root" the phone so that I could investigate the full potential of the device.

Gaining root access is possible on the G1 by a few different ways, but the information available on the web is sketchy. There are only two groups of people who root their phones: 1. Serious developers who are so into Android, that they don't have time to explain the process to newbies 2. Newbies who want root access but don't know what it is. There is a major echo chamber on the web just filled with mindless stupid comments from people hacking away at their phones. I am not against hacking, I am only against repeating misinformation in forums and wasting bandwidth by repeating hearsay over and over again.

Anyway, I followed Cyanogen's instructions, and didn't have any problems at all:
http://wiki.cyanogenmod.com/index.php/Full_Update_Guide_-_G1/Dream_Firmware_to_CyanogenMod
This guy deserves major props for writing a clear, concise set of directions.

The process of downgrading to RC29 is not that hard, and the whole process took less than an hour.

So, here it is, and I know have complete control of my own phone.

The next steps will be to see how much better the audio quality can be made, testing bluetooth high-quality audio, syncing MP3 over Wifi, installing a bluetooth receiver in the car, etc.

Saturday, November 7, 2009

Improved level sensor for the DIY aquarium top-off project


In my
original post regarding an automatic water top-off system for aquariums, I designed a sensor head that consisted of a plastic rod with a set of pocket holes drilled at the tip. The holes were diametrically opposed and angled so that they intersected at a point about 1cm in front of the plastic rod face. I inserted a plastic fiberoptic into each of the holes, and the system would allow sensing a liquid level surface by measuring the amount of light reflected off the surface. If the liquid covered the two probes, all of the light would be scattered off into the liquid and the signal would be almost zero. When the level fell below the fiber ends, the reflected light would trigger the top-off pump.

This system worked very well until nearly flooding my house a couple weeks ago. By extreme luck, I happened to be sitting near the aquarium when an air bubble got trapped between the two fiberoptic ends. This caused the top-off pump to run even after the water level had risen higher than the sensor head. I heard the tank dripping water and quickly shut off the pump. Following this event, I decided to improve the reliability of the sensor.

I did some searching for commercially-built liquid level sensors and found that many of them operate by submerging a prism and measuring the amount of total internal reflection. When the prism is submerged in liquid, the light will pass out of the prism and into the liquid. When dry, the prism will reflect most of the light internally. By positioning the fiberoptics symmetrically, the light signal will be drastically changed by the liquid surrounding the prism.



I machined and polished a piece of acrylic into a point. Then I drilled two holes that would snugly hold the fiberoptics. I mounted the whole thing on a Delrin rod.

This sensor should be much less sensitive to air bubbles, snails, dirt, etc than the previous model. For the next week, I'll be monitoring the top-off system and manually controlling the pump. If it looks good, I will connect the pump and let everyone know how it works.

Monday, November 2, 2009

Drinking glass carrier

This project was inspired by a brew-pub in San Francisco called the Beach Chalet. They have a "beer sampler" on their menu that includes small portions of six of their beers. The beers are served in small glasses that fit into a wooden rack. Neat!


It's been a while since I have been to the Beach Chalet, so I don't remember their wooden sampler rack in detail. That's just as well, since I wanted to design my own anyway. I used maple, walnut, and bloodwood (the same woods that I always use) in this project. The central brass rod is threaded from its midpoint to the bottom and it passes all the way through the wood top and base. A brass nut and washer clamp the top of the rack and another washer and nut are located under the base. The set of nuts clamp the top to the base with no danger of a glue joint breaking (the end-grain to side-grain glue joints aren't very reliable). The brass rod has a hole drilled through it near the top, and a small brass ring is mounted in it for easy carrying. The ring was sealed shut with silver solder.