Hi, I’m trying to calibrate the Piico Dev VL53L1X laser sensor to operate in short mode instead of the default long mode. I’ve looked through the Piico Dev library and the API code for the laser sensor. My understanding is that the VL51L1X_DEFAULT_CONFIGURATION needs to be modified to write to the register that configures the ranging mode. My problem is that I haven’t found anything that tells me what the register is for ranging mode and what it needs to be changed to.
Hi @Jack249945 - welcome to the forums.
PiicoDev_VL53L1X.py file… we’ve learned a lot about driver code creation since we put this one together… Even so, it seems that ST has hidden the full workings of this device behind their driver implementation software (source) which means the workings of each register are not readily available.
see the Note in DS12385 Datasheet, 4.2: “The customer must use the VL53L1X software driver for easy and efficient ranging operations to match performance and accuracy criteria. Hence full register details are not exposed . The customer should refer to the VL53L1X API user manual (UM2356 ).”
Document UM2356 is just the API user manual containing instructions on how to use that proprietary API.
You’re correct in that the driver could be updated to change that default configuration. Ideally, we update the driver so you can change the configuration from user-code.
It seems to me that there might be two ways to achieve this end:
- The first might be to try using the preferred software and sniff the bus with a logic analyser to capture the setup commands. This is a pretty deep and intimidating dive.
- The second is to find an existing open source library and port that part of the code into the
Can i ask what the motivation is?
Hi Michael. The motivation is that we’re looking to use the sensor in the range of 10mm to 40mm. We want it to measure the position of a ballast tank syringe so we can calculate the water taken in. Some basic testing of the sensor has shown that the sensor can have some large errors at this range. We purchased two of them. One is fairly accurate, but the other is experiencing an offset of up to 30mm. It does still measure changes in distances well, so we can manage the offset value. I just wanted to see if there was an easy way to set it into short mode. Thank you for your assistance.