cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get an interrupt if there is no target in the measuring range? (ULD API 3.4.0, VL53L1X)

MGlem.1
Associate II

The function VL53L1X_SetDistanceThreshold has as a comment that the parameter IntOnNoTarget should no longer be used. I also found in my tests that the configuration has no effect. Can someone provide more information on this?

// @param   IntOnNoTarget = 0 (No longer used - just use 0)
VL53L1X_ERROR VL53L1X_SetDistanceThreshold(uint16_t dev, uint16_t ThreshLow, uint16_t ThreshHigh, uint8_t Window, uint8_t IntOnNoTarget);

What I also found that the GPIO interrupt "above" is not triggered without a wall / ceiling in the background of the measuring range.

How to reproduce?

  • Vl53L1X is aligned in the air
  • Distance mode short
  • Threshold is set to 30cm
  • Hand is brought into the area <30cm, and
  • quickly removed to the side
  • No interrupt is recognized

However, if you do not remove your hand to the side, but upwards away from the sensor, the interrupt is recognized. Is that a weakness of ToF or of the sensor? Can you set a timeout within the sensor so that an interrupt is triggered?

1 REPLY 1
John E KVAM
ST Employee

When the sensor gets an answer and there is a threshold set, a bit of logic decides if the interrupt should be triggered based on the result of the range.

But if the range fails for some reason there is no 'answer' and so the interrupt logic is not called.

Using the p-Nucleo-53l1A1 evaluation board, I see using short range, when there is no target one gets an RangeStatus of 4.

RangeStatus 4 is VL53L1_RANGESTATUS_OUTOFBOUNDS_FAIL, which sounds reasonable as there is no target.

One could, in your situation, use a threshold to detect the initial presence of the hand.

Then disable thresholds and pay attention to each range result looking for either a range above 30cm or a RangeStatus=4.

At that point you can do whatever you have to do when the hand leaves and go back to threshold mode.

One other thing you might try - change the mode from short to long.

You won't get any 4 errors in long mode.

However other errors pop up and you might be back where you started.

But if you have the Eval kit these tests are quick an easy.

  • john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.