Saturday, July 4, 2009

Woodworking with a piece of raw tree trunk

My friend recently had a tree die and fall over on his property. He cut it up with a chainsaw, and offered a few of the pieces to me for use in woodworking. I have never started a project with just a raw log, so I figured it would be a fun learning experience. The tree died in the winter, and it was soaked with rain water, so I put the pieces on a few bricks to keep it off the ground and covered it with plastic on rainy days, leaving it uncovered on dry days. After the rainy season was over, I removed the plastic, and left it sitting in the sun for few months. It's dry now, but badly cracked. I have a feeling it may have been cracked even before the tree even fell over, but I would be interested in hearing from anyone who has experience drying logs.

I chose one of the smaller logs and sliced off a piece with the bandsaw.


Next, I clamped a 4x4 to the bandsaw table to act as a crude fence. It's set to a little over 1" of thickness from the blade.

I jointed the exposed log face before cutting each 1" slice with the bandsaw. I then jointed the other side of each board, and also jointed one edge. I then planed each board to exactly 1" and used a table saw to square up the other side. I now have flat, square stock ready for the project. The wood had lots of cracks, but the figure was really pretty. I think this was an almond tree.


I ended up cutting the boards into 1"x1" x 12" long strips. I decided to make a napkin holder, since it was something that I could build with a small amount of wood, and would be useful. I used standard yellow wood glue and only used tape while drying -- no clamps.


I used a 1/8" radius round-over bit in my router table to smooth the edges, then sanded with 150 grit on a random orbital sander, and also did some hand sanding. I applied a Tung oil finish (my favorite finish) in a few heavily-rubbed coats.


Monday, June 29, 2009

Improving guitar cable connections

This weekend, my band played a gig on Saturday and Sunday in Monterey. On the third-to-last song on Sunday, I started to have problems with the sound coming out of my bass guitar. The sound cut in and out and had some distortion and static. I managed to get through the last few songs by wiggling the cable and standing very still (to prevent jostling the connection). After I unpacked my gear, I set about finding and correcting the problem. I found two separate problems:

1. The bass->amp cable had an intermittent short in one end caused by a strand of the shield coming into contact with the signal conductor. I've seen this failure mode many times in guitar cables. The constant motion and bending causes the shield wires to fray and migrate around inside the connector. The fix was to cut off the stray strands, and wrap some tape around the center conductor in the connector.

2. The 1/4" phone jack in the bass guitar itself would fail if the plug was pushed in just the right direction. This bass uses active pickups and senses when the ring of the phone jack is connected to the sleeve (ie a mono plug is inserted into the jack) to supply power to the active pickups. This way, the bass will not run down the battery when it's not plugged into the amp. I am not sure which contact was failing intermittently, but it was probably the sleeve or ring. I replaced the phone jack with a 4-pin "mobile radio" connector. These connectors are very rugged and have a threaded ring to secure the plug into the socket. No amount of twisting or pushing will cause it to break contact. I used three of the pins (two are shorted inside the plug to provide the battery-saving feature). I made a special cable that converts the 4-pin connector on the guitar to a standard 1/4" phone jack on the amp. The only downside to this setup is that the plug cannot rotate, which is one benefit of the 1/4" phone jack -- it helps to get kinks and twists out of the cable while walking around or moving the bass around stage.

Anyway, I'll post about this again if it turns out to be a really bad or really great idea.


Saturday, June 13, 2009

Improving Bing maps (formerly called MS Live Search)

Microsoft recently rebranded their "Live Search" maps as "Bing". The only notable feature is that it has a bird's-eye-view, which is lacking from Google Maps. I use the bird's eye feature often because online real estate sites like redfin, trulia, etc generate links to show the houses that are for sale. Recently, Bing maps became much less usable. Whenever the site loads, an obnoxious pop-up demands that I install the 3D viewer client -- complete with shady-as-hell setup.exe file. I don't see any way to permanently decline the 3D viewer. There is also a stupid list of mapped items on the righthand side of the screen. This might be a useful feature, but it should be possible to permanently disable (especially when there is only one thing in the list!). The left side of the screen is dominated by ads. Here's what it looks like:


