How to connect multiple SGP30s to one board

Well, I ran into a situation where I need to connect 4 SGP30 sensors to a single Arduino.
They all have the same address, meaning I can’t connect all of them to the hardware I2C bus.

But I don’t have SGP30 sensors, thus I use Si7021 just to test if software I2C works. If it works on a single Si7021, then maybe I can conclude that it also works with 4 SGP30s.

The problem is, I came across quite a few software I2C libraries compatible with TwoWire’s interface (and modified Si7021 library to use software implementations, of course), none of them work. All of them fails to read from sensor (all read back 0 or 255).

Can someone help finding a working library or testing multiple SGP30s connected to one board and getting them working? My deadline is on Saturday, any help is greatly appreciated. Need more information, just ask.

This is your post #30. You can do better. :slight_smile: Please read the "How to post". Its at the beginning of each sub forum.

  • Please post links to non-Arduino component datasheets. Show us you might have looked at it and saves time for everyone who likes to help you.

  • Also which Arduino are you using?

  • Post links to libraries (e.g. on Github) you are using.

Klaus_K:
This is your post #30. You can do better. :slight_smile: Please read the "How to post". Its at the beginning of each sub forum.

  • Please post links to non-Arduino component datasheets. Show us you might have looked at it and saves time for everyone who likes to help you.

  • Also which Arduino are you using?

  • Post links to libraries (e.g. on Github) you are using.

Thanks for reminding! :slight_smile:

I'm on an Arduino Uno.

Well I guess datasheet here:

Sensor and library:

Software I2C Libraries I tried:

You can try this library - GitHub - bitbank2/BitBang_I2C: A software I2C implementation to run on any GPIO pins on any system

Another approach is to connect all Si7021 to the same HW I2C lines but power them from digital pins. So you will be able to have only one active device on I2C bus and then switch to another.

alesam:
You can try this library - GitHub - bitbank2/BitBang_I2C: A software I2C implementation to run on any GPIO pins on any system

Another approach is to connect all Si7021to the same HW I2C lines but power them from digital pins. So you will be able to have only one active device on I2C bus and then switch to another.

THANK YOU SO MUCH! I just thought about simulating protocol, never had the idea to control the power of each sensors. I think this approach may really do the trick. I will try later.

As for that library, well, actually I have seen it before, but it's not compatible with TwoWire interface and I just don't know how to implement one from it.

Thank you again!

45gfg9:
..., never had the idea to control the power of each sensors. I think this approach may really do the trick. I will try later.

Make sure you do not set the heater to anything but the lowest level when you directly power the sensor with an I/O pin. The heater can draw up to 95mA. If you need that feature you will need to use an external transistor.
Without the heater the maximum current of the sensor seems to be during power up and I2C operations (max 4mA).

Hold on... It seems like even if the sensor is not powered, it still interferes with I2C bus. When I connect four to the bus (and only one of them is powered), I can't get any of them initialized. But if it only connects to one sensor it functions normally. Damn, I wish I have an oscilloscope but I don't. I guess maybe there is really no other ways...?