In robotics projects there are needs to detect obstacle such as a wall. The famous Roomba, for instance, has wall sensors that detects obstacles and thus prevents it from running into them. The earliest of these robots used a piece of spring-like wire/metal contact to act like a switch for object detection but they were eventually replaced by ultrasonic sensors. They cost a few ££s on eBay and we demonstrated them here. Now there are new sensors that can perform the same job – Time-of-flight Range Finder that measures the speed of light. In this post, we are going to show you how to put together an Arduino Time-of-Flight Range Finder.
The VL53L0X is the smallest packaged Time-of-Flight laser-ranging module and costs about £6. Breakout boards with the proper level converters and regulators can be bought off eBay for about £7. The VL53L0X has a range of up to 2m according to the datasheet and does not require any additional optics. Distance measurements from the VL53L0X can be read through a digital I²C interface. The VL53L0X precisely measures how long it takes for emitted pulses of infrared laser light to reach the nearest object and be reflected back to a detector making it a self-contained lidar system. The pulses of the infrared laser can be seen with a camera.
For this post, we decided to connect the sensor to an Arduino Nano and lucky for us, there are many libraries out there that make the programming a lot simpler. The most popular libraries are from Pololu and Adafruit.
After connecting the time-of-flight sensor to the Arduino and uploading the “continuous” example from the Pololu library, the readings in mm can be observed in Serial Monitor.
The Adafruit library and example is very similar to the Pololu example. The data is again displayed in the Serial Monitor.
With a basic circuit like this working, the possibilities and projects are endless. You could connect an LCD and have a distance measurement tool for less than £15. You could even make a burglar alarm that detects when someone walks pass or build a scanning LiDAR system.
If you have any questions or comments, please contact us at email@example.com