Project tutorial
Liquid Level Sensing Using a Laser ToF Sensor

Liquid Level Sensing Using a Laser ToF Sensor © CC BY-SA

We connect a VL53L0X Laser time-of-flight sensor to an Arduino to measure the liquid level in a tank using ToF ranging.

  • 52 respects

Components and supplies

Apps and online services

About this project

Liquid level measurement is a common technique in several industrial as well as domestic applications (to measure water level in a tank). This is usually done using a probe dipped in the liquid and measuring the conductivity between them. This conductivity is usually measured by the resistance change because of the water level change. This type of sensor is shown in the following picture:

The other way to sense level (usually full level) for applications such as motor cut-off when the water tank becomes full, is to use a float-based sensor which shut's off the flow mechanically. These are usually clunky, mechanical devices and can detect only when the tank is full.

Why we couldn't use these

For the particular application that we were working on, we could not physically put anything inside the barrel because of the nature of the liquid. This is also the case if what you're measuring is food. Getting food grade sensors and keeping up the food safety standards could be a challenge.

A non-invasive, non-contact way of sensing the liquid level in the tank seemed to be the best approach. In this situation, the question of liquid contamination does not even come in to the picture.

How did we do it

ProtoCentral's Laser sensor breakout board contains the VL53L0X sensor from ST Microelectronics, that is a complete Laser-based time-of-flight ranging distance measurement sensor. The good thing about this device is that it can bounce invisible IR Laser light off of any surface and measure the time it takes for the light to reach the detector, which is also built into the device.

The maximum distance measurement range of the sensor is 2 meters, but we were still able to achieve a resolution of 2 mm of water level in the tank. The Laser ToF breakout board is connected to an Arduino-compatible board known as the ProtoFly from ProtoCentral, which has a built-in Bluetooth wireless module. Coupled with a Li-Ion battery pack, this is all set to go wireless.

This unit is mounted on the top of a tank into which water is pumped in with a small water pump.

This height data is then sent over wireless to a computer running a GUI based on processing. The processing applications measures and logs the water level data in real-time. Below is a video of the device and the software in action.

The Laser ToF liquid level sensor in action


Overall, we had a good experience of using a non-conventional way to measure water level in a tank. This sensor also provided a non-contact and more reliable way of measurement with very little interfacing work involved.

We will also make a Fritzing hook-up guide as soon as we can, but it is pretty straight-forward to connect this board to an Arduino, with all the code and libraries provided.




Similar projects you might like

Water Quality Monitoring and Notification System

Project showcase by emmanuel ani

  • 170 respects

Distance Sensor and OLED

Project tutorial by javier muñoz sáez

  • 88 respects

Arduino Mp3 player + Distance sensor = FUN

Project tutorial by javier muñoz sáez

  • 59 respects

Getting started with IMU (6 DOF) motion sensor

Project tutorial by Aritro Mukherjee

  • 63 respects

Using the YL-39 + YL-69 Soil Humidity Sensor with Arduino

Project tutorial by Sorin Trimbitas

  • 22 respects
Add projectSign up / Login