ToF laser sensor with I2C display

I think I already know the answer to this but I'm asking anyway. The VL53L0x laser sensor uses I2C, and so does the OLED screen I want to use with it (SSD1306). I'm using a Nano with only one set of SCL SDA pins. My guess is I'll have to use a screen with an SPI interface? Or can two devices run off one set of I2C pins???

The I2C bus is for many devices. Each device listens only to its own I2C address.

A Arduino Nano is a 5V Arduino board with a 5V I2C bus.
A OLED display runs at 3.3V, and OLED displays are know to disturb the I2C bus for others.
As far as I know, only the Adafruit OLED boards are made compatible with 5V signals.
The VL53L0x is a 3.3V sensor, but there are also cheap modules with I2C level shifters.

You might want to read my notes about a I2C bus.

A SPI interface is also often with 3.3V signals. You may not connect the Arduino Nano to such a device.

You could give links to what you want to buy and make a schematic, so we can check if that is okay.

I2C is a bus and is intended to support many devices in parallel.

Each device must have a unique I2C address, but there are 127 of them so conflicts are rare.

Always use a level shifter interface when connecting 5V and 3.3V devices.

Thanks guys!
I have this oled screen now and it works fantastic on 5v, I've uploaded the library and it works perfect. Filmore 128x32
I have these laser sensors which also work great on 5v, I've uploaded the library and it works perfect (ToF) Laser Ranging Sensor 2.8-5V
I just haven't put these two devices on the same Nano yet because of my confusion on the capabilities of the I2C bus.

@Kopel I'll read up on your link, thanks for the info!

Those VL53L0x modules are okay.
On the back is a 3-pin black smd component, that is the voltage regulator.
The 6-pin black smd component are the mosfets for the I2C level shifter.
The "103" are the pullup resistors around the I2C level shifter.
That module is indeed compatible with a 3.3V and 5V Arduino.

Those OLED displays are not from Adafruit, so the I2C bus is probably not meant for 5V signals.
They are sold as 3-5V, because there is no smoke coming out of them when connecting them to a 5V I2C bus.
Keep in mind that they disturb the I2C bus for others and that your I2C bus might be working, but not in a good way.

@Koepel
Thanks again for all the info. I opted to use the 3.3v side of the Nano to power both components, and my luck there was already a sketch for both components. It fired up first try. Accuracy is another topic. :confused:

This is not about powering the modules, this is about the I2C bus.
You have a I2C bus with 5V levels on one side and a I2C bus with 3.3V levels on the other side.
The Arduino Nano has internal pullup resistors that pulls SDA and SCL a little towards the 5V. It can be enough to damage very sensitive modern sensors, especially when they are in sleep mode and use no current.

My notes about a I2C bus is about the I2C bus.

The VL53L0x module should be powered with 5V to VIN of that module, or else the I2C level shifter does not work.
Since the Arduino Nano has a 5V I2C bus, the level shifter on that module should do its work and translate that to a 3.3V I2C for the VL53L0x. That is only possible if you power it with Arduino 5V to VIN of that module.

The SDA and SCL pins of the OLED should be connected to a 3.3V I2C bus. If you connect them to a 5V I2C bus, then you can expect troubles. Since it has a onboard voltage regulator, you can power it with 5V or 3.3V, it still has a 3.3V I2C bus. I think it is dimmer with 3.3V.

Please note that all this trouble and pain and confusion and endless discussion is gone in an instant, the very moment you decide to use a 3.3V Arduino board.

The Arduino team should use the new RP2040 processor for a 5 dollar Arduino board that runs at 3.3V and can replace the Arduino Uno. They made the MKR boards too expensive and I'm afraid that they go totally over the top with the RP2040 and add a ESP32 for Wifi. If they really do that, then I advice others to use a ESP32 in Arduino-compatible mode because that is so much better.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.