Project tutorial

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.

  • 21,166 views
  • 16 comments
  • 41 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

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,985 views
  • 42 comments
  • 239 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,543 views
  • 95 comments
  • 672 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,298 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 195,878 views
  • 154 comments
  • 1,360 respects
Add projectSign up / Login