PiicoDev Laser Distance Sensor VL53L1X (CE07741)

Hi, I want to use the VL53L1x with a Esp32-S2 and micro python, I should be able to use with the esp?

3 Likes

Hi Rick,

Yeah it will work no worries!

You’ll have to specify the bus, sda and scl pins and freq, example code can be found on the Git: GitHub - CoreElectronics/CE-PiicoDev-VL53L1X-MicroPython-Module: Firmware repo for the Core Electronics PiicoDev Laser Distance Sensor VL53L1X

The initialisation might look like this:

from machine import Pin
distSensor = PiicoDev_VL53L1X(bus=0, sda=Pin(16), scl=Pin(17), freq=400000)

The sda and scl pins can be (mostly) whatever on the ESP32’s thanks to the bus matrix.

2 Likes

Hey Liam…as you know I’ve done heaps with the VL53L1X… and today, I tried using it with different SDA/SCL pins. The driver crashes in init (actually doing the initial reset)

I’ve tried multiple Picos… with a few different SDA/SCL combos. After changing pin numbers and rewiring, an I2C scan shows the device just fine (so… it is alive on the new pins) but NEVER works unless I default to pins 8,9. NOTHING else connected on the bus… bare-bones setup. Pico and VL53L1X - that’s it.

Note: Not using the Qwiic connector (sort of obviously) but to be sure… I am connecting to the solder pins on the edge of the board. My cable works just fine if I use GPIO 8,9 … on say 4,5 … I2Cscan reports the device address… but the VL53L1X driver craps out immediately.

Any ideas?

Cheers, T.

EDIT 2: Now working… the culprit may have been dodgy Dupont connections. I changed wires to a different set on SDA/SCL…not as sloppy a fit as the first set - and it works just fine. Grrrr….

2 Likes