Skip to main content
Associate
August 5, 2026
Question

vl53l8cx motion detection

  • August 5, 2026
  • 5 replies
  • 60 views

When using a vl53l8cx configured for motion detection, which of the fields in the motion_indicator struct can I check to see if there was motion?

I understand that the motion[32] array has measurements but I'd like to be able to poll this infrequently and check if there was an event between these polls. Something like a motion_detected flag that latches?

 

Thanks!

5 replies

Associate II
August 5, 2026

The interrupt autostop feature is used to abort the ranging session during a measurement. By default, the sensor cannot be stopped during a measurement, because the frame measurements need to be completed. However, by using autostop, the frame measurements are aborted when an interrupt is triggered. The autostop feature is useful when it is combined with a detection threshold. When a target is detected, the current measurement is automatically aborted. Autostop can be used in a customer state machine to switch quickly to another sensor configuration. An interrupt autostop feature can be enabled by using the function vl53l8cx_set_detection_threshold_auto_stop(). After a measurement is aborted, it is recommended to stop the sensor by using the function vl53l8cx_stop_ranging()

For more questions, please refer to the Q&A documents

FAQ regarding smart presence detection - Technical note

 

ArcuAuthor
Associate
August 5, 2026

Thanks for your prompt response. I’ll take a look at SPD, however my question was about the motion detection plugin in the uld driver (v2.0.1) here: https://www.st.com/en/embedded-software/stsw-img040.html

What I’m hoping for is a way to reduce the polling frequency to the sensor (interrupts are not available on this revision or the design)

Thanks

Associate II
August 5, 2026

A guide for using the VL53L8CX, low-power, high-performance Time-of-Flight multizone ranging sensor - User manual

Please refer to the user manual for detaiel information. How about the reason to reduce the polling frequency? To reduce the power consumption or just limited by the MCU performance ?

ArcuAuthor
Associate
August 5, 2026

@db16122 the manual does not provide much information as to how to interpret the fields in the struct. That's my original question.

I'm trying to reduce polling frequency because this version of the design has a very congested I2C shared bus and it's causing issues.

 

Thanks

Associate II
August 6, 2026

If I2C is too busy while MCU is comparatively free, you can increase the I2C freq to maximum like 1000kHz.The polling freq is decided by microcontroller side, motion detected status is ready by the sensor. Maybe you can modify the polling freq to low and increase the I2C freq to maximum. This will give you more freedom I2C bus