Lifeboat Farm


3D Printing Fly Traps
December 12, 2011, 3:18 pm
Filed under: 3D Printing, Garden, Technology

This is the third in what has turned into a three-part series on organic pest control (it’s just that time of year). The previous two posts were on organic wood lice control and white butterfly decoys.

Like most rural dwellers, we accept flies as part of life. Some years are worse than others but wet summers (like this one so far) seem to be very favourable to fly breeding.

We’ve had a few big fly traps over the years like the plastic lids you put on buckets and fill with bait. They work well, but can be a bit big and smelly to use too close to the house. I wanted to design a trap that was smaller, could be deployed nearer the house in larger numbers, and that used recycled materials if possible. It needed to be 3D printable and fit within the constraints of the build platform – 10x10x10cm.

After some messing about with various ideas, The bean can fly trap was born. In a nutshell, flies smell whatever bait and water you put in the can (a small piece of liver, or any offal works well), go in for a closer look, then find themselves trapped. They drown in the can and they in turn, become bait for more flies. The principle of fly behaviour the traps exploit is their drive to fly upwards to fresh air and light; they’ll just keep bumping up against the lid of the trap until they are exhausted and fall in the water.

The two parts of the trap are the lid that allows the flies to enter but not get out again, and a base that can be attached to the top of a fence post. Both parts friction-fit to the can. Most tin cans like this are the same dimensions the world over so it should work with almost any can.

Here are a few prototype traps in testing on top of one of our big traps. I played with various shapes and sizes of entry tunnels, and different vent slot sizes. Getting the flies into a trap was fairly easy if the bait was smelly enough. The harder part was keeping them in there. While we use wet bait to catch and kill the flies, I’ve heard from another user that they use dry bait to catch live flies to give to their pet frog. Either way, I’m happy with less flies in the world.

The plan now is to deploy these traps on fence posts all around the house to reduce the fly population through the Summer.

 

Advertisements


White butterfly decoys
December 8, 2011, 2:34 pm
Filed under: 3D Printing, Garden, Technology

The previous post about organic woodlice control touched on a couple of elements of pest control: trapping and physical separation of pest and plant. Another strategy that can work quite well is using environmental elements to confuse or deter pests. You can apply the principle to planting technique, by mixing up your plants to confuse pests (they don’t have to be too smart to find an acre of one crop). In this case I wanted to deter white butterflies from laying their eggs on our brassicas.

It turns out, white butterflies are quite territorial (or at least smart enough to know when to cut their losses). If a white butterfly sees other butterflies hovering around a target plant, they will move on to somewhere else to lay their eggs. You can use this behaviour to make decoy butterflies repellent to the real ones. People have used egg shells, white pebbles and even bread tags as decoys with mixed success.

My friend Vik had already created a model of a white butterfly and put it up on Thingiverse. All I had to do was download it and print one out.

While it was still hot from the printer I bent the wings up at a more realistic angle. A spare bit of filament melted and stuck to the bottom made a handy stalk to poke into the garden bed.

I printed a bunch (flock?) of butterflies and gave them some anatomical detail with a vivid marker before deploying them to the garden.

The stalks are quite flexible so the butterflies bob about in the wind. They look pretty realistic to me, but more importantly I’ve seen white butterflies hovering around, then leaving without touching down, all this week. Time will tell if any have the courage to sneak in to lay eggs.

If you don’t have a 3D printer, you could probably cut the same shape out of white plastic containers for much the same effect.



3D Printed coffee grinder part
December 6, 2011, 5:09 pm
Filed under: 3D Printing, Environment, Technology

My friend Eddie has a small coffee grinder that has given him many years of faithful service but a broken part has rendered it less useful than it could be. I’m not sure what the official term is, but I’ll call it the sweeper. It’s the part that sweeps the ground coffee out to the exit chute as it is ground. I thought I’d try to 3D print a replacement part.

3D Printing precision parts can be tricky as there are limitations when you are depositing layers of molten plastic on top of one another to make a part. Luckily, the most precise bit of this part is the brass hex bush, which I could re-use. I used the basic measurements of the broken sweeper to create a quick model in Google SketchUp. You can use any of the more complex (and expensive) design packages, but for 99% of the work I do, SketchUp works just fine (and it’s free).

Here’s the printed part, fresh off the Makerbot 3D Printer. It needs a few stray bits of filament trimmed, but otherwise ready to go.

Tidied up, with a quick sand and trim (you wouldn’t want any bits falling off into the coffee). The brass bush will just friction fit into the new sweeper.

And here’s the new sweeper installed and tested with some coffee grounds. The tolerance is pretty tight so as not to leave any coffee behind. I used ABS plastic for this print as it’s the most food-safe feedstock I have. It melts at 220 degrees Celsius so even if any bits do get into the coffee grounds, the extraction water wouldn’t be hot enough to melt it into the finished coffee.

And that’s it. One less appliance heading to the landfill for want of a single broken part. Best of all, now the part exists digitally, anyone who needs a spare can print their own. I’ll upload the part to Thingiverse on the off-chance someone else in the world needs one.



