1 Reply Latest reply on Dec 11, 2018 10:56 PM by MoTa_728816

    I2C Temperature and Humidity Sensor (SHT31)


      One day, the ad of this sensor appeared on my web browser again and again.

      When I read the description it seemed to be interesting, so I ordered my Digi-Key account a couple of this sensors.

      The price of the sensor was about $9.00, so $18.00 for two, but the shipment costed me more than that.

      A few weeks later, at Akizuki in Akihabara, I found a module of this sensor being sold about $9.00.  orz


      Anyway, I wrote a simple test program for this, the hardest part was calculating the CRC value.




      I used MSS (Marubun Sensor Shield) to provide I2C signal pull-ups.

      I could have used a couple 10K resistors, but this was easier.

      (Refer to the schematic below)



      Since the sensor is connected via I2C, SDA and SCL must be pulled up.

      And I connected the PIN 4 (ADR) of SHT31 to GND, so the slave address is 0x44.



      At the first loop, since the register values were not assigned the result were 0x0000 and 0xFFFF.

      But from the second loop, the sensor reports reasonable values.