GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Patou
Normal user
Posts: 66
Joined: 21 May 2018, 10:33

GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#1 Post by Patou » 09 Feb 2019, 00:05

Hello,
There is a new i2c sensor to mesure distances : GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight
https://www.aliexpress.com/premium/gy-5 ... ckPrompt=1
Specifications:
Infrared distance measurement module
Model: GY - VL53L0X
Using the chip: VL53L0X
Power supply: 2.8 to 5V
Ranging time: <30ms
Operating mode: Power consumption 20mW
Standby power consumption: 5μA
Distance: <2 meters
Communication: the IIC communication protocol (fully compatible with 3-5 v system)
PCB size: about 13.3x10.5mm/0.51"x0.43
"

Looks very interesting compare to HC-SR04 works on i2c bus no dedicated input for this device laser based and not ultrasonic
For the good C+ programmers is there big work to adapt the lux BH 1750 plug-in for this laser distance ?

User avatar
enesbcs
Normal user
Posts: 551
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#2 Post by enesbcs » 09 Feb 2019, 10:16

Patou wrote: 09 Feb 2019, 00:05 There is a new i2c sensor to mesure distances : GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight
It maybe new for you, but the plugin for it in the repository since 2017: :)
https://github.com/letscontrolit/ESPEas ... L53L0X.ino

Patou
Normal user
Posts: 66
Joined: 21 May 2018, 10:33

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#3 Post by Patou » 09 Feb 2019, 11:33

Thanks gave a Nice wk

Patou
Normal user
Posts: 66
Joined: 21 May 2018, 10:33

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#4 Post by Patou » 09 Feb 2019, 12:18

Hello again,
I do not find a binary file with this plugin included and I am quiet new in compiling and build up binary files
I am currently using : ESP_Easy_mega-20190110_test_core_250_beta_ESP8266_4096.bin
2 Questions :
Is there somewhere a tutorial how to compile and add plugin in binary this will make me more clever ?
Or Do you have a ready made binary file including this plugin ?
I am still leaning ...
Patou

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#5 Post by Domosapiens » 09 Feb 2019, 12:55

30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

User avatar
enesbcs
Normal user
Posts: 551
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#6 Post by enesbcs » 09 Feb 2019, 16:43

Patou wrote: 09 Feb 2019, 12:18 Hello again,
I do not find a binary file with this plugin included and I am quiet new in compiling and build up binary files
I am currently using : ESP_Easy_mega-20190110_test_core_250_beta_ESP8266_4096.bin
2 Questions :
Is there somewhere a tutorial how to compile and add plugin in binary this will make me more clever ?
Or Do you have a ready made binary file including this plugin ?
I am still leaning ...
Patou
With PlatformIO you can build your own build from source.
Anyway, i've a binary, that contains VL53L0X plugin, attached. (however it is compiled from an older codebase, it still works)
Attachments
ESPEasy.4M.2018dec.zip
ESPEasy Custom 2018.dec binary
(554.77 KiB) Downloaded 378 times

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#7 Post by juju » 07 Jan 2021, 11:53

Hello, this thread is pretty old but I get a try :)

So I bought the same Sensor and I cannot manage to use it with (EspEasy or else).
After many researched, I found that my sensor uses the 0x39 I2C address instead of 0X29.
Is there a solution to edit this address used by the plugin without full recompilation ?

Thanks in advance.

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#8 Post by TD-er » 07 Jan 2021, 12:25

juju wrote: 07 Jan 2021, 11:53 Hello, this thread is pretty old but I get a try :)

So I bought the same Sensor and I cannot manage to use it with (EspEasy or else).
After many researched, I found that my sensor uses the 0x39 I2C address instead of 0X29.
Is there a solution to edit this address used by the plugin without full recompilation ?

Thanks in advance.
Using the web interface to save the settings, you may need to rebuild it, as that address is not encoded in the combobox: https://github.com/letscontrolit/ESPEas ... no#L66-L67
However, it does use the address as a form value in the HTML, so what you can do is fake a HTTP POST command to send plugin_133_vl53l0x_i2c as being your requested address.

The simplest way I can think of right now is to change the HTML via the browser's inspect window to set the value to 0x39 and then press submit.

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#9 Post by juju » 07 Jan 2021, 13:34

Thanks for this quick answer.
I'll try today.

Actually when I try to enable the device, nothing happens. The page refreshes and the device is still disabled. Maybe your trick will help me.

:)

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#10 Post by Ath » 07 Jan 2021, 14:04

juju wrote: 07 Jan 2021, 11:53 After many researched, I found that my sensor uses the 0x39 I2C address instead of 0X29.
Strange, according to the chip documentation, a VL53L0X has an I2C address of 0x52, not 0x29, 0x30 or 0x39, at wat address is it found by the ESPEasy I2C Scanner (Tools page)?

Can you provide a link to the actual device you bought?
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#11 Post by juju » 07 Jan 2021, 14:09

Hello,

So I bought this one on Aliexpress (perhaps not the best choice) :
https://fr.aliexpress.com/item/40013516 ... 6c37zwVDZQ

