To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 10459
10458  |  10460
Subject: 
Basement water alarm
Newsgroups: 
lugnet.robotics
Date: 
Wed, 2 Feb 2000 21:40:41 GMT
Viewed: 
1734 times
  
Hi everyone,

I made my first practical Mindstorms invention
a couple of weeks ago. It's a water sensor
for my basement. There's a water pump on the
side of my furnace that takes condensed water
and spits it out the back of my house. In very
cold weather, the exit line freezes and the
water accumulates on my basement floor. I built
a simple water alarm to let me know if this
was about to happen.

First, I put a large bowl below the water pump
to catch overflowing condesation. I placed
two water sensors in the bowl, one low and
one high. If the high one senses water, the
alarm is immediately sounded. If the low
one senses water, the alarm is only sounded
if the time of day is between 8AM and midnight,
roughly my waking hours.

The water sensors are simply cut wire bricks,
such that one end snaps on to the RCX and the
other end is a pair of exposed wires. It acts
like a touch sensor: stick the wires in water
and the input reads 1.

The alarm itself is an old boombox with a
Guns 'n Roses tape in it, with the volume
cranked all the way up. To set off the alarm,
the RCX pushes the Play button on the boombox.

I used RCX 1.0, with the external power jack,
because I'm leaving the alarm on all the time.

Lessons learned:

1. The real world always does something
   unexpected. When the bowl starts to
   fill with water, my cats like to take
   a drink, which sometimes dislodges my
   water sensors. I need to build a sturdier
   support for them.

2. The RCX clock seems to lose time, roughly
   (very roughly) a half hour per week. Anyone
   else noticed this?

3. The Watch() command in NQC returns a count
   of minutes. The only documentation I could
   find said it returned hours in its upper
   byte and minutes in its lower, but I don't
   think this is right.

I've attached the source. The tasking is a little
weird, but it seems to work.

Jonathan

-----
task main() {
  SetSensor(SENSOR_1, SENSOR_TOUCH);
  SetSensor(SENSOR_2, SENSOR_TOUCH);

  start watchLow;
  start watchHigh;
}

// Morning time is 8am (8 * 60 + 0)
#define MORNING 480

task watchLow() {
  until (SENSOR_1 == 1 && Watch() > MORNING)
    ;
  start turnOnMusic;
}

task watchHigh() {
  until (SENSOR_2 == 1)
    ;
  start turnOnMusic;
}

task turnOnMusic() {
  Fwd(OUT_C);
  OnFor(OUT_C, 75);
  Rev(OUT_C);
  OnFor(OUT_C, 75);
  stop main;
}
-----



Message has 2 Replies:
  Re: Basement water alarm
 
Brian B. Alano writes: > > > 2. The RCX clock seems to lose time, roughly > > (very roughly) a half hour per week. Anyone > > else noticed this? > > > > > PC clocks tend to lose time as well. 10 minutes a day isn't unheard of. > 1/2 hour per week is (...) (25 years ago, 3-Feb-00, to lugnet.robotics)
  Re: Basement water alarm
 
Do you mean that my alarm clock follows the 60 Hz carrier? That confuses me-- I once programmed my Timex/Sinclair Z80 to be a clock based on the power line carrier. It kept terrible time. I assumed it was because of the inaccuracy of the carrier. (...) (25 years ago, 3-Feb-00, to lugnet.robotics)

4 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR