Mulitpoint level sensor

I'm designing a self draining cooler, that drains melted ice water.

I require a level sensor to measure a high and low level to operate a solenoid valve.

What recommendations do you guys/gals have for a multipoint sensor?

I were considering an ultrasonic sensor, but I suspect issues with the ice cubes.

Use an external "sight tube" at room temperature and use optical or capacitive level sensors to measure the water level.

you could use 2 digital sensors that detect water above another. The pump/valve should open if the highest one is triggered (The lower one already would be). The pump/valve should stop if the low sensor is not triggered any more.

In code you get something like this.

//
//    FILE: waterPump.ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.00
// PURPOSE: demo
//    DATE: 2016-01-30
//     URL: http://forum.arduino.cc/index.php?topic=375436.0
//
// Released to the public domain
//

const int valvePin = 4;
const int lowLevelPin = 5;
const int highLevelPin = 6;

int valveState = LOW;

void setup()
{
    Serial.begin(115200);
    Serial.println("__FILE__");

    pinMode(valvePin, OUTPUT);
    pinMode(lowLevelPin, INPUT);
    pinMode(highLevelPin, INPUT);
    digitalWrite(valvePin, LOW);
}

void loop()
{
    if (digitalRead(highLevelPin) == HIGH)
    {
        digitalWrite(valvePin, HIGH);
    }
    if (digitalRead(lowLevelPin) == LOW)
    {
        digitalWrite(valvePin, LOW);
    }
}

The reason to use two sensors is to prevent hysteresis and a rapid on/off switching at a certain level.

Can also be solved with one sensor and check e.g. once per minute. Then the pump/valve will not switch more often than once per minute.

//
//    FILE: waterPump.ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.01
// PURPOSE: demo
//    DATE: 2016-01-30
//     URL: http://forum.arduino.cc/index.php?topic=375436.0
//
// Released to the public domain
//

const int valvePin = 4;
const int levelPin = 5;
uint32_t lastMeasurement = 0UL;  // UL => unsigned long data type
uint32_t interval = 60000UL;


int valveState = LOW;

void setup()
{
    Serial.begin(115200);
    Serial.println("__FILE__");

    pinMode(valvePin, OUTPUT);
    pinMode(levelPin , INPUT);

    digitalWrite(valvePin, digitalRead(levelPin);
    lastMeasurement = millis();
}

void loop()
{
    if (millis() - lastMeasurement >= interval)
    {
      digitalWrite(valvePin, digitalRead(levelPin);
      lastMeasurement = millis();
    }

}

You can mix both to have a system that switch off as soon as possible but switches on only once per minute. That is left as an exercise.

kommander: What recommendations do you guys/gals have for a multipoint sensor?

How high is the electrical conductivity of the melted water? Where does the water come from? Is it pufified water? Or tap water? Or polluted rain water?

In case the water has enough conductivity, you simply could create multi-level probes with several electrodes hanging in the water.

One electrode at ground water level, and an additional electrode hanging at a height where you want to detect the water level.

With some resistors added to the circuit and analog readings you then could simply detect for each of the electrodes, if an electrode is hanging in the air (resistance = infinite) or in water (resistance less than infinite caused by conductivity of water).

Considering one of these

https://www.adafruit.com/products/464

What u guys think?

kommander: Considering one of these

https://www.adafruit.com/products/464

What u guys think?

I think you should answer Jurs questions first ...

kommander: What u guys think?

I never ever heard anything about a sensor like that.

So the only thing I can tell about, is that: Sounds interesting in case the water level is always in the range from 1 inch to 12 inches max.

I have purchased several of the eTape sensors. They are reliable and easy to use.
Tom

I would like to do a schematic of my circuit in Proteus.

Any suggestions on adding the etape level sensor?

Thanks