3D Printing replacement parts for a camera
June 30, 2011, 10:02 pm
Filed under: 3D Printing, Technology

My friend Eddie asked if I could print a replacement part for his old, but mostly useful Nikonos camera. Like so many consumer items we have, for the want of a single part or two, it could be almost as good as new. It needed a new knob to turn the film advance winder, and I noticed (after a web image search) it needed a new cover on the film winder assembly. Here’s the camera pre-repair:

The first thing I had to do was design the replacement part. After a quick measure I used Google Sketchup as a quick and easy tool for 3D design from scratch. This is how the film-advance knob looked after a couple of iterations.

Time to fire up the Makerbot and print out the part! I used PLA plastic for the first test prints, mainly because I have plenty of it, and it just happened to be in the machine at the time ๐Ÿ™‚

First prototype parts hot off the printer:

After two quick test prints and a few refinements to the design, I printed the final parts in shiny black ABS and fitted them to the camera. The winder cover on the left is super-glued on and the film-advance is attached with epoxy for a more robust join.



The finished Arduino wireless water sensor
June 20, 2011, 11:21 pm
Filed under: Technology, Water

Back at the end of 2009 I started playing about with an Arduino solution to monitor the water level in a water tank about 300m from the house. The tank isn’t visible from the house so a standard visual tank indicator wouldn’t work. In a nutshell, this sensor measures resistance through an array submerged in the tank to determine the water level, then sends that data back to a server in the house for humans to read. I covered the prototype and the first iteration of the sensor in this post.

There were a few more steps beyond the prototype required to make it really useful and along the way I discovered some issues with the first model which I’ve improved on, but that’s why you call it a prototype.

Here is the Arduino with an added WiFly shield – an add-on that gives the Arduino the ability to (mostly) seamlessly communicate over the farm’s existing 802.11 WiFi network. Arduino shields piggy-back on top of the board, and in this case the WiFly shield has a handy prototyping area – perfect for projects like this where you need to add a few components to a solution. The red and black leads you can see here connect to the water level sensor in the tank. The whole thing is mounted on an aluminium bracket I made up to fix it securely in the project box.

And here’s the whole assembly in the waterproof (IP66) project box. It’s designed to sit out in all weather, diligently saving me endless trips to the tank to manually check the water, so it needed a good enclosure. The battery taking up most of the box is a bog-standard sealed 12v motorcycle battery. I’ve tried to keep as many components as possible off-the-shelf to keep costs down and make future maintenance easy. The external antenna for the wifi is at the bottom left of the enclosure and the 4-way connector on the right is for signal from the sensor and solar power to come in.

The close up shows it’s a pretty snug fit in there. The Arduino is mounted on an angle so the USB port on the right hand side is accessible without unpacking everything. I learned from version one that there will always be lots of tweaking before it works well, so I wanted to make future software changes easy.

The enclosure mounted on a post just above the water tank. The 4-way connector makes it easy to connect up without taking the lid off (important if the weather is rubbish) or take the whole thing back to the workshop when I need to make physical changes.

The sensor array of resistors and an earth return wire lie inside the plastic pipe. The whole thing is submerged in the tank. Originally I had joined the string of resistors together with soldered nichrome wire but after a few months some corrosion (and what seemed to be electrolysis) was starting to look unsightly. I replaced the connections with plain light gauge insulated lead-out wire and it seems to be fine now. The sensor sends 5v DC through the water for a few milliseconds to take a reading so I don’t expect too many problems long term (the tank and all its fittings are plastic). The original post has photos of the array being built.

To power the sensor, I’ve used a 10W solar top-up charger with a built in charge controller. It’s a standard item from most automotive suppliers. At such low power it’s difficult to over charge a 12v battery but having the charge controller adds a bit more margin for error. This panel provides more than enough power to keep the battery topped up. The Arduino draws a tiny amount of power, but the WiFly shield does use a bit of power when it’s transmitting. The ideal angles for a solar panel are: facing due North (in the Southern hemisphere) and inclined to an angle from the horizontal equal to your latitude (about 42 degrees here). I had to cope with the curved surface of the water tank so it’s a best-guess effort.

The distance back to the house is over 300m. We have a fairly powerful wireless access point attached to the outside of the house so small wifi devices can connect to the network pretty easily if they have line of sight.

Back in the house, we can visualise the data, thanks to some great work on the server software from our friend Dave. Making this prettier and adding some smarts like alarms will be the next phase of this project.

The Arduino code is still a work in progress, but I’m more than happy to share it if anyone might find it useful. The software is quite modular so it can be fairly easily adapted for other sensors. We use it for several temperature sensors around the farm and I’m currently working on another sensor to record wind data at a remote site we are thinking about putting some wind turbines on.

Update November 2011 – Triumph!

After a few more tweaks to improve reliability and error tolerance I’m happy to publish the code. I’ve just started playing with Fritzing, so hopefully soon I can put up a proper schematic for the project.

While the sensor worked well most of the time, when you’re dealing with a device a long way from the house that needs to just work, “most of the time” isn’t quite good enough. The problems I had with the WiFly shield were the reliability of communications and recovery from errors.

