Friday, January 25, 2013

GoPro Underwater Pole

Some folks have asked how we made our GoPro fishing videos. First, I have to say that this project was very much inspired by the crew of the yacht Teleport.















Our simple rig was made with code 40 PVC pipe. In the drawing below, the GoPro has been rotated 90 degrees around the axis of the pole for clarity.










The length of the rig just needs to be long enough to get under the boat when lowered into the water at an angle. The two one-foot lengths of pipe are used as handles to steer the camera in the general direction of the action. The tee and end-caps were glued using normal PVC solvent type glue. One problem I encountered was that as I tried to put on the last cap, the compression of the air inside tried to push the cap back off. I had to hold the cap on tight until the glue set up. The next time I do this I'll put a threaded coupling on the end of the handle, then seal it with a threaded cap.

We were concerned that the GoPro camera might somehow come loose from the clamp during operation. We weren't using the camera'a the float so I had visions of the camera dropping 70 fathoms to the seabed, so we tied the camera to the pole with string. The next concern was what would happen if we dropped the rig in the water. We didn't have time to test it to see if it floated so I tied a rope to it then tied the other end of the rope to a cleat on the boat. Next trip, if we find it doesn't float, the solution may be to wrap the pipe with a "noodle" pool toy. Not only would this increase buoyancy, but it would reduce the sound picked up by the camera when the pole bumps the side of the boat.

Friday, August 10, 2012

Cloning Bootable Linux Flash Drives

I'm forever forgetting the Linux command to clone Linux flash drives. It comes in handy because it's really easy to accidentally trash the file system if your PC crashes or you accidentally perform and un-graceful shut-down. Keep many and make frequent back-up of your work in progress if you're doing on a flash drive!

Here's the command:

    dd if=/dev/sdc of=/dev/sdd

This is a very powerful command! You will need to invoke the power of sudo! Make sure that if the PC has a hard drive that you don't point the "of" (output file) at it our you'll wipe out what every operating system was on it. Remember that you also need to run this from a drive that isn't your input or output flash drive. For this reason you may need as many as three USB devices to complete this operation. 

Do not run this command verbatim! First do an ls to determine what your current drives are, and make sure to keep them out of this command. Then plug in the source drive, and use ls to find its name (i.e. sdc). Next plug in the destination drive, and again determine its name. Only then run the command. You will find that a 4GB flash drive may take quite a while to copy.

Wednesday, July 4, 2012

Getting the time date stamp into the file name

We just returned from a two week trip to China on which we took 3000 photos with four different cameras. Now we need select a hundred or so to put on our web page. The problem is that most image previewers sort by file name. This means the photos are each grouped by camera.


require 'rubygems'
require 'exifr'

mypix = Dir.glob(ARGV[0] +"/*.{jpg,JPG}")
    somepix = mypix.sort_by \
        { |a| EXIFR::JPEG.new(a).exif.to_hash[:date_time_original] }
    somepix.each do |pic_file| 
 regex = /[\/\.]/
 system("mv " + pic_file + " " + 
            pic_file.to_s.split(regex)[0] + "/" +
            pic_file.to_s.split(regex)[0] + "_" + 
            EXIFR::JPEG.new(pic_file).exif.to_hash[:date_time_original].strftime("%Y-%m-%d_%H%M%S") + 
            ".jpg")

end

The run the app

$ruby rename_pix.rb trip12a


And now you can sort your pix.

Fixing Mini-blinds - Fishing Supplies to the Rescue

Many of us have mini-blinds or honeycomb shades at home. These are usually special-ordered and custom cut to fit your windows. For the most part you get the same style for the whole house.

When part of the mechanism on one of our honeycomb shades broke, the left side hung lamely when I pulled the cord to let some light into the bedroom. Our shades are old, and I'm pretty sure that I wouldn't be able to find an exact match if I wanted to replace it. I thought to myself, "this is going to be a real mess to fix." Then it occurred to me that someone had to assemble these shades in the first place, and I'm at least as handy as that person.



I found the there were end caps that easily snapped off, and a plastic cover that slid away to reveal a drawstring. the drawstring had become severed after years of sliding over the bale that held the shades in the open position. The drawstring was a tough, finely braided, but small diameter cord. I took a sample of the drawstring to a craft store that sold DIY drapery supplies. They had something similar, but it was far to big to fit through the bale mechanism. Then I went to a big-box home improvement store - no dice. Where have I seen this stuff before? Fishing!

I went to a fishing supply store and showed them the cord and they said, "We've got something like that. It's a little thiner and if you don't mind the white and green color, it's 6 cents per foot".

"Yeah? Gimme a hundred feet then"!

I believe the stuff is called braided fishing line. I got a lot of it because:

a) it was cheap.
b) who knows when another shade will break?
c) it looked like really useful stuff to have at the workbench.


I pulled all the old string out of the shade. Holding the shade closed, I was easily able to thread the line through the honeycomb fabric using a rather large needle. I replaced all three lines, threaded them through the locking bale and re-hung the shade. I pulled the cord and the shade lifted smoothly and evenly. I snapped the cords to the left to latch the shade in the up position, released the cords, and the shade fell on windowsill with a bang. The cords were too thin for the locking bale! As a quick and dirty fix, I cut a strip of metal from a can and wrapped it through the bale to make it just a little thicker. I had to be careful that none of the rough edges would rub and abrade the strings. If I ever re-do this I'm going to cut some thin pieces of plastic and crazy-glue them inside the bale instead.

Now our honeycomb shades let the sun shine through again. I've used the fishing line on mini-blinds too, and even though the mechanism is quite different, I found it works quite well.

Saturday, February 25, 2012

Improving Battery Tester Accuracy

