Non-contact Capacitive Liquid Level Sensor Arduino Wiki - DFRobot


This is a non-contact liquid level sensor with status indicator and adjustable sensitivity. It can be used in liquid detection of non-metallic container or pipe(outer diameter>11mm), suitable for all types of detection of curved or flat surfaces, arcs, cylindrical containers or piping fluids. The status feedback of the sensor can be given in real-time. Besides that, the sensor comes with a 4pin sensor adaptor that can directly collect digital signal, convenient for connecting with Arduino or other main-controllers. This liquid level sensor can be widely used in liquid detection of a tank, water dispenser, etc.


Board Overview

Liquid Level Sensor with Cable Adapter Module

Sensor with adapter

Method for instal jumper cap of switch board

Connection DOWN is pull-down and connection UP is pull-up.

4pin Adapter Pinout

4P Adapter Pinout

Num Label Description
1(Left, Brown) VOUT Liquid Sensor Power Positive, +5V~+12V
2(Left, Blue) GND Liquid Sensor Power Negative
3(Left, Black) IO1 Liquid Sensor Forward/Backward output select
4(Left, Yellow) IO2 Liquid Sensor Level Signal Output
1(Right, Red) VIN Power Positive
2(Right, Black) GND Power Negative
3(Right, Blue) IO1 Liquid Sensor Forward/Backward output select
4(Right, Green) IO2 Liquid Level Signal Output

Dimensional Drawing

Dimensional Drawing

Liquid level detection of flat non-metal container

Dimensional Drawing

Sensitivity Adjustment

Sensitivity Adjustment

Use a screwdriver to rotate the sensitivity knob(on the right of the sensor) anti-clockwise to increase the sensitivity; rotate clockwise to decrease it.



Arduino Debug

The liquid level sensor will output high/low level to determine the liquid level of a container, and its status can be checked via serial monitor.

Connection Diagram

Connection Diagram

Sample Code

 * @File  DFRobot_LevelSensor.ino
 * @brief  Detecting the liquid level of non-metallic containers,and check the status of sensor through serial port
 * @copyright  Copyright (c) 2010 DFRobot Co.Ltd (
 * @licence  The MIT License (MIT)
 * @author  [liunian](
 * @version  V1.0
 * @date  2020-08-13
int inPin = 8;
boolean running = 0;//when running=1, the liquid is detected, print out 1, otherwise, print out 0; running=0, the liquid is detected, print out 0, otherwise, print out 1.
int modePin = 9;

void setup()
  pinMode(inPin, INPUT);
  pinMode(modePin, OUTPUT);
  digitalWrite(modePin, running);

void loop()

Function: when running=1, the liquid is detected, print out 1, otherwise, print out 0; running=0, the liquid is detected, print out 0, otherwise, print out 1.

Expected Results



  1. The liquid level sensor doesn't work when powered on (the indicator keeps off when the liquid level reached the sensing point, and it has no response to the sensitivity adjustment.).
    1) The sensor may not be in a good connection with the power source, please check the power connection.
    2) The power cable may be reversely connected, please check it.
    3) The power module is broken, change the power module and try again.
    4) The sensitivity may be too low, increase the sensitivity to a suitbale value.

  2. The indicator keeps on all the time.
    1) The sensitivity is too high, please adjust it to a suitabe value.
    2) The init parameter is revised abnormally, in this case the sensor needs to be returned to the factory for restarting init.
    3) There are impurities or other metal objects contacted with the sensor closely, please clean the sensor and keep it away from any metal objects.

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents