Take the screws out!

Greenhouse Automation

We have a greenhouse that receives a lot of sun through south facing windows. The temperature can climb upwards of 100F even in the winter, which is certain to kill some plants. That heat cycling is probably bad for the structure as well. There was already a large exhaust fan installed when we bought the house, but it required manual control. In addition, there are 2 casement windows that had to be cranked open by hand when the exhaust fan was turned on. This meant that the greenhouse required constant supervision. It was time for some automation...

I looked at one or two commercial window motor kits that are on the market but they were quite expensive. Instead, here is what I acquired for the window motor retrofit:
- (2) Dayton gearmotors from servocity.com. Specs: 3.4rpm, 704 oz.in, 400ma (full load), part #2L005
- (2) 5/8 inch shaft couplers from McMaster
- (1) SparkFun Motor Driver 1A Dual TB6612FNG. This is a breakout board for a nice surface mounted Toshiba motor driver.

After removing the manual window cranks, I reduced the shaft diameter slightly by grinding off some of the splines with an angle grinder, and I flattened one side of each shaft for the set screws on the shaft couplers. While playing with the motors to see if they would work, I noticed that the window crank shafts don't rotate perfectly on their axis. The shaft couplers I am using are rigid, so this would place strain on the assembly if I rigidly mounted the motors. When testing, I was able to keep the motors in place with just one finger, so I fabricated a mounting system out of wood that just counters the torque of the motors while allowing the motors to move about as the imperfect window crank shaft rotates. The motors operate at a very slow speed, so this works great. I dug through my stash and found a pair of switches that were perfect for detecting when the windows were closed. I couldn't find a good place to mount limit switches to detect when the windows were fully open, but the gearmotors are consistent enough to just stop the motors after a set period of time. They re-synchronize every time they are closed and they hit the limit switch. Since these windows were not intended to be automated and will probably wear out quickly if they are operated frequently, the control system has to ensure that the windows do not move very often. It takes about two and a half minutes for the windows to open or close.

There is an industrial circulation fan to move air within the greenhouse. The two fans are switched with Crydom solid state relays. There is a 10K thermistor serving as the temperature sensor.
The controller is an Arduino board. I added switches so that the behavior could be manually overridden at the control panel.

Here's the code that is running on the Arduino.


The most complicated part was the window logic- keeping track of the states of the windows. The Arduino doesn't natively support parallel computing, so everything has to be written in a non-blocking fashion; in other words, you need to keep scanning all inputs while the motors are turned on. If you simply turn the motors on and sleep for the amount of time it takes to open the windows, the manual override switches, etc. will have no effect. Additionally, it has to recover gracefully from power outages and the like: if the windows are partially open and power is lost it must close the windows so that it knows how they are positioned before it can resume normal control. Basically what I lacked in window position sensor hardware had to be made up for with software. I wrote a simulator that ran on the PC to test my window control logic before potentially destroying the windows due to a bug.


It also took some time to develop a well-rounded control algorithm. The strategy for winter time heating is to close the windows when the temperature has dropped enough. This is a simple way to preserve as much heat as possible overnight, prevent excessive window actuation, and prevent the temperature from getting too high. The windows seem to cycle open and closed about once a day and the exhaust fan kicks on only when needed. Now we don't have to worry about it if we go on a trip somewhere.

I have several upgrades on the roadmap:
- logging over ethernet
- try to PWM the fans for variable speed (this would be good for efficient PID control)
- add an actuator to the sliding door that separates the rest of the house so that the house can be automatically heated in the winter

The system has been working for 4 years, and the plants are much happier than before. We even produced bananas!


Bug Bed

You can't take the screws out if there are no screws.

This started out as a simple idea. We needed a bed frame.

After tossing around couple of ideas, we settled on the "zen" design. It would use one single type of material, with no screws, glue, or fasteners of any kind. It would be made up of interlocking parts that just slot together. Very simple, very solid. The entire bed would be made from sheets of plywood.

First a small scale model was built out of cardboard. With that, a set of detailed drawings was made to scale. Then a partial prototype was built out of standard 1/2 inch plywood to learn a few things about the design and the building process. This led to a few tweaks to the drawings, and the decision to use printed paper templates for all of the jigsaw cuts due to the precision needed. We're not talking about machine shop quality where you are down to the thousandth of an inch, but more like 1/32 of an inch, which is still a lot to ask from average woodworking tools. Look at the tip of a used pencil. Just how wide is that pencil line that you are drawing?

