cancel
Showing results for 
Search instead for 
Did you mean: 

VL6180X I2C adddress detecting but readings are not coming.

Ajay_9121
Associate III

Hi Team,

In this post regarding VL6180x proximity sensor, the sensor is detecting the address(0x29) but the readings are receiving as 255 value even the object it detected in front of sensor. for reference purpose go through this code snippet wrote in arduino IDE for ESP32-WROVER-IE. 

What might be the problem?

Regards, 

#include <Wire.h>
#include "Adafruit_VL6180X.h"

#define SDA 23
#define SCL 22

Adafruit_VL6180X vl;

void setup() {
  Serial.begin(115200);
  delay(1000);

  Serial.println("Starting I2C...");
  Wire.begin(SDA, SCL); 
  delay(100);

  Serial.println("VL6180X test");

  if (!vl.begin()) {
    Serial.println("Failed to find VL6180X");
    while (1);
  }
  Serial.println("VL6180X found!");
}

void loop() {
  //Serial.println("hi");
  uint8_t range = vl.readRange();
  uint8_t status = vl.readRangeStatus();

//  if (status == VL6180X_ERROR_NONE) {
    Serial.print("Range: ");
    Serial.println(range);
  //}
  //delay(500);
}

Edited to apply source code formatting - please see How to insert source code for future reference.

4 REPLIES 4
Peter BENSCH
ST Employee

I am very sorry to inform you that this is a device that has already been discontinued, and STMicroelectronics has no further information about it. But perhaps one of our friendly community users will be able to help?

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Can you please suggest me the any another proximity sensor with this SAME FOOTPRINT? and also may i know the date of this product discontinue?

The VL62180 was the one of the first sensors of its kind launched by STMicroelectronics and has features, such as the ambient light sensor, that are no longer included in later generations. In addition to the significant expansion of functionality and range, the package has also been changed, meaning that unfortunately there is no p2p replacement.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Peter is right, so making a new design with this sensor is silly. If you want a sensor with similar capability - have a look at the VL53L4CD. That is a part that is easy to use, has great documentation and really does work better. 

But if you are a hobbyist or student, and you just want to get this working, you missed a step. 

You really have to initialize the sensor by sending it about 20 or 30 bytes of data and then telling the sensor to 'start'. It's a write command to the 'go' register. 

Easiest thing to do is go to GitHub and look for working code. There is quite a bit. Find a project that works and do what they did. You might even find a project with your same MCU.

- good luck

- john

If this or any post solves your issue, please mark them as "Accept as Solution". It really helps the next guy.
And if you notice anything wrong do not hesitate to "Report Inappropriate Content".
I am a recently retired ST Employee. My former username was John E KVAM.