I2c Address conflict with Datalogging Shield and K30 CO2 Sen

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Katie_UR_oceanlab
 
Posts: 9
Joined: Thu Jul 15, 2021 3:51 pm

I2c Address conflict with Datalogging Shield and K30 CO2 Sen

Post by Katie_UR_oceanlab »

Hello,

I've looked at some of the previous posts on this topic (below) but I do not have a clear answer / plan of action to tackle my problem. I am building a suite of gas sensors , 2 of which use I2c communication. The overall configuration is an Arduino Mega Board stacked with an Adafruit datalogging shield, stacked with the Uno expansion shield (for the convenience of 2 I2C inputs). So there are three I2c devices involved- the oxygen sensor, the CO2 sensor and the RTC on the datalogging shield. The oxygen sensor has 4 address options , ranging from 0x70- 0x73. This works fine with the Datalogging shield alone, and with the CO2 sensor alone. The issue is between the Datalogging shield and CO2 sensor. The CO2 sensor has a default address 0x68 and according to a prior post in this forum that goes for the RTC on the shield as well. There wasn't a post I could find which references the most up to date Datalogging shield (I purchased in 2020), so I am wondering if there is any way to change the address on it or work around this problem? Alternatively, can I change the address on the sensor? I could not find anything on it in the documentation provided with the sensor.

If the answer to both of these things is no, is there any suggestion for how I can still save time stamped data for this CO2 sensor?

Also, in the sensor documentation you can see there is a way to wire the sensor using a UART interface instead, but it is my understanding that you cannot run UART and I2c on the same board?

Post links:
viewtopic.php?f=31&t=41636&p=206706&hil ... ng#p206706
viewtopic.php?f=31&t=76066&hilit=I2c+and+datalogging
Hardware:
CO2 sensor: https://www.co2meter.com/products/k-30- ... BSEALw_wcB

TYIA

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: I2c Address conflict with Datalogging Shield and K30 CO2

Post by adafruit_support_mike »

There's no way to change the RTC's I2C address, but if you're willing to add a bit of wiring you can use a TCA9548A I2C multiplexer:

https://www.adafruit.com/product/2717

It solves the duplicate-address problem by putting devices on separate channels. The RTC can live on channel 1, and the CO2 sensors can live on channel 2, for instance. You can only talk to one channel at a time if they have devices with an address conflict, but that shouldn't be a deal-breaker for the application you described. You can get a time reading from the RTC, then swap channels and get the CO2 readings. The delay will be a few milliseconds.

The down side is that you'll need to connect the RTC to one of the TCA9548A's output channels instead of using the connections provided by the Shield.

You can do that by cutting the traces between the inner and outer holes for the SDA and SCL signals on the shield, then wiring jumpers from the inner holes to the TCA9548A.

User avatar
Katie_UR_oceanlab
 
Posts: 9
Joined: Thu Jul 15, 2021 3:51 pm

Re: I2c Address conflict with Datalogging Shield and K30 CO2

Post by Katie_UR_oceanlab »

Thank you @Mike,

So I will sever the connection between inner/outer pins where the red lines are? And then wire according to the green? (see attached photo)
forumquestion_multiplexer.JPG
forumquestion_multiplexer.JPG (188.42 KiB) Viewed 358 times
This seems like a great solution after reading the overview and tutorial for the breakout. Thank you

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: I2c Address conflict with Datalogging Shield and K30 CO2

Post by adafruit_support_mike »

Yes, those are the connections you want.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”