By using SST liquid level sensor we can detect the level of liquid via TTL compatible push-pull output. This sensor part is covered with robust material, it allows us to install in limited area of sensing.
An optical liquid level sensor 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 round the tip to the phototransistor providing good optical coupling between the two. When the sensor’s tip is immersed in liquid, the infra-red light escapes from the tip causing a change in the amount of light at the photo-transistor which makes the output change state. (Source:SST Application note )
Position of Sensor
Arduino SST Liquid sensor Interface
Connect sensors Vcc and Gnd pins to the power pins of arduino and connect output pin of sensor to arduino digital pin 7. Make sure the position of sensor to sense the level of liquid.
Pin out of SST Liquid sensor
RED Vs
GREEN OUTPUT
BLUE 0V
https://www.sparkfun.com/products/13835
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); }
Arduino Code for sst liquid sensor from : https://gist.github.com/ShawnHymel/a7c6cd17f00dd10e4325f72f83842be1