The I2c scanner show this information :

I2C Addresses in use
0x39

Supported devices
PCF8574A
TSL2561
APDS9960

The I2C Scan on Tasmota show the same address.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#12 Post by Ath » 07 Jan 2021, 14:13

Have you tried to change the address by bringing the SD0 pin low/high? (As suggested in the plugin) And assuming you got one with that connection :D

Possibly the suggested 0x30 alternate address in the plugin is a typo, and should be 0x39 (those keyboard keys are sooo close together :o)
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#13 Post by juju » 07 Jan 2021, 14:20

I'm not sur to understand your suggest.

I bought this one : https://ae01.alicdn.com/kf/He58d57900da ... pg_Q90.jpg
And in EasyEsp I tried the 2 options 0X29 and 0X30 without success.

I can change this setting and save it. But I never manage to Enable the device. Nothing happens and if I refresh the page the device is still disabled.

Thanks for your time.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#14 Post by Ath » 07 Jan 2021, 15:20

Have you tried to manipulate the page like TD-er suggested? That's currently the only way to get that 0x39 address in there. Possibly it is auto-disabled after ~10 reboots because it's crashing but I'm not sure a wrong address would even crash it. So the Enabled checkbox should normally be saved.

What version (date?) of ESPEasy are you running on this device, as the plugin seems to come from the PluginPlayGround, there won't be regular builds available, only self-built, AFAICS.
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#15 Post by juju » 07 Jan 2021, 15:39

I just tried and it doesn't work.

I use the bin posted by enesbcs on this topic.
Please find the firmware information :

Build:⋄ 20103 - Mega
Libraries:⋄ ESP82xx Core 2_4_1, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3
GIT version:⋄ (custom)
Plugins:⋄ 43 [Normal] [Testing] [Development] [IR]
Build time:⋄ Feb 9 2019 16:39:22
Binary filename:⋄ Self built!


I tried to compile with a most recent version to add the plugin but it's not my cup of tea and I have many errors. I continue my researches. :)

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#16 Post by TD-er » 07 Jan 2021, 15:48

Ath wrote: 07 Jan 2021, 14:04
juju wrote: 07 Jan 2021, 11:53 After many researched, I found that my sensor uses the 0x39 I2C address instead of 0X29.
Strange, according to the chip documentation, a VL53L0X has an I2C address of 0x52, not 0x29, 0x30 or 0x39, at wat address is it found by the ESPEasy I2C Scanner (Tools page)?

Can you provide a link to the actual device you bought?
0x52 >> 1 = 0x29

The problem with I2C device addresses is that the last bit is used to signal the communication direction (R/W).
So some use the 6 bit notation (as does our scanner) and some use the 7 bit notation. (e.g. NXP almost always mentions the 7 bit notation in the datasheets)

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#17 Post by Ath » 07 Jan 2021, 16:01

TD-er wrote: 07 Jan 2021, 15:48 0x52 >> 1 = 0x29
My hex calculations aren't that trained to see that immediately, thnx ;)
/Ton

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#18 Post by TD-er » 07 Jan 2021, 16:07

Ath wrote: 07 Jan 2021, 16:01
TD-er wrote: 07 Jan 2021, 15:48 0x52 >> 1 = 0x29
My hex calculations aren't that trained to see that immediately, thnx ;)
Would you say it is a bit shifted? ;)

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#19 Post by Ath » 07 Jan 2021, 16:25

TD-er wrote: 07 Jan 2021, 16:07
Ath wrote: 07 Jan 2021, 16:01
TD-er wrote: 07 Jan 2021, 15:48 0x52 >> 1 = 0x29
My hex calculations aren't that trained to see that immediately, thnx ;)
Would you say it is a bit shifted? ;)
:D :D :D
/Ton

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#20 Post by Ath » 07 Jan 2021, 22:38

I've pulled the plugin from the PlayGround to my local dev system, added the VL53L0X library mentioned in the source and fixed a few nasty errors (buffer overflow, fixed on I2C address 0x29, crashing if no sensor attached on 0x29 :( )
Also added address 0x39 to the Address selector and cleaned up the other options as well.

ESP8266 4M1M testing build attached (including plugins P133 and P050 in addition to the normal test configuration)

Please test and report your findings here ;)

As it is rather a lot newer than the previous build, it may need a blank flash (complete reset) and re-configuration (can be restored from a config backup)
Attachments
ESP_Easy_mega_20210107_test_ESP8266_4M1M_VCC.zip
(656.79 KiB) Downloaded 9 times
/Ton

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#21 Post by TD-er » 07 Jan 2021, 23:10

Ah you got a bit carried away I see :)

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#22 Post by juju » 07 Jan 2021, 23:25

Thanks again for your help.

It's small better, I can add the device on the webserver and enable it.
But the distance is still 0.

I still see the I2C address 0X39 in I2C scan, so I guess the wiring is ok.

In the log I have now an error I never have before :
597545: VL53L0X: Sensor not found, init failed for 0x39
(I tried the other value and same results).

May the night be with me :)

