Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

I2c Address conflict with Datalogging Shield and K30 CO2 Sen
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

I2c Address conflict with Datalogging Shield and K30 CO2 Sen

by Katie_UR_oceanlab on Tue Dec 07, 2021 4:55 pm

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&hilit=I2c+and+datalogging#p206706
viewtopic.php?f=31&t=76066&hilit=I2c+and+datalogging
Hardware:
CO2 sensor: https://www.co2meter.com/products/k-30- ... BSEALw_wcB

TYIA

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

Re: I2c Address conflict with Datalogging Shield and K30 CO2

by adafruit_support_mike on Wed Dec 08, 2021 10:51 pm

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.

adafruit_support_mike
 
Posts: 63949
Joined: Thu Feb 11, 2010 2:51 pm

Re: I2c Address conflict with Datalogging Shield and K30 CO2

by Katie_UR_oceanlab on Mon Dec 13, 2021 4:38 pm

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 181 times

This seems like a great solution after reading the overview and tutorial for the breakout. Thank you

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

Re: I2c Address conflict with Datalogging Shield and K30 CO2

by adafruit_support_mike on Tue Dec 14, 2021 3:13 am

Yes, those are the connections you want.

adafruit_support_mike
 
Posts: 63949
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.