当前位置:网站首页>VL53L0X V2 laser ranging sensor collects distance data serial output
VL53L0X V2 laser ranging sensor collects distance data serial output
2022-08-03 10:03:00 【Optimal electronic letter】
一、简介
The laser ranging sensor module has low power consumption,体积小,安装方便.It is based on infraredLED发光,照射到被测物体后,返回光经过MCU接收,MCUCalculate the time difference to get the distance,直接输出距离值.
VL53LOXis a new generation of fully integrated sensors,Equipped with embedded infrared、Eye-safe laser,Advanced filters and arrays for ultrafast photon detection,longer measuring distance,Higher speed and precision.
The sensing capability of the laser ranging sensor can support various functions,Gesture sensing or proximity detection including various innovative user interfaces,扫地机器人、Obstacle detection and collision avoidance systems for service robots,Home appliance induction panel、User presence detection or power switch monitor for laptops,As well as drones and IoT products, etc.
VL53LOX进行IICDescription of the mailing address
VL53LOX读写说明
引脚说明
名称 | 描述 |
---|---|
VIN | 电源3~5V |
GND | 接地 |
SCL | IIIC串行时钟线 |
SDA | IIC串行数据线 |
GPIO1 | 中断 |
XSHUT | 复位 |
二、使用前准备
VL53L0X V2激光测距模块 激光测距传感器 ToF飞行时间测距 | 1个 |
---|---|
原装正版Arduino uno r3开发板 | 1个 |
USB2.0打印机数据线高速方口连接转接线 A公对B公 | 1条 |
杜邦线 | 若干 |
三、测试方法
用USB2.0打印机数据线高速方口连接转接线与Arduino uno r3开发板连接在一起.Arduino uno r3开发板和VL53L0X V2Laser ranging module connection,如下图所示
接线
5V —— VCC
GND —— GND
SCL —— SCL
SDA —— SDA
安装Arduino IDE,打开ArduinoIDE,先安装【IRremote】库,点击【项目】,再点击【新建】,输入代码,如下图所示
最后点击上传,如下图所示
代码如下:
/* This example shows how to get single-shot range measurements from the VL53L0X. The sensor can optionally be configured with different ranging profiles, as described in the VL53L0X API user manual, to get better performance for a certain application. This code is based on the four "SingleRanging" examples in the VL53L0X API. The range readings are in units of mm. */
#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();
}
四、实验现象
程序下载进去之后,显示测量的距离78mm.
总结
注意事项
(1)波特率要选择正确.
(2)要先安装【VL53L0X】库.
边栏推荐
- DOM0, DOM2, DOM3 events
- The simplest base64 image stream in js realizes automatic download
- Mysql OCP 72题
- SQL教程之递归 CTE Common Table Expression
- Flink Yarn Per Job - 创建启动Dispatcher RM JobManager
- MySQL中tinytext、text、mediumtext和longtext等各个类型详解[通俗易懂]
- 迅为IMX6开发板QT系统创建AP热点基于RTL8723交叉编译hostapd
- mysql 运行的时候 报错
- 2022最新整理软件测试常见面试题附答案
- mongodb服务启动失败_mongodb启动不了
猜你喜欢
随机推荐
cmd(命令行)操作或连接mysql数据库,以及创建数据库与表
MySql数据库索引优化
pixel手机升系统
MySQL中tinytext、text、mediumtext和longtext等各个类型详解[通俗易懂]
决策树和随机森林
面试突击71:GET 和 POST 有什么区别?
SQL试题
MySQL 主从切换步骤
milvus
Partition table (1)
ImportError: DLL load failed with error code -1073741795
Go Redis database operation
Promise 一: 基本问题
mysqldump导出提示:mysqldump [Warning] Using a password on the command line interface can be insecure
MYSQL 修改时区的几种方法
深度学习之 10 卷积神经网络1
10 Convolutional Neural Networks for Deep Learning 2
力扣递归训练
SQL教程之递归 CTE Common Table Expression
When deleting a folder, the error "Error ox80070091: The directory is not empty" is reported. How to solve it?