Unable to connect to the Humidity Sensor on the MS8607

I have an MS8607 (https://www.sparkfun.com/products/16298). Using the qwiic_i2c python library (https://qwiic-i2c-py.readthedocs.io/en/ … index.html), I am able to connect to the pressure/temperature sensor at 0x76. However, I am unable to connect to the humidity sensor at 0x40. I also added a micro-OLED to confirm that I could address that properly.

Here is the code that I am using.

import sys
import qwiic_i2c

OLED_I2C_ADDRESS: int = 0x3d
PT_SENSOR_I2C_ADDRESS: int = 0x76
H_SENSOR_I2C_ADDRESS: int = 0x40

def eprint(*args, **kwargs):
    """Print to stderr."""
    print(*args, file=sys.stderr, **kwargs)

def test_connection(address: int, name: str) -> None:
    """Test the I2C connection for a device.
    """
    print(f"Try to connect to the {name} on {address}...")
    if qwiic_i2c.isDeviceConnected(address):
        print(f"{name} is connected")
    else:
        eprint(f"{name} is not connected")


def main() -> None:
    """Test the Ms8607."""
    test_connection(OLED_I2C_ADDRESS, "OLED")
    test_connection(PT_SENSOR_I2C_ADDRESS, "PT Sensor")
    test_connection(H_SENSOR_I2C_ADDRESS, "H Sensor")

if __name__ == "__main__":
    main()

The output from the code is

Try to connect to the OLED on 61...
OLED is connected
Try to connect to the PT Sensor on 118...
PT Sensor is connected
Try to connect to the H Sensor on 64...
Error connecting to Device: 40, [Errno 121] Remote I/O error
H Sensor is not connected

I ran ```
i2cdetect -y 1


❯ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – 3d – –
40: 40 – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – 76 –


Any thoughts? Is it possible that the humidity sensor is defective?

Thanks,

Chuck

Although the datasheet indicates 400Khz should be possible, try a lower speed. e.g. 100Khz

Sorry for the delay. I just saw your reply.

I tried decreasing the i2c_arm_baudrate to 100000. I updated the /boot/config.txt with the following and rebooted the Rpi.

dtparam=i2c_arm=on,i2c_arm_baudrate=100000

Unfortunately, I am still unable to connect to the relative humidity sensor. Do you have any other suggestions that I can try?

Thanks,

Chuck

I would try double checking the continuity between your connections first, since that’s the easiest fix. Are you able to try using the sensor with an Arduino or another micro-controller to check if the sensor isn’t defective?

I have done the following:

  • Disconnected and reconnected the I2C wires.

  • Tried using both I2C ports on the sensor.

  • Tried an alternative I2C port on the Qwiic pHat.

Also, I do want to point out that I am able to communicate with the pressure/temperature sensor without any issues. It is only the humidity sensor which is returning the 121 error.

Error connecting to Device: 40, [Errno 121] Remote I/O error

I have an older Arduino laying around somewhere. However, I do not have the hardware to connect to the sensor via I2C.

I am reasonably sure that the humidity sensor is defective. I am going to order another sensor. When it arrives, I will test connectivity to both addresses. If all is good, can I return the first sensor? If so, how do I go about doing that?

Thanks,

Chuck

When you verify that you need a return, please visit https://www.sparkfun.com/returns to file an RMA request. Please link this forum post in the details of the RMA request.

Unfortunately, the new sensor exhibits the same error when I test the connection. Do you have any other thoughts on what I can do to get the connection to the humidity sensor working?

At this point there could be a compatibility issue with the sensor and Raspberry Pi. I would suggest, when you can, to try and use an Arduino or other micro-controller to try that option.

Just to close the loop on this. I dug out a Photon Redboard and was able to get the sensor working with [this library.

It would be good to understand why communication via the Raspberry Pi did not work. However, I don’t expect to be able to spend much more time on that, right now.

Thanks for your help.](GitHub - PaulZC/Qwiic_PHT_MS8607_Library: Arduino library for the TE MS8607)

My apologies that the Raspberry Pi and MS8607 sensor didn’t play nice. Since this is an experimental product, I’ll let our internal teams know of your feedback. Thank you and I’m glad you’re able to use the sensor with your Photon RedBoard.