Even after dismissing the popup with its annoying bandwidth-hogging flash movie, there is still very little map actually visible on the screen. The solution is to write a greasemonkey script for Firefox. This tool allows users to write javascript that is executed for a pre-determined set of webpages (like http://www.bing.com/*). Here is what Bing looks like after my greasemonkey script was setup:


Aahhh, that's so much better. It actually looks like a map now, and I don't have to spend at least three clicks closing stupid windows everytime that I see a Bing link somewhere on the 'Net.

Search for greasemonkey to find out more about this tool. Here is my script (note: I am a rank-beginner when it comes to javascript. I am sure there are numerous problems with this code, but it does work):




var preventlayer = document.getElementById('__preventLayer__');
if (preventlayer) {
preventlayer.className = 'boguspreventlayer';

}

var mainpopup = document.getElementById('help');
if (mainpopup) {
mainpopup.style.display = 'none';
}


var taskarea = document.getElementById('msve_taskArea');
if (taskarea) {
taskarea.style.width = '1px';
}

var mainmap = document.getElementById('msve_mapArea');
if (mainmap) {
mainmap.style.marginLeft = '0px';
mainmap.style.width = '100%';
}



document.addEventListener('DOMNodeInserted',function(){

var sidepopup = document.getElementById('msve_ScratchPad');
if (sidepopup) {
sidepopup.style.display = 'none';
}

},true);



var footer= document.getElementById('sb_foot');
if (footer) {
footer.style.height = '0px';
}


// hack to get AJAX to redraw the map after greasemonkey altered the map width
window.resizeBy(-1,0);

Tuesday, June 2, 2009

Drum practice and recording setup

In this post, I will describe the setup that I use to record my drums while practicing. I recently bought a Zoom H4 Handy Recorder. It works really well, and I think it is a worthwhile piece of equipment. One of its really nice features is the ability to connect two external sound sources and also supply phantom power. The device allows individual level adjustment for each source, and will also mix the two inputs into stereo. I have it setup with a Tama Rhythm Watch RW105 metronome, and an omni condenser microphone. The mic is normally used for testing the frequency response of home theaters and it has an extremely flat response from 20Hz to 20kHz. This doesn't necessarily make it a great overhead mic for drums, but it's what I have.

The output of the H4 goes into earbuds, then I wear large earmuff-style hearing protectors over the buds. This lets me adjust the volume of the metronome and drum kit (from the single condenser mic) very easily. I can also hit record on the H4, and make a quick track so that I can critique my playing very quickly. This setup has proven very useful.

Sunday, May 24, 2009

DIY dosing pump for reef aquarium

Part of the daily maintenance on a reef aquarium is controlling the calcium and alkalinity levels in the water. Calcium is used by reef inhabitants to build their skeletons, and it is also precipitated abiotically (calcium deposits on pumps, heaters, etc). Even though this rate of calcium utilization is fairly slow, it must be replenished to ensure there is always a sufficient supply, and having a very consistent level is beneficial to the inhabitants.

The alkalinity level of the water is a measure of how resistant the pH is to fluctuations. It too must be replenished to keep the pH of the water stable. If you are curious about marine calcium/alklainity, search the web. There is a ton of information available, and it is quite complex and interesting.

There are a few ways to maintain proper calcium and alkalinity levels, but I prefer to use a two-part alkalinity and calcium supplement called B-ionic. My aquarium is 5 gallons, and so it only requires about 1 mililiter of each solution (alk and ca) added each day. The exact amount varies, and the two solutions may need to be dosed in unequal quantities. Well, this gets a little tedious after a while, so I built a device that would slowly add the desired amount of each of the alk and ca solutions over the course of a day:I bought two "syringe pumps" on eBay for under $15 each. The pumps consisted of a leadscrew assembly, split-nut, and holder for the syringe. There was no motor, but I knew that they were originally intended to be run by a clock motor. The speed of the motor was constant, hence the only way to control the dosing rate was by changing the motor or the syringe diameter.

I hacked up the syringe pumps a little, and fitted them with two stepper motors that I got at a surplus store for $17 each. The motors are unipolar (6-wire), 1.8*/step, 24V per phase at 300mA.
The motors are mounted to the leadscrews with a short length of Delrin shaft. This allows a necessary amount of flexing, since the motor shaft and the leadscrew are unlikely to perfectly aligned. This is a very low-speed low-torque application, so the strength of the delrin shaft is not an issue.



The motor driver circuitry is built from PN2222A transistors that are wired between the motor windings and circuit ground. Each transistor has a clamp diode and filter capacitor on its collector. Each transistor base is driven by a pin on the Arduino Duemillenove microcontroller board. There are four phases for each motor, so this took a total of eight pins on the Arduino. The Arduino is also connected to a 4x20 LCD screen via 6 pins (4-bit interface). I also wired two potentiometers to the Arduino's analog input pins. The pots are setup as variable voltage dividers between ground and 5V.

The Arduino runs code that reads the positions of the two knobs, translates the positions into timing intervals, and advances each of the stepper motors when its respective time interval has elapsed. I also added code to de-energize the motors 1/2 sec after they have been advanced. In this application, the time between motor steps ranges from 40 seconds to 3 minutes. I tested this power-save feature, and it appears the system has no tendency to push the motor backwards while it is unpowered. Thus, power is only necessary when the motor is moving, and it can be deactivated when it is waiting for the next step.

The circuit and motors are powered by a 20VAC wall transformer. I rectified this with 4 diodes, and used a 7805 to supply 5V to the Arduino and LCD. The motor windings get unregulated DC voltage about 20V, since the load from the LCD's backlight is substantial. The 7805 required a large heatsink for this same reason.


For display purposes, the Arduino code translates the motor timing interval to mililiters/day. Turning the knobs provides a very responsive update of the LCD value. It is easy to set the device with .01 mililiter/day precision, although I doubt the device mechanially has that level of precision.

I calibrated the device by turning the stepper motor a specific number of steps, and used a very sensitive scale to measure the mass of water that was pumped out of the syringe. Later that day, I setup the device running normally with its output directed over a vessel on the scale. I learned that my scale must have an anti-drift feature, as it did not register any mass! Instead, I measured the water with a small syringe, and it came it at 4.75 mL (should have been 5). I am not sure if .25mL evaporated, or if .25mL stuck the sides of the vessel, or if the system is inaccurate. Maybe it's all three. The .25mL discrepency is not too important, since the settings will be tweaked based on water testing results once it is up and running.

I am still testing the system, as I really want to be sure it is stable. If the device malfunctioned and dispensed all of its calcium in one blast, it might kill everything in the aquarium. The code is pretty simple, but the Arduino clock function will rollover every 49 days, and it's difficult to test what will happen at that time.

I'll make another post when I install the system on the aquarium.