Home        Store        Learn        Blog

Multiple Celsius Fast-Response Temperature Sensors with Multiplexor

Hi, I’m trying to implement two seperate celsius fast-response temperature sensors with my raspberry pi 3 by using the tca9548a i2c multiplexor.

I’m using python and was able to get one temperature sensor working (while hooked up directly to the raspberry pi).

However, I haven’t been able to get it to work through the mux, here is the code I’m using:

And here is the example code I tried to base my code off of:

And here is a picture of the errors I’m getting:

I should add that I’ve been able to detect the mux over i2c and have gotten the mux to work with another adafruit IMU. So I’m wondering if I’ve messed up something in the code or if the mux just isn’t compatible with the BlueRobotics temperature sensor?

Hopefully I provided enough information on my situation and any help is greatly appreciated, thank you.

Update: So I’ve been able to detect two Celsius Fast-Response Temperature Sensors through the tca9548a multiplexer. Additionally I’ve been able to get a reading from both and verified that it’s coming from each individual sensor. My only problem now is that I can only grab one reading from each one before I receive an error. (Cannot construct a working loop to get continuous readings)

The new code I have:

The new error:

Hi Peter,

It looks like you were on track with your commit on March 24, there is just a small typo.

The following line:
tca = adafruit_tca9548a.TCA9548A(I2C)

should read:
tca = adafruit_tca9548a.TCA9458A(i2c)

The first line is referencing the I2C class within busio and the second is the i2c object that you just created.

Let me know if that sorts it out!

Ryan

Hi, thanks for the reply!

Unfortunately I’m still receiving the same error as the one I posted first. I tried to just get a single sensor to work but still no success.

*It flagged my post and says I’m unable to post a link to github, is that not allowed?

I reached out to adafruit and they said the problem has to do with tsys01.py

When I linked them the file the response was:

“That code is expecting an I2C bus number, not an actual I2C bus. So it probably won’t be usable with our TCA library as is.”

Is there a way to fix this?

@CaptainPivo did you get it working?

I’m guessing a lot here (I haven’t looked closely at adafruits library), but maybe you could change this line to self._bus = bus so the constructor can receive the bus itself instead of its number.

Hi, thanks for the reply.

I was able to get the sensors working but through a different method. I followed this guide and setup additional I2C buses:

I’ve since run into a new issue, however it has to do with the Adafruit LSM6DS33 IMU. I have the IMU connected to default bus 1 and the sensors connected to the created buses 3 and 4 (on the GPIO pins). I can detect the IMU but it will no longer initialize.

If you have any idea to a solution for this that would be great! Otherwise I understand if you don’t and will reach out to adafruit as well.