VL6180x GPIO0/CE voltage

Can I plug GPIO0/CE directly on an Arduino Uno or do I need to use a logic shifter to reduce the voltage to 2.8v ?

Hello.

The GPIO0/CE pin on our carrier board is not level shifted and is not 5V tolerant. It should be possible to use the pin with an Arduino Uno without a level shifter so long as your code does not actively drive the pin to 5V (or attempt to use the Uno’s internal pull-up resistors). There is a pullup resistor on the carrier board that will hold the pin at 2.8V if no external voltage is applied, so the default state of the pin will be logic high if your code configures the attached Arduino Uno pin as an input. You can configure an attached Arduino Uno pin as an output so long as you are only driving the pin low.

-Nathan

Thanks for the detailed and fast answer. :slightly_smiling_face:

1 Like

In case, it can be useful for someone, here is how I change I2C address for 3 VL6180 sensor.

#include <Wire.h>
#include <VL6180X.h>

const int standBySensor1 = 5;
const int standBySensor2 = 4;
const int standBySensor3 = 3;

VL6180X sensor1;
VL6180X sensor2;
VL6180X sensor3;


void setup() {
  // Source: https://forum.pololu.com/t/vl6180x-gpio0-ce-voltage/
  // DO NOT PUT STANDBY PIN HIGH

  //Set all Sensor to Standby
  pinMode(standBySensor1, OUTPUT);
  pinMode(standBySensor2, OUTPUT);
  pinMode(standBySensor3, OUTPUT);
  digitalWrite(standBySensor1, LOW);
  digitalWrite(standBySensor2, LOW);
  digitalWrite(standBySensor3, LOW);

  //Start Sensor1
  pinMode(standBySensor1, INPUT);
  delay(50);
  sensor1.init();
  sensor1.setAddress(0x30);
  sensor1.configureDefault();
  sensor1.setTimeout(500);

  //Start Sensor2
  pinMode(standBySensor2, INPUT);
  delay(50);
  sensor2.init();
  sensor2.setAddress(0x31);
  sensor2.configureDefault();
  sensor2.setTimeout(500);

  //Start Sensor3
  pinMode(standBySensor3, INPUT);
  delay(50);
  sensor3.init();
  sensor3.setAddress(0x32);
  sensor3.configureDefault();
  sensor3.setTimeout(500);
}

void loop(){
}