Then there was the plywood selection... after looking at some nice Walnut veneer sheets, we discovered Columbia PureBond, and found a local lumberyard that carries it. Columbia PureBond is a high quality formaldehyde-free plywood that is offered with a variety of veneers, which is nice for indoor use. We selected 2 sheets of 3/4" Birch veneer plywood for the top, and 2 sheets of 3/4" Red Alder veneer plywood for the frame.

Next the paper templates were created and printed: 6 "left" claws, 6 "right" claws, 8 "down" slots, 8 "up" slots, the nubs that stick up, 20 holes for the top, plus eyeballs and toes. A plotter or wide carriage printer would have saved a lot of time. Even better would be a nice laser cutter, or CNC router table.

With the wood selected and the paper templates ready, the actual fabrication began. First the large pieces of plywood were cut down to size and the paper templates were applied directly to the wood with spray adhesive and tape. Then the jigsaw work began. Claw one, claw two, oh my god claw three, claw four, someone kill me now I have visions of claws dancing in my head. The rest of the features were cut out with the combination of the table saw, jig saw, and drill. There were 12 claws to cut out, and that sure was tedious. I kept thinking a laser cutter would make such quick work of this. But no laser cutter appeared. It was very boring, repetitive, labor intensive work; the kind of thing that would be perfect for a machine. After the cutting was done, it was time for some sanding.

Things got exciting when it finally came time to see if the parts fit together. This was when all that careful and tedious work paid off. The slots were deliberately cut a little bit tight, so some filing was needed to get everything to fit perfectly. It didn't take long before the parts fit together snugly while being easy to assemble and disassemble. We sat back and stared at it for a while. Wow, it all fit.

A coat of pure tung oil was applied next, which was a great way to finish the wood. I just love the stuff; it's nice to work with, and it looks great. The whole place will smell like nuts when you are done (for days), but that's way better than petroleum based stains or polyurethane.

The bed is extremely solid, and it looks awesome. It is also very easy to move.

Soil Moisture

I tried making soil moisture sensors out of gypsum (plaster of paris) for an automated plant watering system. They worked ok for a while but I ran into a problem with electrolysis that caused bad readings. I think the circuit should not be continuously active, or at least not DC. Otherwise it looks like a promising way to make cheap soil moisture sensors to optimize water use.

Solar Heating

I built a solar thermal (hot air) heating panel. It was a total failure as a "thing" but it was an excellent learning experience. The first iteration melted the foam insulation (the power of 1000W/m^2 is no joke):

I used better materials for the second iteration. It heated the small house pretty well during the day but smelled bad due to overheating of the weatherstripping. The control system was really simple, just a photovoltaic panel that powered up the fans at pretty much the same time the panel started producing hot air.

We moved and I recycled the materials, but if I build another one, it will just have a black colored metal outer layer instead of glass and it will be relatively thin. This should make it much more durable, cheaper to build, and have no bad fumes. I think direct solar hot air heating makes a lot of sense.

Tesla Coil

Low Power File Servers

One morning I had an idea for the perfect fileserver.

I did some research looking for a ready made solution, but I didn't find anything that quite met my requirements... which was a perfect excuse to have some fun.

My fileserver goals:
- Reliability, low maintenance
- Low power consumption
- Silent
- Easy to back up the data
- Access to the files from various client platforms


Case, power supply, and doodads:
The power supply was easy- I snagged a picoPSU power supply with external power adapter brick. The power supply is the size of an ATX power supply connector and plugs right into the mobo- less wires! It was a tight fit though and I had to bend one of the mobo capacitors out of the way. The external power brick keeps some heat from even entering the case in the first place. I looked online for a decent case, and didn't come up with anything I liked, plus most of the decent cases were $100+. So I went to the Boulder Army and Navy store and got a used ammo box for $7.50. I have plenty of switches and LEDs to use, so the little case doodads were not a problem. I picked the smallest ammo box I saw at the store, and I got really lucky because it was just barely big enough for the mobo.

Air supply:
I wanted this thing to be really quiet and low maintenance, so I decided I would install a quiet intake fan with an air filter. This setup would produce positive pressure inside the box so that all incoming air has to pass through the air filter, plus the air filter would help to muffle the fan noise. Originally I wanted to buy an automotive air filter, but there was just no room for anything like that. I ended up making a trip to McGuckins (the best hardware store in the world) for a little bit of foam. This foam was attached with zip-ties to a piece of plastic that was intended for keeping leaves out of roof gutters. The fan is not very powerful, so it was important to have a large filter surface. There is about a 3/4 inch gap between the filter element and the fan intake, so the air is sucked through the filter very evenly. The fan I used is a 80mm Panaflow unit. I used a hole saw to cut a hole for the fan in a piece of Masonite. After getting that all set up, I used the gutter stuff as a template for drilling lots of holes in the side of the case for ventilation.

On the subject of cooling, I had a dilemma... do I mount the hard drive on rubber mounts to keep the noise level down, or do I put it in direct contact with the case to passively move the heat right out of the case?? In the end I opted to get rid of the heat to increase reliability. I used an old set of drive rails (mildly altered) to mount the hard drive so that the top of the drive was pressed right up against the metal case. I also slathered some thermal compound on the top of the drive to aid with heat transfer.

Rather than cut a huge rectangular hole in the case for the ATX-style connectors, we used extension cables. The only connectors that are needed are keyboard, VGA, network, and USB. Each cable is 6 feet long and runs from the mobo, out through a slot that was cut in the case. This worked out really well. I just had to hack away some of the strain relief stuff on the ends of a couple of the cables to get them to fit inside the case.

And all this stuff just barely squeezed inside the case! There's enough room left over for proper airflow and that's it. Just the way I like it. Computer hardware will only get smaller, so I expect that I will be able to squeeze several servers into this case within a few years.

The case will only be opened for a few possible reasons:
- Air filter cleaning - no screws to take out, just pop open the case and slide the filter out
- Hard drive upgrade
- If someone lets the smoke out of one of the parts

As a bonus, the case has a nice handle on it, so if we find our place on fire in the middle of the night, we can just grab the server by the handle and run!!

Software installation:
With just 1GB of room on the flash drive, I squeezed FreeBSD on there without too much trouble. I kept it to a very minimal install; no man pages, and just the basic stuff such as sshd, Samba, Subversion, NFS, and ports. Ports actually took up too much room, but I was able to move them to the data drive and still use them. The machine actually has 193MB free on the system drive, so it worked out great. However, I would recommend 2GB to anyone who wants to duplicate this setup because it will save some time shuffling files around.

This machine sits idle most of the time, so I'm really only interested in the idle statistics. The heat was measured with an infrared pyrometer, and the current draw was measured with a Killawatt.
- Maximum heat above the hard drive when idle = 93.3 degrees F
- Maximum heat at the exhaust when idle = 103 degrees F
- Power consumption when idle = 23 watts

Based on our current cost per kilowatt-hour, the energy cost for the old server was $70 per year. The energy cost for the new server is $22 per year. So every year, this new machine saves us $48 in energy costs. The machine cost about $400, and we ran it 4 years before it was upgraded to Version 2. This puts the net hardware cost at about $50 per year. The many benefits of this setup are well worth that expense.

Power outages are less of a problem since it will run longer on UPS power.

Parts list:
Most parts were purchased from Logic Supply. The hard drive and cables were purchased from NewEgg.
- Mainboard: VIA EPIA LN10000EG Mini-ITX
- Memory: 1GB DDR2 533 RAM
- System drive: Emphase 1GB 40-pin Industrial Flash Disk Module
- Data drive: Western Digital WD10EADS 1TB
- Power supply: PicoPSU 80W DC-DC Power Converter
- Power adapter: 12V DC, 80W
- Cables: 6 foot extensions (keyboard, video, USB), network cable, SATA data cable, SATA power converter cable
- Doodads: Momentary power switch, 2 panel mount LEDs, surplus ammo box, fan, filter element, plastic gutter cover, masonite


Version 1 was great. The bar was higher for Version 2.

I got an Intel branded MiniITX board. This is not actually made by Intel and it was nearly impossible to set up because the video didn't work correctly. One thing that was nice was that the motherboard has the power supply built-in, so that's one less component to buy. It also has an Intel gigabit network adapter. It boots from USB thumb drive and has a single 2TB Samsung disk.

Aside from the performance upgrade, it's also using ZFS, which is such a great filesystem I'm just blown away every time I think about it.

This one only uses 19 watts and delivers 80MB/second transfers over the LAN.