In earlier experiments I found that when powering the Arduino from USB, the battery voltage measurements were all over the place. This is because when the Arduino uses its power supply as the reference voltage for analog conversion, and the power supply isn't precise, neither is the analog measurement precise. It turns out USB power can vary +/-10% and still be in spec.

Accuracy can be improved by adding a reference voltage. I used an LM431Adjustable Precision Zener Shunt Regulator. By the way, when looking for spec sheets it's best to go to the manufacturer's site or to a vendor site, otherwise you may end up in the land of pop-up hell or you may run the risk opening malevolent PDFs.

Normally one would connect the reference output to Vref, but since my battery voltages are over over 2.5 volts, I connected it to one of the analog inputs such as A0.

I then applied the measured reference voltage as a correction factor to each measurement.

batt01 = (float)a1 * 2.5 / (float)a0;

This resulted in much more stable measurements, but unfortunately it didn't improve the repeatably. I repeated charged and discharged the batteries and although some generalizations about each battery can be made, I doesn't seem like it will be possible to compare a battery from one set to a battery in another set. I want to be able to do this so I can regroup the batteries into better performing sets.

Better, but still not good enough. To be able to compare batteries from different sets I would need to see the discharge curve for each battery overlay itself in these test runs. Perhaps the problem is related to the charger. I'll try a different charger and repeat the experiment.

One final improvement I want to make is to the resolution of the graphed data. I'm rounding off the results to to two decimal places. The A-D converter has twice that resolution, so in the future I'll increase the output to three decimal places.

The source code for this project can be found on GitHub as usual.

Saturday, November 5, 2011

Yogurt Maker Part 1

We started building this yogurt maker.

We've completed the TTL controlled power switch and that seems like a pretty useful project by itself. Of course we had to hack the hack and redesign Chris Reilly's implementation to suit our needs and the parts we had on hand. We roughed out the design on paper. As great as CAD is, nothing beats a sheet of quad paper, a mechanical pencil, and a big eraser for your first few design iterations.

Next I went to a big box home supply store - there are no more hardware stores in our neighborhood - and found parts such as a junction box, a power socket and a cable clamp. Since it wasn't exactly what I needed, yet another design iteration was called for. The result was this:

And on the outside it looks like this. The cable plugs into the wall and that powers up the outlet on top. We'll plug the power supply for our microcontroller into that outlet. The microcontroller's ground, 5V power, and signal lines will plug into the connector on the left. The amber LED on top indicates 5V power. The red LED indicates that the signal line is high, and that the outlet on the bottom should be energized.
In the next installment I'll write about the microcontroller and sensors.

Tuesday, August 2, 2011

Taiko Synth - Phase 9 - Waveforms

Until now, the taiko drum pad was a simple piece of masonite on a stack of packing foam with some mouse mats on top. A single strike resulted in multiple signals and I suspected it was because of either the masonite resonating, or all the pieces bouncing up and down. I needed some instrumentation.

The first step was to tie the drum pad together in an attempt to hold all the pieces together. I cut a circular base from plywood, then used a hacksaw to cut the foam to match. The foam looks terribly jagged - I think it needed some kind of hot-wire cutter for that. I got some 1/4" shock-cord (at REI, this is what they call this bungee cord) and cord-stoppers (clips used to close up back-packs, etc), then I cut holes in the drum head, foam, and base through which to thread the shock-cord. The hardest part was punching holes in the foam and threading the cord through it. The drill won't cut; the foam just got all wrapped around the bit! Forcing a 1/4" rod through the foam worked pretty well, although it was sill nearly impossible to thread the shock cord through the foam. Once the shock cord was threaded and cinched up, I glued some 2x2s to the base so it didn't rock back and forth on the shock-cord and cord-stoppers underneath. I used Gorilla Glue, which is really strange stuff, attach the 2x2s. As it hardens it foams up like polyurethane and can be a big mess if you use too much. The last step was to attach the mouse mats to the top surface of the masonite with silicone rubber glue.

After all that, it was time to hook it up. I connected a mini stereo plug to the drum and plugged that into the input jack of a laptop running XOscope. This is a pretty neat program. The controls are pretty intuitive, but I'm not going to be able to get any useful amplitude data until I figure out some kind of calibration work-flow. The other thing I didn't do which I should have done was to put some protection on the inputs - I could have damaged the PC's audio circuit - or worse. Note to self: next time be more careful!


Here's a trace of a hard DON strike. Right click and open the graph a new tab to enbiggen it sufficiently. The green trace it the drum head and the blue trace is the rim. You can see that the green trace is clipped, but what I was looking for was how long it resonated for. This way I could know when to start listening for the next strike. The graph shows that the signal took about 75 mS to settle down.

The other thing we can determine is that the resonant frequency is 4/0.02125, or 188 Hz

What I see there is that the drum head needs more damping. I want a single bounce - like when you push down on the fender of your car to see if the shocks are shot.


Below is a plot of a softer strike; one that 's not clipped. From it we can obtain the damping coefficient Tau, or the time it takes for the sine wave component to decay to 0.27 times its origin amplitude. It looks like Tau is about 0.017 Seconds.

The other thing I see in this plot is cross-talk. Striking the center of the drum results in a signal on the rim sensors. Cross talk's roughly (0.25/3.5)*100% or 7% and that's not too bad.


Tapping on the rim shows a quite different crosstalk story. Here the cross talk is (0.5/1.2)*100% or 42%. Something will need to be done to improve this. I think I many need to cut a slot in the foam to separate the rim from the drum pad center, but I'm concerned that the remaining foam will be too thin to support the rim. Maybe the foam will need to be replaced by a stiffer elastomer.


From this base-line data, I'll be able to see if changes I make to the construction of the drum pad improve or worsen its performance.