Archives for the month of: July, 2012

The evapotron is coming along. Here’s what works: first, the junction box is done, and the control box is about 80% built. I’m still having trouble getting stuff to adhere sufficiently strongly to the inside of the control box, but there’s progress (clamps are the answer: let the glue set with everything really tight).

The voltage, reservoir level, and temperature sensors work fine. The flow sensor works in a wonky way, sometimes ok and sometimes it just stops (there must be some bad wiring somewhere, haven’t found it). The Arduino can switch the pump on and off. The operational state data and sensor data is logged to a SD card, and there’s an LCD display on the control box which gives whatever data we want.

In the control box, I need to shift the 12v power bus from the big screw-down versions (from which wires often escape) to wire snaps, but that’s mostly done. And I’m shifting the mount point for the Arduino, perf board, and voltmeter to the top where they’ll be way easier to work on. That’s an hour, broken up into several gluing and drilling sessions. But it solves the LCD mounting problem, which is a win.

The power circuit isn’t started yet, but it’s simple. There will be a relay for each battery and one for the charger, and that’s it.

And the current sensor from Sparkfun doesn’t do anything. I want it to tell me when the pump is running (which is different from when it’s switched on), and how much it draws. I’m not really sure even how to go about this one.

The software is pretty nearly done. The outstanding pieces are about harmonizing all the different elements, and that’s actually the easy part. Getting each piece to work has been a long road, though. Nearly there!

I got most of the pieces together today, and it looks pretty good.

The basic wiring is coming together. Each of the reservoir-side sensors (flow, depth, temperature) and the pump’s 12v power have leads that go to a junction box that will sit less than 2′ from the reservoir.

Tthe pump and sensors can be detached from the junction box for transport and testing. A cable runs from the junction to the control box about 5′ away.

All I did today was get the pump running with the Arduino switching it on and off. The only sensor in the circuit so far is the voltage monitor, which will be in the control box. Tomorrow I’ll integrate the sensors and set up the power control circuit. I hope to get it all configured in the enclosure. Moving fast now.



The liquid level sensor is a variable resistor, which means that it has different levels of resistance depending on the height of the liquid that surrounds it. The spec for the sensor is that it’s 2250Ω when there’s no liquid, 400Ω when the liquid is a foot (or 30 cm) high. But that’s +- 10%, which is a lot when you’re trying to measure depth: if the reading is 30cm, it could be 33cm or 27cm. In a 5gal bucket (with a radius of 14.6cm), +-10% could mean a difference of +-2 liters. Not good.

I put the sensor in the bucket and measured the analog reading at different heights. I got this table:

ar   dp
813  0.1
742 10.3
677 15.3
603 20.3
517 25.3
396 30.0

So when the liquid is 0.1cm deep, the Arduino’s analog reading is 813, and so forth. The relationship between the analog reading and depth is distinctly non-linear.

Many sites, including Adafruit in the product’s tutorial section, suggest that the right way to get the depth is by transforming the analog reading into the sensor’s resistance with this formula: resistance = R1/((1023/ar)-1), where R1 is the resistance of the pullup resistor (see here if you don’t know what I mean: I didn’t before I studied it), and ar is the analog reading. Knowing the resistance at the bucket’s full and empty, you can find any intermediate point linearly: proportion full = (max resistance – this resistance)/(max resistance – min resistance) — remember that we’re at max resistance when the bucket is empty.

Hmm, I thought, that estimate probably won’t get to a good linear approximation of this curve, but ok, let’s try it. I interpolated the points in the graph above four ways: first with a simple linear model dp~ar (blue); then with a 4th-degree polynomial dp~poly(ar,4) (black); then using the resistance in a linear way dp~res (yellow); then with the proportional approximation suggested above (purple).

Ok, the simple linear model with the untransformed analog reading is a total mess, discard it. The other three are more interesting. I think it’s curious that both the resistance models estimate intermediate values poorly. The polynomial with the untransformed analog readings definitely looks like the best fit. My plan is to estimate the depth for every value in the analog scale [0,1023], rounded to millimeters. I’ll copy that into an array in Sketch, then use the analog value as a lookup into the array. Lots of testing coming in the next few days, and I’ll post results if this approach goes awry.

This is an amazing piece of tech: it’s essentially a piece of waxed paper with a resistor in it. Dunk it in liquid. The resistance changes as the liquid level changes. Very cool.

But it’s seriously fragile, as the folks at Milone Tech who make it emphasize, and as the folks at Adafruit who sell it also emphasize. The tiny little leads that come from the strip won’t take soldering, and the net is full of many warnings not to bend it, fold it, and presumably, not to spindle or mutilate it.

Adafruit sells it with a little header into which the sensor’s leads fit. I puzzled over how to deal with this floppy, breakable tool. I heard online someone talking vaguely about mounting it, so I did.

I got a rigid plastic sheet from a crafts store, cut a piece 18″x3″, and used double-sided tape to attach the sensor to the plastic at the top of the sensor. I soldered wires to the header, covered the connections with heatshrink, and fit the header on the leads. I secured the header to the plastic with a bit of hot glue, and the leads to the plastic with duct tape and a little wrap of wire tie.

I’m really happy with the result. I can clamp the plastic to a 5 gal bucket (the container holding the liquid I plan to monitor), and movement in the leads as I move pieces around, connect them, etc., doesn’t perturb the header, let alone the sensor. The header, leads, double-sided tape, and duct tape should be above the liquid, but even so, they’re all pretty robust to water. Great! Now all I have to do is use it.

Project partner K and I worked on the actual coats part of the LED blinky coats in a couple of recent work sessions.

K opened the linings, and we put Gorilla Tape over all the points where the LEDs will poke through the lining and through the fur. Then we drilled (with a normal 1/2″ bit). Lots of drilling, 200 holes per coat x 3 coats.

Then we pushed the LEDs through the holes, and (not shown) taped the extra loops together to hold the LEDs tightly against the fur (they tend to dangle out).

The effect is great, though I haven’t managed to get the actual Arduino to work with the LEDs in place yet. There have been two more minor smoke release incidents. Debugging is proceeding.


The evapotron has evolved a complicated power, sensing, and control circuit. I’ll go into detail later, but for now, here are the constraints:

  • it has to contain 2 heavy lead-acid batteries, a charger, a power bus, 2 relays, and a panel with circuits + Arduino, and have an LCD readout through the top;
  • it has to take in 8x16ga cables on one side, and 2x16ga AC power lines on the other;
  • it should be weatherproof, seriously.

I got a big polycarbonate enclosure from Digikey. Great box, reasonable price, but DigiKey ripped me off on shipping, that was seriously uncool. I spent a lot of time thinking about how few cuts I could make through the box. Two cable outlets, ok, necessary, manageable with cable glands and silicone putty. But how to secure the big, unwieldy batteries to the enclosure?

I think that by making very small slits, I can zip-tie the batteries to the wall. This was the only solution that worked. I looked hard for ways to use adhesives of various kinds to secure the batteries and other pieces to the inside of the enclosure. The batteries are too heavy to be held by any adhesive, so I cut slits in the enclosure wall with a Dremel and ran a zip tie through.

I’ll clean it up with sandpaper and seal the slits with silicone before it goes live.

Here are the adhesive experiments.

The idea is that I’d adhere some kind of machine screw set in a rubber foot to the surface of the enclosure. Then I can mount a plastic plate on the screw. The busses, relays, circuits, and Arduino will all be mounted on removable panels so I can work on them outside the box.

For adhesives, I tried “Weld It,” cyanoacrylate (e.g., Krazy Glue), and plastic bond epoxy. “Weld It” failed instantly. Cyanoacrylate did a funny thing: it failed to bond rubber or plastic to the polycarbonate, but it made a very impressive bond between the head of the machine screw and polycarbonate. The epoxy (in addition to being a horrible mess to work with) made a weak bond between the rubber and the polycarbonate. Ok: solved, cyanoacrylate it is.

Here’s the current enclosure layout:

You can see the batteries held by the zip tie and by brackets that are glued to the enclosure wall. They’re removable by cutting the zip tie. Next to the battery is the charger, from which the AC connection will exit through the cable gland on that side. The plate on the floor of the enclosure holds the 12v/GND bus (white plastic+brass), the incredibly useful 5v switching regulator from Pololu, and the 5v/GND bus (wire snaps from Adafruit). The plate on the back wall will hold the circuits and Arduino. Missing is the LCD screen which will be glued to the top of the enclosure. Time to build it, but there’s never enough time.

The Arduino that drives the blinky coats’ LED strands needs a nice place to live. I decided on small polycarbonate boxes made by Pelican for cell phones, MP3 players, and other small devices.

The box comes with a very nice gasket/pad that’s formed to the bottom of the clamshell. Great, but takes too much space, so I cut it out, keeping the sealing gasket (the case won’t be weatherproof anyway because the 2 knob posts will not be well sealed, but it will keep most of the dust out). Here’s the layout, with wire snaps that will serve as a 5v GND power bus, the rotary selector with nifty LED dial, potentiometer knob, and voltmeter LED laid out was they will be.

Components from SparkFun and Adafruit, the ArduinoMega is from ElecFreaks.

A key part of the design is getting cables in and out of the enclosure. I’m using a small cable gland through which  our cables from the coat will come through (power: +12v/GND; 3 leads from strands; 2 leads from fabric switch). I’ve desoldered the power jack from the Arduino, we’ll solder new power cables (8.4v from the battery) directly to the board, but the jack is too big.

Next up: two more power buses for the strands, then building all the enclosures and wiring it up. If only I’d made more progress on the software…

It turns out that a 12v/5a battery, when inadvertently shorted through a breadboard, melts 26ga leads in less than a second. And creates very dramatic (if foul smelling) fumes. Good to know.

Here’s the filtration prototype. I’m thinking that we can mount the flow meter to the top of the lower bucket and then create something in the bottom of this bucket to hold the water pump in place.

Here is a video of the evaporator prototype. It is built out of 1/4 ” hardware cloth, a 26″ inverted sled and a ~4′ kiddie pool. It still needs some work on even dispersal of the water. Next we are going to try attaching some burlap to see if that helps get better surface coverage.