VL53L0X in Simulation

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
chipfryer27
Valued Contributor
Posts: 1110
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 396 times

VL53L0X in Simulation

Post by chipfryer27 »

Hi

I obtained a VL53L0X module a while back from a well know online presence. No reviews for any results so.........

Spurred on by another user intending to use this or similar device I thought I'd dig mine out, especially as I now have a use for the function.

Created a very simple flowchart comprising of a combo-board and the component itself. The chart has a flasher sanity check then loops providing "distance" every couple of seconds.

In Simulation it is always -1 that is returned (indicating a time out) which is I believe a "bug".

Below are some findings unrelated to the bug and certainly not FC related.

On hardware (once you finally remember to hold XSHUT high) the component does provide distance readings, and these are just my findings using a cheap module.

Holding the module in a fixed position facing quite a reflective surface, it measured the distance to be 77. Each iteration of the loop gave values between 66 and 78. Actual distance was ~41mm. With a distance of ~87 it returned readings of 112 - 120. I do appreciate that these distances are quite close for this device.

Averaging 10 iterations did of course bring the delta down to just a few numbers but again not very accurately and the difference between read value and actual value wasn't consistent over varying ranges.

Averaging 100 times did improve. The difference between actual distance and read was relatively consistent at 24 over varying range (up to ~350). Moving to longer ranges (actual = ~800) with an average of 100 gave a difference between real vs measured of 41.

The above tests were just rough desktop but does seem to illustrate that a cheap module may be a very false economy. I'd be interested to hear if anyone else has used a branded module to good effect.

Regards

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: VL53L0X in Simulation

Post by BenR »

Hello,

Thanks for sharing your findings. I'm glad it is working but the discrepencies between measured and sensed distances are interesting. I bought my module from Amazon so I can't say for sure how genuine it is but I can certainly try and replicate your findings and see how I get on.

Also thanks very much for the simulation spot, I've pushed a new version of the component now that should have that bug resolved.

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 396 times

Re: VL53L0X in Simulation

Post by chipfryer27 »

Hi Ben

Happy to inform that simulation is working, many thanks.

I too got my module from the same source but I've forgotten the vendor and price. I think I probably paid a premium rather than waiting a few weeks for delivery but can't say for certain.

I'll probably experiment with it a bit more over the weekend, or more likely search for a module from a mainstream supplier.

Thanks again for the fix.

Regards

Edit...
Snooping around I've found a few sites that seem to suggest that the accuracy I'm seeing isn't unusual. I've now bought a "proper" module made by Pololu from a UK vendor so I'll update once I receive it. Attached is a typical accuracy chart from my searches. As my need is more proximity related rather than measurement, the "clone" could be pushed into service (If Distance < Whatever) but still keen to compare.
Attachments
VL53L0X Chart.jpg
VL53L0X Chart.jpg (27.74 KiB) Viewed 1534 times

Post Reply