Why 8190 and 8191 are displayed when outputting distance with VL53L0X

Hello, employees

When I measured the distance using the Arduino code for VL53L0X provided by your company, it returned 8190 or 8191.

I tried searching but couldn’t find anything.
When you refer to 8190 and 8191, please tell us what state the sensor is in.

Also, please tell me where the reference is written.


I moved your post to the sensors support category since to help keep the forum organized.

Has your VL53L0X always behaved this way, and can you post some pictures of your setup that show all of your connections? What Arduino are you using to control the VL53L0X, and do you get the same results if you use both the Single.ino and Continuous.ino example programs from our library?

- Patrick

thank you for your reply.

I didn’t take any photos regarding the connection, but I connected the AE-VL53L0X to Arduino and measured it.
What appeared was displayed when measuring 2 m or more in LongMode.

Also, the code I used is Single.ino. Then I read single.ino and the value came out.
I think that the reason why 8190 and 8191 appear is that the measurement is invalidated for some reason.
Is it possible to display the cause etc. using Arduino’s serial communication?

Also, which library does this display itself fall under?

Thank you for your reply.

You are correct; the readings you are seeing indicator errors. 8191 indicates a signal fail which triggers when there is too much noise in the sensor’s ranging measurement, usually from ambient light. That would be consistent with trying to measure distances of 2 meters or more since that is the upper bound of the VL53L0X sensor’s usable range. If you need to measure longer distances, you might consider our VL53L1X carrier, which can measure distances up to 4 meters.

There is some more discussion about these types of errors in this thread on ST’s forum, and in the VL53L0X API user manual, which is available on our carrier’s product page under the “Resources” tab

As for the display, it sounds like you are just talking about the Arduino Serial Monitor. You could write a user program that looks at the distance measurements and sends a different message if they indicate an error if you wish. The functions for using the Arduino Serial Monitor are built into the Arduino IDE, so Arduino’s Serial reference page is probably the best resource for that.

- Patrick

Is there a way to check if the sensor is actually measuring distance using your company’s library provided with Arduino?

Our library does not have a function that checks whether the distance measurements are valid readings. If you decide to modify your user code to check for that, you can probably assume at any values over 8000 are errors.

- Patrick