Skip to main content
Associate
July 29, 2025
Solved

External Trigger

  • July 29, 2025
  • 6 replies
  • 1969 views

Dear altruist, I need urgent help. Can I apply hardware-based external triggering in the VL53L8CX sensor by STM32 Nucleo F401RE? Will the sensor work for external triggering? Thank you

trisha2_0-1753810012377.jpeg

 

Best answer by Chris21

According to UM3109, A guide for using the VL53L8CX, low-power, high-performance Time-of-Flight multizone ranging sensor - User manual an external trigger source can be used to synchronize the Time-of-Flight (ToF) ranging acquisition: 

External synchronization pin
An external trigger source can be used to synchronize the ToF ranging acquisitions for applications where there may be interference concerns. Such interferences include multiple VL53L8CX devices or IR image sensors within close proximity, or any other electronics emitting 940 nm IR light. When the external synchronization is enabled, the SYNC pin is configured as an input and the VL53L8CX waits for a rising edge on the SYNC pin to start the next single ranging acquisition. To use this feature, the SYNC pin (B1) must be connected to an external trigger source as described in the product datasheet.

External synchronization is only available in autonomous mode. There are no specific timing requirements for using the external synchronization. However, the VL53L8CX ranging frequency should be set higher than the external trigger signal frequency to ensure that each ranging acquisition has completed prior to the next external trigger event. The timing of the synchronized single ranging acquisition period follows the integration time in autonomous mode, as defined by the user... 

6 replies

AScha.3
Super User
July 29, 2025

Hi,

i dont understand : > Will the sensor work for external triggering? <

->

The host customer application controls the VL53L8CX
using an application programming interface (API). The API implementation is delivered to the customer as a driver
(C code and reference Linux® driver). The driver provides the customer application with a set of high level
functions that allow control of the VL53L8CX firmware. This includes control of items such as device initialization,
ranging start/stop, and mode select.

So...you use the API ? or what then ?

connection to cpu:

AScha3_0-1753824307980.png

>Can I apply hardware-based external triggering

sync IN ?  Why not ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
trisha-2Author
Associate
September 9, 2025

Thanks for your response. But the VL53L8CX sensor doesn't have a sync IN pin; there are GPIO1 and GPIO2 pins. Thus, instead of the SYNC pin, I made GPIO 1 an input. Then I tried to debug the sensor for external triggering in autonomous mode, but it didn't work. 
I had applied the command below and made the necessary changes. 
// Enable external sync pin
status |= vl53l8cx_set_external_sync_pin_enable(&(pL5obj->Dev), 1);

Chris21
Chris21Best answer
Associate II
July 29, 2025

According to UM3109, A guide for using the VL53L8CX, low-power, high-performance Time-of-Flight multizone ranging sensor - User manual an external trigger source can be used to synchronize the Time-of-Flight (ToF) ranging acquisition: 

External synchronization pin
An external trigger source can be used to synchronize the ToF ranging acquisitions for applications where there may be interference concerns. Such interferences include multiple VL53L8CX devices or IR image sensors within close proximity, or any other electronics emitting 940 nm IR light. When the external synchronization is enabled, the SYNC pin is configured as an input and the VL53L8CX waits for a rising edge on the SYNC pin to start the next single ranging acquisition. To use this feature, the SYNC pin (B1) must be connected to an external trigger source as described in the product datasheet.

External synchronization is only available in autonomous mode. There are no specific timing requirements for using the external synchronization. However, the VL53L8CX ranging frequency should be set higher than the external trigger signal frequency to ensure that each ranging acquisition has completed prior to the next external trigger event. The timing of the synchronized single ranging acquisition period follows the integration time in autonomous mode, as defined by the user... 

Anne BIGOT
Technical Moderator
August 25, 2025

Indeed you can apply an external trigger source on the SYNC pin

Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised. ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'
trisha-2Author
Associate
September 9, 2025

