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

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Patou
Normal user
Posts: 106
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: 587
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: 106
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: 106
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: 587
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 886 times

juju
Normal user
Posts: 24
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: 8643
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: 24
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: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 8643
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: 3417
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 (PayPal.me)

TD-er
Core team member
Posts: 8643
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: 3417
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 (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
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 367 times
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8643
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: 24
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: 8643
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: 24
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: 3417
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 (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 3417
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 (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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: 24
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: 3417
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 (PayPal.me)

juju
Normal user
Posts: 24
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 !

Simba
New user
Posts: 9
Joined: 05 Feb 2021, 15:10

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

#36 Post by Simba » 05 Feb 2021, 15:34

Hello,
Thanks Ath for your compilation, it works well with the VL53L0X.
Will you be able to do a compilation with the latest version (Release mega-20210114) for normal_ESP8266_4M1M, because I need the arithmetic function (acos) not available in your version.
thank you so much

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

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

#37 Post by Ath » 06 Feb 2021, 11:36

I've updated the plugin to have ID 110 instead of 133, in preparation of a PR, so you will have to reconfigure your device after updating. Also removed the unsupported I2C address 0x39.

This build ('normal' with VL53L0X included) is based on current MEGA branch (2021-02-06) including all WiFi fixes that have been done since 20210114 release.

My VL53L0X sensor has arrived, so I tested it for a short while now, and it seems to work quite fine.
I will be reworking this plugin to have better support for multiple instances, f.e. when using an I2C multiplexer (that's not included in this build though).
Attachments
ESP_Easy_mega_20210206_normal_ESP8266_4M1M_VCC.zip
(550.98 KiB) Downloaded 336 times
/Ton (PayPal.me)

Simba
New user
Posts: 9
Joined: 05 Feb 2021, 15:10

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

#38 Post by Simba » 06 Feb 2021, 21:05

Hello,
Thanks a lot for the file and the work done, I will test it next week.
Have a good evening

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

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

#39 Post by Ath » 06 Feb 2021, 21:24

I have made a PR for this plugin in the ESPEasy repository (#3493). Awaiting review and a merge, but also needs a build that it can be included in, as I couldn't include it in TESTING builds because if a lack of space in the .bin files for that.
/Ton (PayPal.me)

Simba
New user
Posts: 9
Joined: 05 Feb 2021, 15:10

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

#40 Post by Simba » 08 Feb 2021, 09:47

I tested this version and the VL53L0X works but there are no arithmetic functions.

734468: ACT : Let,6,(2*acos(1-(24.2/(96/2))))
1734470: Calculate: Unknown token.

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

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

#41 Post by Ath » 08 Feb 2021, 10:25

I think that is a bugfix that's not yet merged in the development branch, once it is merged I can make a new build.
/Ton (PayPal.me)

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

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

#42 Post by TD-er » 08 Feb 2021, 11:37

The use of arithmetic functions is a bit limited.
You cannot use values as a parameter that still have to be calculated.
So you first have to compute the parameter of the acos function (and store it in a variable) and then hand it over to the acos function.

@Ath What merge do you mean?

Simba
New user
Posts: 9
Joined: 05 Feb 2021, 15:10

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

#43 Post by Simba » 08 Feb 2021, 12:07

I have no problem with my formula, it works well with Release mega-20210114_ESP8266_4M1M.

Let,6,(2*acos(1-([var#5]/([var#1]/2)))) // Angle
Let,7,round(((0.5*([var#1]/2)^2)*([var#6]-sin([var#6]))*[var#2])/1000) //Volume

I also noticed an error in the help !

Radian Angle:
sin(x) Sine of x (radian)
cos(x) Cosine of x (radian)
tan(x) Tangent of x (radian)
arcSin(x) Arc Sine of x (radian)
arcCos(x) Arc Cosine of x (radian) Doesn't work! but acos(x) work fine
arcTan(x) Arc Tangent of x (radian)

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

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

#44 Post by TD-er » 08 Feb 2021, 12:43

Ah, I messed up in documenting....

And I really have to check the current implementation, to see what parts are fed to the compute functions and what not.
As I did start moving things around while implementing it, so not all functions will accept parameters that still have to be computed.

A quick glance at the code learned the {...:...:...} notation does not accept parameters that still need to be computed.
arithmetic formula like sin(...) should indeed work just fine.

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

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

#45 Post by Ath » 08 Feb 2021, 13:48

TD-er wrote: 08 Feb 2021, 11:37 @Ath What merge do you mean?
I thought I remembered a recent commit, related to that Calculate() function, that hasn't been merged yet, but I could be wrong.
/Ton (PayPal.me)

Doryphore
Normal user
Posts: 20
Joined: 20 Feb 2021, 08:51
Location: Cambrai, France

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

#46 Post by Doryphore » 05 Mar 2021, 16:46

Hello,

I'm trying to get the VL53L1X to work with espeasy so I installed the firmware ESP_Easy_mega_20210206_normal_ESP8266_4M1M_VCC but it doesn't work.

The VL53L1X module is from the CQrobot brand : https://www.cqrobot.com/index.php?route ... ption=true

Wiki is here :
http://www.cqrobot.wiki/index.php/VL53L ... nce_Sensor

no distance in espeasy :
Image

The i2c adress is good :
Image

Would the VL53L1X be different from the VL53L0X?

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

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

#47 Post by Ath » 05 Mar 2021, 16:58

I have only tested with the VL53L0X, as I don't own the 1X device. The only real difference should be the supported measuring range.

A few things you can check:
- Does it turn up in the I2C scan (from the Tools tab)? edit: Yes it does, (missed the second screenshot)
- If you look at the logging (best via the USB/Serial connection, but via web should also work) do you see some VL53L0X logging there?
/Ton (PayPal.me)

Doryphore
Normal user
Posts: 20
Joined: 20 Feb 2021, 08:51
Location: Cambrai, France

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

#48 Post by Doryphore » 06 Mar 2021, 07:54

Hello,

Thank you for your reply
The espeasy log indicates: the sensor is not found !!!
60516: VL53L0X: Sensor not found, init failed for 0x29
62138: WD : Uptime 1 ConnectFailures 0 FreeMem 25464 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init

I ordered a VL53L1X from another brand to test, from the BlueDot brand and whose circuit is different ...
https://www.amazon.fr/gp/product/B07P1H ... UTF8&psc=1

I was inspired by this tutorial, it works with the VL53L1X !
https://nerdiy.de/en/howto-espeasy-vl53 ... -auslesen/

But in this tutorial, the module's configuration page is different, here is his:
Image

and mine
Image

Doryphore
Normal user
Posts: 20
Joined: 20 Feb 2021, 08:51
Location: Cambrai, France

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

#49 Post by Doryphore » 07 Mar 2021, 11:26

Hello,

Hello,

I tested with a VL53L1X from another brand: same result.
https://www.amazon.fr/gp/product/B07P1H ... UTF8&psc=1

The I2c scan takes the VL53L1X sensor well but in the log I have an error message:
2893640: VL53L0X: Sensor not found, init failed for 0x29
2898224: WD : Uptime 48 ConnectFailures 0 FreeMem 25704 WiFiStatus 3 ESPeasy internal wifi status: Conn. IP Init
2898625: VL53L0X: Sensor not found, init failed for 0x29
2903627: VL53L0X: Sensor not found, init failed for 0x29
2908625: VL53L0X: Sensor not found, init failed for 0x29
2913625: VL53L0X: Sensor not found, init failed for 0x29
2918629: VL53L0X: Sensor not found, init failed for 0x29
2923625: VL53L0X: Sensor not found, init failed for 0x29

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

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

#50 Post by Ath » 08 Mar 2021, 22:22

I've added some extra logging to the VL53L0X driver, and created a build ('normal' instead of 'test' this time)
The log shows the model-id of the chip, as I expect they differ, and the driver used currently only supports 1 id, 0xEE.

The log looks like this when no sensor is attached (I just was too lazy to connect it :D)

Code: Select all

15138 : Info   : VL53L0X: Sensor not found, init failed for 0x29
15138 : Info   : VL53L0X: Init: unrecognized Model-ID: 0xff
So Model-ID 0xff means 'no sensor attached'.

If you report the Model-ID your VL53L1X reports I'll add that to the check, and you can then try if it works as expected.

Edit:
I just searched the docs of the VL53L0X and VL53L1X and found the Model-ID for the VL53L1X to be 0xEA. Added that to the code, so we now have experimental support for VL52L1X :)
Attachments
ESP_Easy_mega_20210308_normal_ESP8266_4M1M_VCC.zip
(559.96 KiB) Downloaded 360 times
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 32 guests