A fixed large value, often 8190 or 65535 depending on the library, usually means “no target in range” or a timeout. Check the range and the I2C link.
What the message means
The sensor measures the time light takes to return. If nothing reflects enough light, or the sensor times out, the library returns a fixed value.
Fix it in this order
- Run an I2C scanner. The usual address is 0x29.
- Check the library example works before adding your own code.
- Point the sensor at a matt, light surface within its range. Dark, shiny or clear surfaces return little light.
- Keep sunlight away from the sensor and keep its window clean.
- Handle the timeout status from the library rather than using the number as a distance.
- If you use several sensors, use each XSHUT pin to set a different address at start.
Why it happens
The VL53L0X measures distance by timing an infrared pulse that reflects from a target. When too little light returns, or no target is in range, the sensor cannot compute a valid time. The library then reports a sentinel value near 8190 mm, which is not a real distance. Dark, glossy, or very reflective targets can also return unreliable readings because the reflected energy changes.
Sunlight contains infrared, so strong light fills the receiver and masks the return pulse. A dirty or covered window reduces the returned light further. The sensor also needs a stable I2C connection at its supply voltage, since a loose wire or wrong address can produce values that look like distances. Checking the library’s range status, not only the number, separates a real fault from a difficult target.
If you see this, do this
| You see | Do this |
|---|---|
| Large number at all distances | No target, or sensor not working. |
| Works indoors only | Strong sunlight. |
Confirm the fix
- Run the library’s example sketch with the sensor aimed at a white card about 300 mm away and note the reading.
- Move the card in steps and confirm the reading tracks each change, since a fixed large number means no return.
- Print the range status code each loop and confirm a valid status appears whenever the card is within range.
Common mistake: Assuming the large number is a real measurement that is simply too far away, when it usually signals no valid return.
Related
I2C device not found, HC-SR04 distance.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.