Can't get two SHT31's to run at the same time


I’ve been trying to set up two SHT31’s with no success.

Mylogs says there’s an ERROR 101.

I’ve tried different i2c bus’s and addresses and enabled Log Level Debug for both sensors. And nothing…

I’ve also tried the additional SDA0 & SCL0 (27 & 28) pins along with different voltage and ground pins too. But they don’t seem to work at all or I just don’t know how to get these to work.

The two SHT31’s do work on their own. But when I connect both to the pi nether of them work at all.

I also have another i2c sensor attached which runs fine alongside, but has also stopped reading sometimes when I attach both SHT31’s (which has usually meant I’ve had to detach & reattach the it to get it to work again).

Have you tried using the SHT31 Input (using the circuitpython library)? I have several systems using two SHT31 sensors simultaneously, using each of the unique addresses available.

Yes, I’ve tried all the libraries with the different avaliable addresses and nothing. It’s seems they don’t like sharing the same circuit. Because as soon as I have two of the sensors wired in, all the live readings of the one that was displaying go to zero and then returns when I detach a wire for either one of the sensors displaying the readings for whichever one is attached.

These are the sensors I’m using.

It sounds like you haven’t set then to different addresses.

What do you mean by different addresses?

Every single device attached to the I2C buss needs to be set with it’s own unique hex address. Much the same way that all devices attached to a TCP/IP network all have unique MAC and IP addresses.

Some I2C devices are permanently set with only one address, which means that you can not use 2 of those devices on the same I2C buss without causing a conflict. You will need to use an I2C multiplexer with these hard-coded devices in order to use more than one on the same I2C buss.

Other I2C devices can be programmed with 2 or 3 different addresses by using a set of solder pads or “jumpers” somewhere on the circuit board… soldering, or connecting these jumper pads together will change the factory set address to a different pre-determined address. Devices like this can be used at the same time on the same I2C buss as long as they have been set to different addresses.

All I2C devices have a pre-determined address unique to that specific device.
For instance, an SHTC3 sensor will always have the address of 0x70 (no jumper selection, you are stuck with only one address and one device per I2C buss without using a multiplexer)
A BME280 will always use either 0x77 or 0x76 (depending on the jumper selection, you can only use 2 of these sensors on an I2C buss at the same time without a multiplexer)

1 Like

Wow, thanks that was really helpful :grinning::+1:. It looks like I could get another address with some soldering on the sensor pcb itself but I hesitate to open up the housing to access it. So multiplexer it is.

I bought a cheap five pack of TCA9548A’s from amazon yesterday but I’ve been having trouble getting them to work as well, any tips?

I did find some information on here and other places but have yet to successfully set it up. I think the main issue is with installing/activating a library. I did attempt one where you cut & paste a bit of code to the boot/config.txt file on the micro SD card but I’m not sure if I did that correctly (well it didn’t work at least). There were also a few other recommended libraries but I’m not sure how to install them…

I think what you’re looking for is here…

Also good info to know before you buy hardware…

1 Like