The Pound On Dog Lake

on the Shore of Dog Lake, Ontario 


A Story of Data Monitoring and Too Much Time On My Hands

Background - we pump water from the lake into a 150 gallon tank up in the second floor.  This story started as a desire to know if we had enough water to take a shower or to do a load of laundry without having to climb up the stairs and looking at the water tank.  We also wanted to be able to fill the tank without constantly worrying about overfilling it (happened once, was kind of unpleasant, would be even more unpleasant now that the interior of the cabin is finished).  Thinking there must be a way, I looked on the web for options, and found devices for industrial devices that used ultrasonic sound to measure the depth of liquids in tanks.  Not wanting to spend the (excessive) money to purchase such a device, I then came across the Ping))) Ultrasonic Distance Sensor, put out by Parallax Inc., and available right down the road at my local Radio Shack for the reasonable price of $29.99.


One of my Pings))) - Actual size is about 2" across

To make the Ping))) work, I needed a little computer, so more research and I found the Arduino single board computer.  The Arduino website describes it as:

"Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments."  

The little fellows cost anywhere from $35 to $65, and since I once considered myself a fair programmer (back in the 70s), I gave it a shot.  The theory is that to determine the gallons, an ultrasonic sound (a ping) is sent, we time how long it takes to come back, and knowing the speed of sound, that time can be converted to inches, and knowing the distance to the bottom of the tank and the diameter of the tank, we can compute gallons.  The arduino community is very broad and very open, so in practice you find snippets of code here and there, make a few tweaks and poof you have a working system.  In this case, the Ping))) comes complete with examples of measuring distance, I just had to do the conversion to gallons.  So in early November, before the ice came to the lake, I took a Ping))) and an arduino up to camp and gave it a try in the water tank.  Accurate and consistent, the only problem was that there is a little led on the Ping))) that lights up when it sends a ping, and in a very dark Canadian cabin, it seemed like it was a bright strobe light.

So back in Ohio, I got serious about putting together a proper prototype, and immediately started expanding scope.  I found a ethernet daughter board that could be used as a web server - so I picked that as the display and input device vs. a few LEDs lighting up to show me the water level.  And a relay was added so I could turn the water pump on from the web page and shut it off when the tank was full.  I decided it would be nice to integrate it with the cabin power components to monitor battery levels and control the generator.  We always want to know temperatures, so I discovered "Dallas one-wire thermometers" - eight bucks or so apiece, and the arduino can interface to bunches of them.  Finally, we are considering a wind generator, so I hooked up a Inspeed Vortex Wind sensor to allow wind speed to be tracked.  At first I was kind of worried that I would max out the little computer, but I keep adding things and don't seem to be getting close to any limits.  Currently, the sketch (that's what arduino programs are called) is a bit over 1,000 lines of code, and compiles to 44K (out of the 256K available).  So I have a ways to go to fill it up.


The Arduino Mega with a breadboard with my prototype interfaces


The Dog Pound's Arduino Web Page, sized for a smartphone

So here's what it does today:

Check back in May 2012, when the system should be fully installed.  Who knows what it will have by then.

For the curious, here is the sketch (source code): Main program Ping Routines

Return to Home Page       Email Questions or Comments