views:

431

answers:

7

At work, we have one of those nasty communal urinals. There is no flush handle. Rather, it has a motion sensor that sometimes triggers when you stand in front of it and sometimes doesn't. When it triggers, a tank fills, which when full is used to flush the urinal.

In my many trips before this nastraption, I have pondered both what the algorithm is the box uses to determine when to turn on and what would be the optimal algorithm, in terms of conserving water while still maintaining a relatively pleasant urinal experience.

I'll share my answer once folks have had a chance to share their ideas.

A: 

I would guess the motion sensor is most likely not working correctly, and that it is supposed to flush after each visitor.

Jon B
+1  A: 

I would trigger on sense but use a slow fill in the hope that by the time it actually flushes, someone else has had a slash. This approach would minimise stinky stagnation and occasionally skip a flush cycle.

Peter Wone
+3  A: 

How do you know that it really isn't a camera that feeds its video to a bank of monitors in the basement where Milton triggers the flush when he sees you walk away from the urinal?

/me puts on his tin-foil hat

BoltBait
Actually, there IS a camera. But the urinal flush is triggered by facial recognition ... the more relieved you look, the more water is used to flush. Simple and effective! :)
steffenj
+15  A: 
OnUserEnter()
{
   if (UsersDetected == 0)
   {
      FirstDetectionTime = Now();
   }
   UsersDetected++;
   CurrentlyInUse = true;
}

OnUserExit()
{
  CurrentlyInUse = false;
  if (UsersDetected >= MaxUsersBetweenFlushes || 
         Now() - FirstDetectionTime > StinkInterval)
  {
     Flush();
  }
}

OnTimer()
{
   if (!CurrentlyInUse && 
          UsersDetected > 0 && 
          Now() - FirstDetectionTime > StinkInterval)
   {
      Flush();
   }
}

Flush()
{
   FlushTheUrinal();
   UsersDetected = 0;
}
Gerald
You are the wind beneath my wings.
EvilTeach
StinkInterval....well done :)
Chris Serra
A: 

At the risk of sounding Ludditish, I think the best solution is a handle. But that isn't the question. I would assume the mechanism is very simple. Someone moves in front of it, a count starts. When the count is fulfilled, the urinal is "primed". When the person moves away, the trigger is pulled, and the sensor turns off for an arbitrary amount of time (I don't think it has or needs any awareness of the act of flushing/tank-refilling).

Am I overthinking this?

MrBoJangles
handles spread germs
Steven A. Lowe
Also assumes that users aren't morons. Sadly there is considerable evidence that they are.
Peter Wone
At my high school in days of yore, the urinals flushed once an hour and there were no handles. Fairly startling if you happened to be using it at the time.
MrBoJangles
Eeeeeeew .... urinal handles! Eeuuuawwwww!!!
steffenj
There are still doorhandles, much dirtier. In fact the average kitchen sink contains more germs then the common toilet. Urine is the cleanest body fluid there is. Get over it.
WolfmanDragon
+2  A: 

The best water-conserving algorithm is a urinal without a handle and a broken sensor.

This seems to be the state of our urinal most of the time, so i suppose it has to be intentionally designed to do that in order to conserve precious drinking water.

steffenj
+1  A: 

The "parallel-processing" (aka "multi-user") urinals in our school always triggered a complete flush each time before the break bell rings and of course shortly after the "break-is-over" bell. Very simple and effective.

steffenj