The code supposedly resets the WiFly client for each data-gathering cycle, but every now and then (from 1 hour to 1 week) it would fail to initialise properly and hang. This would hang the Arduino entirely. From the research I did, and asking people smarter than me, it looked like the WiFly shield wasn’t properly shutting down or clearing its buffers. I’d noticed that it always worked first time, just after a power reset. To replicate that I connected the power to the WiFly shield via a small relay, controlled by the Arduino. Now I have the ability to cut power to the WiFly shield at the end of each data-collection cycle, and power it up each time. This seems to have solved the comms problems and has the added advantage of not wasting power on the WiFly shield between transmissions.

The second problem was the Wifly shield’s fairly fragile handling of errors. If for example, the wifi network or remote server were not available to connect to, the WiFly shield would hang. No retries, no resets, just hang. After much playing around I came across the documentation for the watchdog timer, that allows you to define a reset clock in the code that will reset the Arduino if certain points in the code aren’t reached in a timely manner (ie it has hung). So now, if for any reason, the WiFly can’t post data to the remote server, it resets and tries again (and will keep resetting until it has successfully completed a data post).

The basic function of the sensor is: Take sensor reading > join Wifi network > sent http GET request to remote server > wait >repeat

The Code:

It’s in three parts; the main .pde file, the settings file, and the water level reading function in it’s own file – just put all three in the same place. To use it you’d need to change any settings specific to server and wifi network settings to suit you. There is also a serial printout of the sensor data and comms status so you could easily modify the code to send data somewhere else, print to LCD, write to an SD card etc.

http://lifeboat.co.nz/arduino/sensor_water_working_v1.pde

http://lifeboat.co.nz/arduino/Settings.h

http://lifeboat.co.nz/arduino/water_gauge.pde

I appreciate this isn’t exactly a comprehensive how-to. This project (and documentation) has been evolving over a year and a half. If there’s interest I can put some time into making this more of an “instructible” to make replication a bit easier.

 

 



The Lifeboat Bookshelf
February 2, 2010, 12:17 am
Filed under: Technology, The House

We’ve been asked a few times to recommend reading lists to people so I thought it was about time we listed a few of our favourite books. We read a lot and this list are the ones we think are the most informative, inspiring or plain useful. I’ll add more books to the shelf as I think of them and get the time.

You can visit the Lifeboat Bookshelf here.



Arduino water level gauge
December 28, 2009, 2:16 pm
Filed under: Technology, Water

A couple of months back I was lucky enough to win an Arduino starter kit from the folk at Mindkits. With the Christmas break upon us we’ve finally had some time to get our first project underway – a wireless water tank level gauge.

Our main water tank for the farm is out of view of the house so a visual water level gauge wouldn’t be much use. Most of the time we can only tell when the tank is empty the hard way, although I’ve added some plumbing to the tank so we always have some water in reserve.

The first task was to find a simple, robust way of physically measuring the water level. I got an idea on this blog about using a string of resistors on a pole that short out below the water level, giving you a variable resistance that can be read by the arduino. In theory, all you needed was a long enough string of resistors running down a substrate, with a return path for the current.

waterlevel_circuit

Here’s Dave with the first prototype to prove the concept – resistors soldered together and hot-glued onto a piece of polybutylene plumbing pipe. There is a piece of nichrome wire hot-glued on the back to complete the circuit.

dave_prototype

Dave and I breadboarded this prototype and it worked! By worked, I mean we got varying numbers returned by the arduino as the gauge went up and down in the water. We still had to determine if the numbers meant anything, but I felt that part of the process sat more with Dave as the software guy than me as the fabricator ๐Ÿ™‚ The arduino is the little PCB attached to the blue USB cable.

prototype_small

The next step was a full-size prototype (although it will probably become the actual gauge). Once the tank was measured I cut some aluminium channel to length and mounted a longer piece of polybutylene down the channel. 20 1k resistors got soldered together and hot-glued down the length of the pipe. This should give us 5% increments of water level. I added cable ties as a backup to the hot glue in case the water in the tank made it too brittle to stay attached. In this picture you can see the leads attached for easier testing.

prototype_mounted

The final step in the prototyping was to take the contraption outside to a water tank near the house to test and calibrate the gauge in a real situation.The resistance varied as the gauge was submerged more or less in the water. We collected values at 0%, 25%, 50% and 100% submersion and the resistance values that came back are very close to a linear relationship (close enough to assume it’s our measuring that’s out). This means we can interpolate a fairly granular level ofย  water measurement from the resistance levels returned.

prototype_in_tank

There are a few more steps in the project now:

Wireless comms – we’re looking at using the farm’s existing 802.11 wireless network to send data from the gauge approx 200m back to the house.

Solar power – the arduino will happily run on 12v DC so a small solar cell and a car battery should keep it running 24/7

Software – Dave has volunteered to write a web app to present the data in a prettier form.

Phase 2: once we’ve got the gauge running well, we can look at future features that go beyond passive monitoring like alarms based on water level, auto-starting the water pump, calculating flow rate and tripping alarms or a shut-off servo if the flow is too high for too long (indicating a pipe break) – the possibilites are endless.