Contents

Introduction

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.

Tutorial

Connection Diagram

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

Check the detection result

voidsetup(){//start serial connectionSerial.begin(9600);pinMode(2,INPUT);pinMode(13,OUTPUT);}voidloop(){//read the switch value into a variableintsensorVal=digitalRead(2);//print out the value of the liquid levelSerial.println(sensorVal);if(sensorVal==HIGH){digitalWrite(13,LOW);}else{digitalWrite(13,HIGH);}}