This non-contact liquid level switch can be triggered when the liquid level fall below the sensor attached to the outside surface of a non-metal container.

Unlike traditional liquid level sensors, it does not need to be immersed into liquid. So, in this way, liquid will not be contaminated and the life of the sensor will not be reduced so fast because of the contact between liquid and sensors.

The sensor is very sensitive and stable, and the output current is upto 100mA which can directly drive a relay.

You can use this switch to monitor the condition of your water machine or make a water-drinking reminder by attaching it to the surface of your cup.




Connection Diagram

The sponge should be attached with the container

Or you can **remove** the sponge

Do NOT have the sponge projected outwards



Please keep the container empty or keep the liquid level lower than the sensor installation place before supply power EVERY TIME.

This sensor has a power-on zero calibration. It will detect liquid level Zero position once it gains the power supply.

NOTE: The sponge is to make it flexible to use most of the glue or a doble sided tape on the sponge to stick it to the non-metal container, if your container is too thick (over 8mm), you can remove the sponge and use a proper glue/ tape to fix it on the container.

Sample Code

void setup(){
  //start serial connection
  pinMode(2, INPUT);
  pinMode(13, OUTPUT);

void loop(){
  //read the switch value into a variable
  int sensorVal = digitalRead(2);
  //print out the value of the liquid level
  if (sensorVal == HIGH) {
    digitalWrite(13, LOW);
  else {
    digitalWrite(13, HIGH);

Expected Results

Check the detection result


Q&A Some general Arduino Problems/FAQ/Tips
A For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Get Non-contact Liquid Level Switch from DFRobot Store or DFRobot Distributor.

Turn to the Top