cancel
Showing results for 
Search instead for 
Did you mean: 

How to use VL6180x sensor through I2C

JMach.18
Associate II

I need to use multiple V6180x SATEL sensors to get distance measurements, however I do not know how to make it work directly through the I2C connection, since once connected the sensor is not even found by the I2C.

Is it possible to use this sensor by connecting it directly to the SDA, SCL, 3,3V and ground pins and use it as a common i2c device or do I need to use specific libraries and specific configuration?

2 REPLIES 2
John E KVAM
ST Employee

All the ST code ends at the I2C read/write routines. It is the job of the developer to write the interface between the VL6180X read/writes and the MCU's native read/write commands. You should be able to hook those 4 pins, but there is an SHUTDOWN pin that you have to pull high to get the chip to start.

Some people use the interrupt pin that triggers when the data is ready, although polling also works.

Download the file from:

https://www.st.com/content/st_com/en/products/embedded-software/proximity-sensors-software/stsw-img003.html

It will give you want you need.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

How can I perform the distance reading measured by the vl6180x sensor using only I2C functions and the internal sensor registers?

What I want to do is something like the function below, however I don't know the addresses of the sensor's internal registers.

HAL_I2C_Mem_Read_DMA (& hi2c1, device_address << 1, register_address, 1, buffer, 2);

For example the reading of a temperature sensor at address 0x50 where the output is in register 0x07

HAL_I2C_Mem_Read_DMA (& hi2c1, 0x50 << 1, 0x07, 1, buffer, 2);

Is it also possible that manipulation of more registers is necessary to measure a distance?