Also, what is the integration time in continuous mode? If the ranging frequency is 15 Hz, then the frame-to-frame time duration is 66.6 ms. So. According to the dataset, if the default integration time is 5 ms in continuous mode, then what about the rest of the 61.6 ms? What happened during the 61.6 ms time period?

Visitor II
September 22, 2025

I think you may have misinterpreted the integration time.

The data sheet does not say, "default integration time is 5 ms in continuous mode." The default is 5ms for autonomous mode only. Integration time is defined as how long the VCSEL is enabled and integration is occurring. See Ranging Mode and Integration Time on page 10 of UM3109. "Changing integration time if the ranging mode is set to continuous has no effect." In continuous mode the VCSEL is always on and integration is always occurring. So, If the ranging frequency is 15 Hz and the frame-to-frame time duration is 66.6 ms, the integration time would also be 66.6 ms per frame -- giving you maximum ranging distance and ambient immunity (high performance).  Autonomous mode, with low integration times (5ms), is for power savings as it turn off the VCSEL during the "rest of the 61.6 ms", assuming 4x4 @ 15hz.

 

See page 15 for your external sync question. The SYNC pin is GPIO2 (B1) and you need to use a 47K pullup resister to IOVDD.  Set your trigger pin on your controller to LOW (pulling B1 to GND) until you are ready to trigger. The trigger will occur on the rising edge > 0.7v when you set the trigger pin HIGH.

" The external synchronization can be enabled or disabled by using the function
vl53l8cx_set_external_sync_pin_enable(). Ranging can be started using the function vl53l8cx_start_ranging().
The sensor waits for the external SYNC signal to trigger the next measurement process. To stop the sensor, the
user must assert a stop condition in the system, and then on the next external SYNC pin assertion, the
vl53l8cx_stop_ranging() function should be executed.
"

trisha-2Author
Associate
October 25, 2025

Hi,

Thanks for your response. I am applying an external trigger using the STM32F401RE microcontroller. It is working, but now I am facing an issue: when I covered the built-in laser and ambient sensor using copper tape and black tape, I got negative values in the room light. Why?

Zhiyuan.Han
Technical Moderator
October 27, 2025

Hi

When you cover the TOF sensor with copper tape and black tape, the light path from emitter to receiver was blocked, the TOF is based on time of photon flight, so the time information was totally wrong if you cut off the light path of emitter and receiver.

BTW, please check the range status at same time, normally if you read out range value is negative, the range status will be 4 instead of 5(valid)

 

Br

Zhiyuan.Han 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
trisha-2Author
Associate
February 4, 2026

Dear Zhiyuan,

Thanks for your response. Will you kindly inform me what kind of ambient sensor is used in the VL53L8CX evaluation board or Breakout board? Is it the same as the SPAD sensor without a filter?

Thank you.

Associate
February 11, 2026

Once a topic is marked 'solved', people stop looking at it, and further conversation gets lost. 

Always better to start a new thread. 

The ToF sensors have a filter over the input side of the device - so only the 940nm light gets in. 

The sensor establishes the ambient amount by looking at the photon hit rate before the laser is turned on. 

It then 'knows' the incoming signal is anything over the ambient threshold. 

So the ambient is detected using the the same SPAD array AND the same filter - it's just taking a reading without the VCSEL (laser) being turned on.

 

"If this or any post solves your issue, please mark them as ""Accept as Solution"". It really helps the next guy.And if you notice anything wrong do not hesitate to ""Report Inappropriate Content"".I am a recently retired ST Employee. My former username was John E KVAM."
trisha-2Author
Associate
February 23, 2026

Dear Kvam,

Thank you so much for your response and assistance. I need some more info. If I need to add the ambient with SPAD CNH, do I need to remove the DC offset? I am getting negative values for CNH_Hist_Bin. And I need to use Ambient as well.

Looking forward to your response.

trisha-2Author
Associate
February 23, 2026

Dear Kvam,

Thank you so much for your response and assistance. I need some more info. If I need to add the ambient with SPAD CNH, do I need to remove the DC offset? I am getting negative values for CNH_Hist_Bin. And I need to use Ambient as well. 

Look forward to your response.