Using a VL53L0X ranging sensor to make a short-range laser tape measure with an Arduino and Nokia 5110 display.
The VL53L0X is a very small Time-of-Flight (ToF) ranging sensor.
It is quite widely available as a module, including from Adafruit - see their information page.
For this project I'm taking the module for a test drive and building a short-range tape measure with an Arduino and Nokia 5110 display.
Robojax has a nice video on YouTube (and information page) that gives a good introduction to the chip and module:
There are a few board designs around, this is quite common. It squeezes everything including regulator into a very small form factor:
The VL53L0X module just needs power and I²C connections. Because the module has an onboard regulator, it can take either 3.3V or 5V from the Arduino.
The LaserTapeMeasure.ino sketch implements a simple tape measure with measurements displayed on a Nokia 5110 LCD.
Note: I first tried to use the Adafruit PCD8544 and GFX libraries, but that proved just too much for the mighty memory of the Atmega328.
Adafruit_VL53L0X_Customised.h is a slightly customised version
Adafruit_VL53L0X.h from the Adafruit library.
The change simply makes the
DeviceInfo instance variable public so I can use that data in the splash screen.
The startup screen actually prints the device name and version as reported by the VL53L0X chip itself:
Range-finding in action:
The effective range I'm seeing (with default settings) is from about 2cm to 50cm.
The device supports 4 different ranging profiles, including high accuracy and long range (up to 2m). I haven't investigated those yet - and they don't appear to be directly supported by the Adafruit_VL53L0X C++ interface class (requires going under the hood of the API).