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.

Saturday, October 31, 2009

Halloween prop: monster in a box

Every Halloween, my dad and I put together a small haunted house on the porch of his house. Most of the props are remotely controlled lights, sound effects, etc. This year, I made a new prop that was inspired by something I saw at this year's Maker Faire. It's a wooden crate with a pneumatic cylinder mounted on the inside facing toward the ground. When the cylinder is filled with air, it violently lifts the crate up an inch or two. When the air pressure is released, the crate comes crashing back down to the ground. I also put a heavy chain on top of the crate for a great visual and audible effect. There is a colored light bulb inside the crate that is illuminated at the same instant the gas cylinder is filled.

The wooden crate came from Michaels craft store ($10), and the chain was from Home Depot. I used the chain previously with a come-along winch and had it in my garage already.


I am using a 5# CO2 tank to supply gas pressure to the valve at about 100 psi. The valve is a Clippard Maximatic 12VDC, direct-acting 3-way valve.

http://www.youtube.com/watch?v=QjGJzQbpR2A

Thursday, October 22, 2009

Stainless steel conical beer fermenter Pt.7

The conical fermenter project is coming along well. Here is what's left to do:
1. Mount stainless cooling coil (chiller) to bottom of lid so that I can quickly chill the hot wort after boiling.

2. Make a silicone seal for the lid

3. Make some beer! Wow, I can't believe this project is almost done... it's taken a long time.



Here's a picture of the lid with a thermowell that I made. The thermowell allows a temperature probe to be inserted deep into the tank without exposing the tank to the outside air. It's basically just a long stainless tube that is welded to the underside of the lid and sealed (welded) on the end.

The peltier heating/cooling module is working pretty well despite the copper block soldering mishap. The thermal conductivity is not nearly as good as it should be, but it still seems to work well enough. My original plan was to use two separate peltier modules, but so far, one seems to be sufficient. Without any insulation on the tank, the device held a 15*F difference from ambient temperature, so this project may not even need much insulation.

The temperature setpoint is 67*F. For actual beer brewing, I'm thinking 64*F will be the target ale brewing temperature. So far, I am just using proportional control with a very high proportional constant. The tank has so much volume, and the heating/cooling power of the peltier is relatively tiny, so there isn't much tendency to oscillate.