SST Liquid Level Sensor with Arduino

1,716 views

In order to control the depth of water and prevent it from overflowing in industry, measuring the level of liquid in deep tanks or water is necessary. The purpose of the level measurement is to determine the level of liquid at any moment and do the required operation accordingly. There are different ways to measure the liquid level, some sensors calculate the depth of liquid according to the pressure caused by the liquid’s specific gravity and the vertical distance to the surface. Some others emit ultrasonic waves from a transducer which also detects and measures the reflected waves to calculate the liquid depth. The sensor that we use here is Arduino-compatible and works on the basis of resistance measurements.

We have used an SST liquid level sensor, which can detect the level of the liquid via TTL-compatible push-pull output. This sensor part is covered with robust material, which allows us to install it in a limited area of sense.

Hardware Required

S.noComponentValueQty
1.SST Liquid Sensor1
2.Arduino Uno1
3.Connecting Wires

Working of SST Liquid Level Sensor

SST Sensing and Sparkfun recently developed an easy-to-use solution for single-point liquid detection using infrared technology. Here it uses an infra-red LED and phototransistor accurately positioned at the base of the sensor’s tip. When the tip is air, infra-red light reflects internally around the tip to the phototransistor providing good optical coupling between the two. When the sensor’s tip is immersed in liquid, the infrared light escapes from the tip causing a change in the amount of light at the photo-transistor. This change makes the output change state. SST offers the liquid level switch in a robust housing tip with either a Polysulfone or Trogamid construction (depending on the particular application requirements). The complete solution has an operational temperature range of –25°C to 80°C.

Arduino SST Liquid Sensor Interface

Here first connect sensors Vcc and GND pins to the power pins of Arduino and connect the output pin to Arduino digital pin 7. Now make sure the position of the sensor is perfect to sense the level of liquid.

Arduino Code

// Liquid level detection using an SST sensor
//
// When a liquid touches the tip of the sensor,
// an LED at pin 13 turns on.
// 
// Hardware:
//     Sensor    | Arduino
//  -------------|---------
//    Vs (RED)   |    5V
//   Out (GREEN) |   pin 7
//   GND (BLUE)  |    GND

// Pins
const int LIQUID_SENSOR_PIN = 7;
const int LED_PIN = 13;

void setup() { 
  pinMode(LIQUID_SENSOR_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);
}

void loop() {

  // Read sensor. If liquid touches the tip, the sensor will 
  // read 0V. Turn on LED if liquid is present.
  int isDry = digitalRead(LIQUID_SENSOR_PIN);
  if ( isDry ) {
    digitalWrite(LED_PIN, LOW);
  } else {
    digitalWrite(LED_PIN, HIGH);
  }

  delay(200);
}

Applications

SST liquid and gas sensors are used in various locations worldwide. From ensuring there is no oxygen present in aircraft fuel tanks to detecting rainwater in telecommunication cabinets. In household applications like detecting the water level inside aquariums.