TD-er
Core team member
Posts: 3946
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#23 Post by TD-er » 07 Jan 2021, 23:32

@Ton:
Maybe log the incorrect read value? That's more useful in debugging.

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#24 Post by juju » 07 Jan 2021, 23:40

Please find the verbose log

Logging: Debug Dev (9)
647026: VL53L0X: Sensor not found, init failed for 0x39
647026: VL53L0X : idx: 0x39
647026: VL53L0X : plugin(idx): 0x0

But the logs entries look like the sample error code in the arduino vl53l0x library.
I have à second sensor I’ll try tomorrow.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#25 Post by Ath » 08 Jan 2021, 08:31

TD-er wrote: 07 Jan 2021, 23:10 Ah you got a bit carried away I see :)
Well, I think it is quite annoying that a plugin that hasn't been (really) touched for such a long time, isn't working as intended.
It also needs the multi-instance treatment, didn't do that yet, might help to fix the I2C addressing issues now faced.
TD-er wrote: 07 Jan 2021, 23:32 @Ton:
Maybe log the incorrect read value? That's more useful in debugging.
I'll add some more detailed logging.
Think I'll have to order such sensor, and pick one with I2C address selection, just to be able to properly test it, hm, delivery from Ali/China will take a few weeks so this one will to go on the back-burner :? (Rather not want to pay the extra 'processing' & shipment costs attached to a local supplier, plus they don't seem to have the ones with the SD0 connection for address selection)
/Ton

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#26 Post by Ath » 08 Jan 2021, 08:33

juju wrote: 07 Jan 2021, 23:25 In the log I have now an error I never have before :
597545: VL53L0X: Sensor not found, init failed for 0x39
I added that on purpose ;)
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#27 Post by juju » 08 Jan 2021, 10:07

Hello, I can send you the sensor if you need it.
I bought 2 of them.
Just tell me

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#28 Post by Ath » 09 Jan 2021, 09:38

juju wrote: 08 Jan 2021, 10:07 Hello, I can send you the sensor if you need it.
I bought 2 of them.
Just tell me
That I'll keep in mind, as I've been unable to find this sensor with changable address, so far, on Ali. :(
/Ton

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#29 Post by Ath » 09 Jan 2021, 13:05

juju wrote: 07 Jan 2021, 14:09 So I bought this one on Aliexpress (perhaps not the best choice) :
https://fr.aliexpress.com/item/40013516 ... 6c37zwVDZQ
Which of the 5 available sensors did you buy?, as only one of them is a VL53L0X
You might need to check the text that's on the unit to get the actual type of the unit.
(APDS) 9930 = Proximity sensor, similar to the APDS9960, on I2C address..., wait for it... 0x39
GY1145 = UV/IR sensor, on 0x60
(GY)VL53L0X = tof sensor, on 0x29
(GY)PAJ7620 = Gesture sensor (ESPEasy already supports the similar APDS9960 on 0x39), on 0x73
ADXL345 = accelerometer on 0x53

As I'm now thinking you actually got an APDS9930, you could try to use the Gesture - APDS-9960 plugin, available in the TEST builds. It won't give you the time-of-flight measurements though ;)
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#30 Post by juju » 09 Jan 2021, 21:36

You are right, this is the gesture sensor...
I didn't see any mention of this sensor on the ali page and I made the mistake.

I'm so sorry for the inconvenient and wasting your time...
It doesn't work with espeasy but I don't need it.

I bought another from AZDelivery. I'll try in few days.

Thanks a lot again.

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#31 Post by Ath » 09 Jan 2021, 22:08

juju wrote: 09 Jan 2021, 21:36 It doesn't work with espeasy but I don't need it.
Have you tried the APDS9960 plugin? It is included in the 'test' builds, and can also work as a r/g/b sensor, but maybe it is ignored, as I don't know if this driver does a chip-check or not.
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#32 Post by juju » 09 Jan 2021, 22:28

Yes I tried without succès.
I’ll try tomorrow with simple arduino code just to see if It works.

It’s just the beginning of a long journey.

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#33 Post by juju » 11 Jan 2021, 22:57

I received a real vl53l0x from azdelivery and It works like a charm.
Now I Know if my stove has enough pellets or not with an email.

:D

Again thanks you

User avatar
Ath
Normal user
Posts: 473
Joined: 10 Jun 2018, 12:06
Location: NL

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#34 Post by Ath » 12 Jan 2021, 08:03

Great to hear. ;)

I'll remove the unneeded extra address for the sensor from the code as that's not selectable on the hardware, improve the plugin to handle multiple-instance use, and add as a PR (pull request) to the repository. After it is merged and released you will need to reconfigure (delete the plugin and add again), as it won't keep the current plugin id (133), but probably something like 109 or 110 (next number in the current set of plugins).
/Ton

juju
Normal user
Posts: 12
Joined: 07 Jan 2021, 11:46
Location: France

Re: GY-530 VL53L0X Laser Ranging Sensor Time-of-Flight

#35 Post by juju » 12 Jan 2021, 09:43

ok perfect. I'll try this new one.
And if you need help to test, you can contact me.

Have a nice day !

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests