Description
The
VL53L0X is a new generation Time-of-Flight (ToF) laser-ranging module housed in
the smallest package on the market today, providing accurate distance
measurement whatever the target reflectances unlike conventional technologies.
It can measure absolute distances up to 2m, setting a new benchmark in ranging
performance levels, opening the door to various new applications.
The
VL53L0X integrates a leading-edge SPAD array (Single Photon Avalanche Diodes)
and embeds ST’s second generation FlightSenseTM patented
technology.
The VL53L0X’s 940nm VCSEL
emitter (Vertical Cavity Surface-Emitting Laser), is totally invisible to the
human eye, coupled with internal physical infrared filters, it enables longer
ranging distance, higher immunity to ambient light and better robustness to
cover-glass optical cross-talk.
Applications
1 User detection
for Personal Computers/ Laptops/Tablets and IoT (Energy saving).
2 Robotics (obstacle detection).
3 White goods
(hand detection in automatic faucets, soap dispensers etc...)
4 1D gesture
recognition.
5 Laser assisted Auto-Focus. Enhances and speeds-up
camera AF system performance, especially in difficult scenes (low light levels,
low contrast) or fast moving video mode.
Main Code :
#include <Wire.h>
|
#include <VL53L0X.h>
|
VL53L0X sensor;
|
// Uncomment this line to use long range mode. This
|
// increases the sensitivity of the sensor and extends its
|
// potential range, but increases the likelihood of getting
|
// an inaccurate reading because of reflections from objects
|
// other than the intended target. It works best in dark
|
// conditions.
|
//#define LONG_RANGE
|
// Uncomment ONE of these two lines to get
|
// - higher speed at the cost of lower accuracy OR
|
// - higher accuracy at the cost of lower speed
|
//#define HIGH_SPEED
|
//#define HIGH_ACCURACY
|
void setup()
|
{
|
Serial.begin(9600);
|
Wire.begin();
|
sensor.init();
|
sensor.setTimeout(500);
|
#if defined LONG_RANGE
|
// lower the
return signal rate limit (default is 0.25 MCPS)
|
sensor.setSignalRateLimit(0.1);
|
// increase
laser pulse periods (defaults are 14 and 10 PCLKs)
|
sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodPreRange,
18);
|
sensor.setVcselPulsePeriod(VL53L0X::VcselPeriodFinalRange,
14);
|
#endif
|
#if defined HIGH_SPEED
|
// reduce
timing budget to 20 ms (default is about 33 ms)
|
sensor.setMeasurementTimingBudget(20000);
|
#elif defined HIGH_ACCURACY
|
// increase
timing budget to 200 ms
|
sensor.setMeasurementTimingBudget(200000);
|
#endif
|
}
|
void loop()
|
{
|
Serial.print(sensor.readRangeSingleMillimeters());
|
if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }
|
Serial.println();
|
}
// Get more details :https://github.com/pololu/vl53l0x-arduino
|
No comments:
Post a Comment