Parts list:
- Intel DN2800MT Marshalltown Mainboard
- SAMSUNG EcoGreen F4 HD204UI 2TB
- Crucial 8GB (2 x 4GB) 204-Pin DDR3 SO-DIMM DDR3 1066 (PC3 8500)
- 140mm fan
- 16GB Corsair USB drive
- 12v power brick
- slightly larger ammo box


For the next version, I'm hoping to use SSD drives which will get the power consumption down to just over 10 watts, and may allow for passive cooling.

Knife Block

Ski Sled


I made the brightest dirtbike headlight I have ever seen. It uses two bixenon (high/low beam) HID projectors. Someone I was riding with at night remarked "my headlight is awesome, yours is unbelievable!"

Shoe Bench

We needed a place to store shoes, and we also wanted a place to be able to sit down and take off/put on the shoes. Thus, the shoebench was born. It's nothing fancy, but it's very strong and highly functional. It is also made out of mostly scrap wood- the front, sides, and shelf are solid oak; the top and bottom are birch plywood, and the back is red alder plywood. All cutting was done on a tablesaw. It's held together with screws and finished with a combination of Tung oil and polycrylic.

Cat Ladder

Cat Deterrent

We have a couple of nice little motion sensor units that are called StayAway, which sit atop cans of R134A and spray a little puff of it out when activated. They are useful for keeping cats off countertops... but they are not enough to stop our cats from chowing down on plants. However, they are easy to modify. They contain a 5v solenoid valve that controls the spraying, and there is enough current delivered to the solenoid to power a small 5v relay in addition to the solenoid. This in turn allows you to power much larger devices, such as a water pump. Just a suggestion. The wires for the auxiliary relay can be soldered right to the solenoid connections, shown in red. Easy and effective.

TP Sentinel

The intersection of cat psychology and technology.

We had a serious problem with the cats. The problem was that they would reduce entire rolls of toilet paper to confetti that was then scattered all over the bathroom. This usually happened overnight, so we had to be very careful about locking away the TP at night. When we forgot, we always found the remnants of a great drunken cat party in the morning. I'm talking about the entire roll shredded into tiny pieces. For a creature of the darkness, the TP is mystical treasure to be plundered by night.

Finally we had enough. I rigged up a switch to act as a trigger so that when the toilet paper roll was pushed towards the wall, the switch would close. This was wired to a 12 volt pump that was intended for medical use. The pump drew from a small plastic reservoir and released twin streams of liquid hot magma or water through a nozzle made from aluminum sheet metal. The nozzle was pointed directly where the cat should be standing when it messes with the TP.

I first baited the trap with half a roll (hedging my bets) and went to sleep laughing out loud. In the morning I came downstairs to see the damage- a couple of squares had been unrolled and there were two holes in the paper. I know what you're thinking. Did he fire six ounces of water or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a medical pump, the most powerful pump in the world, and would blow your head clean off, you've got to ask yourself one question: Do I feel lucky? Well, do ya, punk? On the floor was a trail of water ending right at the spot the cat must have been standing.

The setup was removed after a few days and there have been no more attempts to plunder the TP, years later. Winning.

Price Per Gig

I wrote this little Greasemonkey script to show the unit price for hard drives and memory on Newegg's site. It saves a lot of time if you're shopping for a good deal on total capacity. You must have Greasemonkey installed.
Click here to install the script.

Cat Automation

You may be picturing robotic cats, but this setup dispenses fresh water for the cats at regular intervals, several times a day. Sorry to disappoint.

It uses 2 Potter & Brumfield (Tyco) CNT series timer relays, an ASCO soft-close 8221G001 normally closed solenoid valve, a Wiegmann 4"x12" wiring trough, a nice little 12v power supply, some Smurf Tube, and a few other doodads. The soft-close valve does a good job of avoiding water hammer when it closes. I really like these relays, they seem like industrial quality, are very easy to set up, and offer many timing possibilities. The Wiegmann box came brand new with broken spot welds, had super sharp edges, and had to be cleaned inside and out, but it did the job.

One relay is set up to close at a timed interval. When it closes, it activates the other relay, which turns on the valve for 38 seconds (that's the amount of time it takes to replace all the water in the big cat bowl). The cat bowl sits in a sink and the faucet is left turned on. There is a manual override so that the sink can be used as a normal sink.