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.

  • 22,160 views
  • 16 comments
  • 42 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

Results

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.

Code

Schematics

Comments

Similar projects you might like

Distance Sensor and OLED

Project tutorial by javier muñoz sáez

  • 22,053 views
  • 22 comments
  • 65 respects

Using the MAX30100 wearable pulse sensor with Arduino

Project tutorial by Team Protocentral

  • 25,994 views
  • 6 comments
  • 18 respects

Arduino Mp3 player + Distance sensor = FUN

Project tutorial by javier muñoz sáez

  • 21,576 views
  • 23 comments
  • 46 respects

Getting started with IMU (6 DOF) motion sensor

Project tutorial by Aritro Mukherjee

  • 72,531 views
  • 19 comments
  • 42 respects

Sound Sensor Activated LEDs with LCD for Sound Level Data!

Project tutorial by Heathen_Hacks-v2

  • 1,410 views
  • 2 comments
  • 8 respects
Add projectSign up / Login