CounterMoon

 

www.countermoon.org

 

 
(Or, "More fun things to do with Ubuntu")

   I have a 'life project', http://CounterMoon.org, where I'm building
a trailer in which I intend to spend the rest of my life on the road.
And ya just KNOW I'm not going there without Ubuntu Linux...

   So I'm working on the controls; there are questions that will
naturally arise while on the road:

   How much time is left on the batteries?
   How much 110V power am I pulling?
   Doesn't it seem [hot|cold] in here?

   Rather than blow thousands on an A/D card (and the expensive cabling
to get those values the length of the trailer without noise or loss) and
[shudder] using anything with Microsoft, I found the 1-wire system from
Maxim/Dallas Semiconductor.

   You start with Ubuntu, Feisty and Dapper both work. Then get a
handful of parts from http://Hobby-Boards.com that connect to your USB
or serial port, add the One-Wire FileSystem (OWFS), and start reading
values and writing to relays!  It's fun, challenging, and useful.
Cheap, too.

   The OWFS provides directories like /sys where you can read and write
to these devices as easily as reading and writing kernel parameters.
The code to check on things can be in anything you're comfortable with,
I chose Perl.

   Here's a clip:

 # Polling sensors

 # Interior ambient temperature
 $temp = &getvar("/var/1wire/10.BB434D010800/temperature");

 # Interior ambient relative humidity
 $humidity = &getvar("/var/1wire/26.AFBBA8000000/humidity");

 # Making changes
sub vent_fan

   Just turn on the fan (the relay for it) with: vent_fan(1).  Turn it
back off with vent_fan(0).

   We all like our systems; but at the end of the day they don't *do*
many things.  Here, we can direct the air conditioning to the warmer
rooms, turn on the sprinklers when they actually _need_ it, create
keypad locks, or turn on the dehumidifier on in the NOC when the server
room's steamy.

   Enjoy!

- --
 ------------------------------------------------------------------------
 Brian Fahrländer