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.

  • 20,170 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

Lightpipe 7-Segment Display

Project tutorial by Brian Lough

  • 1,827 views
  • 3 comments
  • 6 respects

PENXZYL: Arduino 3-Axis Brush Plotter

Project showcase by Guiye Perez Bongiovanni

  • 3,928 views
  • 2 comments
  • 17 respects

Temperature Controlled Exhaust Fan

Project showcase by alan_dewindt

  • 1,143 views
  • 0 comments
  • 9 respects

MyRiver

Project tutorial by Andrei Florian

  • 8,808 views
  • 2 comments
  • 36 respects

Detecting Heart Rate with a Photoresistor

Project tutorial by 3 developers

  • 6,938 views
  • 3 comments
  • 19 respects

Arduino Hot Wheels Speed Track Part #1 - Prototype

Project in progress by Unexpected Maker

  • 145 views
  • 0 comments
  • 0 respects
Add projectSign up / Login