I have a HTU21D (temp/humidity sensor) and a CJMCU-811 (CO2/TVOC sensor) on the same I2C bus. The HTU21D is giving high temperature (+ ~7 ºC) and low humidity (- ~10%) values compared to another (supposedly) correct test instrument. A multimeter thermometer agrees with the test instrument. If I take the CJMCU-811 off the bus, the HTU21D temperature reading is more or less the same as the multimeter. What’s going on?
https://wiki.liutyi.info/download/thumb … 620&api=v2
The pull-up resisters on the HTU21D data pins seem to be disconnected, ie, there is no solder blob. With both devices installed on the bus, the Vcc-SDA and Vcc-SCL resistances are about 1.5K. I was expecting them to be 4.7K. I can’t see why this would be affecting the measurement, since the IC output is digital, but it goes against my understanding of what those resistors are for, to limit the current to the data pins. I read that you only need them when the device is the alone on the bus. Should I connect them?
As far as I know, the 4.7K pull -up resistors must be connected between the SDA and VCC; and SCL and VCC. If the module has these pull up resistors, no extra resistors are needed. From your writing, I understand that your module has these 4.7K resistors, but they are disconnected. I think you’d better perform a test. No need to solder your board at first. Take two 4.7K resistors and connect them between SDA-VCC and SCL-VCC and see if there is any improvement in the result.
Thanks for the suggestion and quick response. I breadboarded an i2c circuit with the two sensors, without 4.7k pull-ups, and found that the HTU21D value improved, with a difference of about only +1ºC from the multimeter reading. Adding pull-ups didn’t make a significant change. I wonder if the heater in the CJMCU-811 is the issue. In the operational position of the circuit board, the HTU12D is above the CJMCU-811, convectionally-speaking. Before changing the layout I’ll try a CJMCU-811 mode or sample rate that has the heater on less.
I changed the CJMCU-811 sample rate to once a minute, no change, still a few degrees too high, and anyway it seems unlikely to me that the CJMCU-811 heater is raising the local temperature so much. So there’s something going on in the i2c processing, since the HTU12D works fine without the CJMCU-811. Like other i2c CO2 sensors the CJMCU-811 requires clock stretching (which raspberry pis don’t support, so to accommodate the CJMCU-811 you have to add a /boot/config.txt overlay that reduces the i2c clock rate.) I’ll put the CJMCU-811 on another i2c bus and see what that does.