VL53l0x interruttore di prossimità

chi mi può dare una mano
come posso utilizzare un VL53l0x come interruttore di prossimità
vi ringrazio per il vosto aiuto.

Fiorenzo

who can give me a hand
how can i use a VL53l0x as a proximity switch
thank you for your help.

Fiorenzo

Hi Fiorenzo and welcome to the forum,

There is a library for the VL53L0X:
https://xod.io/libs/wayland/vl53l0x-time-of-flight/

A simple proximity switch would use the tof-sensor node:
Screenshot 2022-03-09 at 22.45.27

The DIST output of tof-sensor gives the range in mm. In this example, the less node outputs true when the range drops below 200mm.

ottimo di nuovo garzie per la soluzione

e se fosse un vl53l1x ?
come funziona?

and if it was a vl53l1x?
how does it work?

There is also a library for the VL53L1X:
https://xod.io/libs/wayland/vl53l1x-time-of-flight/

The equivalent patch for the VL53L1X would be:
Screenshot 2022-03-09 at 22.42.12

1 Like

trovato scusatemi ho risolto


può funzionare o manca qualcosa

it may work or something is missing

On the tof-sensor node, set INIT to On Boot rather than Continuously, as the sensor should only be initialized once.

The ACT input to led should be set to True, otherwise the node will not respond to changes to the LUM input.


ho fatto quello che tu mi dici.
ma quando avvicino un oggetto
non mi cambia mai di stato
ho bisogno che quando l’ostacolo è alla distanza prefissata
lui mi segnali la presenza dell’ostacolo.
ti ringrazio per la tua collaborazione.

Fiorenzo

I did what you tell me.
but when I approach an object
it never changes my status
I need that when the obstacle is at the set distance
he signals the presence of the obstacle to me.
thank you for your collaboration.

Hi Fiorenzo,

In addition to the changes I suggested, it appears that you set UPD to “Never”. UPD should either be set to “Continuously” or should receive a regular input pulse.

Ho fatto quello che tu mi dici.
ma non funziona ancora non capisco.
se volessi usare invece hc-sr04 come potrei fare.

I did what you tell me.
but it still doesn’t work i don’t understand.
if i wanted to use hc-sr04 instead how could i do.

Perhaps the VL53L0X is defective. It might be worth scanning the I2C bus using @cesars i2c-scanner. The I2C scanner will report the address 29h if the VL53L0X is detected.

Screenshot 2021-10-17 at 10.17.54

For the HC-SR04 two XOD libraries are available:
https://xod.io/libs/xod-dev/hc-sr04/
https://xod.io/libs/gweimer/hc-sr04-ultrasonic/

Both libraries have example patches demonstrating their use.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.