Main Content

VL53L0X Time of Flight Sensor

Measure distance to a target object

Since R2023a

Add-On Required: This feature requires the Simulink Coder Support Package for STMicroelectronics Nucleo Boards add-on.

  • VL53L0X Sensor

Libraries:
Simulink Coder Support Package for STMicroelectronics Nucleo Boards / Sensors

Description

The VL53L0X Time of Flight Sensor block measures the distance to a target object for a complete field of view (FOV = 25 degrees). This block also provides the option to select one of four ranging modes based on your requirements.

Note

XSHUT connection is required for VL53L0X sensor. Connect the XSHUT pin to vcc.

Ports

Output

expand all

The Distance port outputs the target object distance in millimeters

Data Types: uint16

Parameters

expand all

Specify the module on the board that you are using for I2C communication.

The I2C address of the VL53L0X sensor from which the block reads the values. You can configure this value. The range of I2C address is from 0x08 to 0x77.

Select the distance ranging mode for measuring the distance to the target object. The four ranging modes available are shown in this table.

Ranging modeTiming budgetTypical max rangeTypical application
Default30 ms1.2 mstandard
High accuracy200 ms2 mprecise measurement
Long range33 ms1.2 mlong ranging for dark conditions
High speed20 ms1.2 mhigh speed where accuracy is not priority

The timing budget is the time taken by the sensor to perform one range measurement.

Specify how often this block reads the data from the VL53L0X sensor. When you set this parameter to -1, Simulink® determines the best sample time for the block based on the block context within the model.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2023a