[SOLVED] I2C problem when connected in parallel

I have built a homemade I2C hub by connecting four Grove connectors in parallel. This works fine if I connect, it to the ESP32 I2C pins (21-SDA, 22-SCL, Ground and 3.3V), and if I connect a I2C device, for instance a RC522 RFID, to my hub and run an i2cScan script I can see the I2C address of the RC522 device (0x28).

Now to the problem, if I then connect an Adafruit_SSD1306 OLED display to the hub it is also detected with the address 0x3c but I cannot use the OLED whilst connected to the hub. It works ok on its own connected directly. if I remove the RC522 RFID from the hub and run the i2cScan script the OLED screen is no longer detected.

Does anyone have an idea of what might be happeng here?

Edit: The problem was a bad Adafruit_SSD1306 OLED display. It always displayed its address for a scan but the display itself only worked intermittently.

Sorry for any confusion caused by my use of the term "hub" for a chain of Grove I2C connectors, I couldn't post a diagram as I was working from a mobile phone without a drawing app. Perhaps it might be worthwhile to actually define what a I2C Hub actually is, in my case it was simply using Grove connectors rather than connecting via a breadboard using Dupont cables.

Anyway thanks for taking the time to help!

Yes, your homemade I2C Hub doesn't work. But since you've shared nothing of its design, there's not much else to be said.

I2C is a bus, and can theoretically have up to 127 devices (with different addresses)
Have you tried connecting RC522 RFID and SSD1306 OLED display directly to 21-SDA, 22-SCL (without the hub)?

I told you everything about its design, I wrote "I have built a homemade I2C hub by connecting four Grove connectors in parallel."

What more do you need to know?

I didn't think it necessary on this forum to exxplain in detail what "in parallel" means but If you don't know, it means pin1 on connector 1 to pin1 on connector 2 to pin1 on connector 3 to pin1 on connector 4 and the same with the other connector pins.

If you still don't know what the problem might be, please feel free not to answer the question.

Yes, there seems to be an issue with the I2C bus generally on my ESP32. Sometimes it works and sometimes it doesn't. I will experiment futher with a Uno and a few other devices when I get time.

No need to get snippy.

A hub might be more than brain-dead parallel connections of a few signal lines.

Why do you need a "hub"?

Have you tried hooking up the two I2C devices in the traditional manner, that is to say just wire them to the bus w/o any mechanical or otherwise "hub"?

a7

Hi,
Do you have pull up resistors on the SDA and SCL lines?

Can you post some images of your project?
So we can see your component layout.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

1 Like

Need to see a schematic of how you wired it up. Word salad does not cut in in electronics.

It is something being considered by many contributors right now.

2 Likes

why do you think you need a hub?

i2c-schema

So that is what @steveinaustria has done, just paralleled up the connections, no active components.

@steveinaustria what supply voltages do the two I2C peripherals work off?

Tom... :smiley: :+1: :coffee: :australia:

1 Like

gfvalvo's reply to me was snippy. And I wrote in the OP that the "hub" was four Grove connectors in parallel. The only reason for using the term "hub" was to simplify the question by not repeating "four Grove connectors in parallel" instead of "hub" whilst refering to it in the question.

They work off the VCC 3.3v from the ESP32. I think this could be the problem.

Have you measured the 3V3 when you have the problem?

Tom... :smiley: :+1: :coffee: :australia:

Have you tried hooking up the two I2C devices in the traditional manner, that is to say just wire them to the bus w/o any mechanical or otherwise "hub"?

a7

No, I will do that. In the meantime here is a photo of the ESP32 and its Dev Board. I am using the the I2C pins in the bottom right (D22,D21,VCC,GND) above the power connector for the connection to my chain of Grove connectors (I have given up calling it a "Hub"
image|375x500

The VCC can also be set to 5v via a jumper.



Something like this $2 Sparkfun hub? Does yours have pull up resistors or any additional components?

As I wrote in the OP, I simply chained four Grove connectors in parallel and called it a "hub" as it was easier to explain the issue using the small word "hub" rather than "the four Grove connectors connected in parallel" five or six times in the explanation.

I certainly regret using the term "hub" now because some members here have got thoroughly confused and misled by the term, even though the term "hub" is not incorrect used in this way and there are many "hubs" available which are simply chains of connectors in parallel, for example GRV I2C HUB: Arduino - Grove I2C-Hub bei reichelt elektronik

Actually the easiest way to explain is to post a schematic diagram, the "language" of electronics.

5 Likes

This is an I2C Hub.