I am trying to use the VL53L5CX sensor breakout board (SEN-18642) to detect the presence and location of a person in front of the sensor in an otherwise large room. When the sensor first initializes with nobody in the room, most of the 8x8 distance readings are zero. At first I thought that the sensor returns zero when the room is too large and that there is no reflection sensed. But this is not true. It seems that the returned data initializes to zero, but if a sensor zone gets no return signal, the returned value is whatever it was previously. When someone steps in front of the sensor, the zones return the distance correctly. Then, when the person step away from the sensor’s FOV, the previous range data is still returned. This does NOT happen if the room is small so that when the person steps away from the sensor FOV, the back of the room distances are displayed. However, if the room is deeper than about 12 feet, the previous data is (incorrectly) returned.
I need to use this project in larger room environments and I am wondering if anyone can shed some light on how to know when a sensor zone distance is too far for the sensor to detect. Right now, I cannot tell when the person steps away from the sensor (in a large room) because the old (distance to person) readings are returned.
I am using the sensor in continuous ranging mode, 8x8 zones, 1 second per reading (everything else defaulted).
Running Example1_DistanceArray on Sony Spresense board, with SparkFun SEN-18642.
When an object (hand, wall, etc) is within about 2 meters, data displayed seems correct. If the sensor is pointing “into space”, ie with nothing for about 15 feet (er, 5 meters) it returns basically garbage. The data displayed seems to be the last “valid” data available.
So I can stand in front of the sensor and it displays about 300 mm across the board. If I step away, the data just stays about the same.
The sketch is using the getRangingData() function, which calls vl53l5cx_get_ranging_data() from the api. Are there flags in the original data stream that would indicate “out of range”, and the arduino sketch is displaying old data because it doesn’t understand?
If I write my own routine calling vl53l5cx_get_ranging_data(), or something lower if necessary, how can I avoid this? I’d rather have my program insert some artificially large number for max range / out of range than just old garbage. But first I have to be able to tell the difference!
BUT I’m seeing this problem where flashing a hand in front of it and then away…it is retaining the distances when my hand was in front of it!This is absolutely useless if not fixed! Am I using it incorrectly, or is this an ESP8266 issue, sensor issue or a library issue?
I’m only using Spark Fun’s, “Example1_DisanceArray” sample program.