Sht11 config issue

I'm trying to use an SHT11 with a prop mini and sensirion_full code from the object exchange. Both my temp and Rh are reading high (10+ deg temp and 30+% Rh). The code seems optimized for a 3.3V circuit but I am using a 5V circuit. I changed the voltage call out in the SHT config line to 50, but that didn't seem to affect anything. I did try bringing the voltage down to 3.3V and managed to get an acceptable temp reading but the Rh reading was still way high. I think I am missing some other variables that need to be changed, but I don't understand the code enough to know which ones. I was going to try Thomas Allen's sensirion_integer code since it looks simpler but the notes say that it assumes 3.3V and I didn't see where it change that. Can anybody point me to what I need to change to use this in a 5V circuit?

Comments

  • If you haven't done so already, try adding a capacitor (0.1µF) across the sensor power supply. Is the sensor mounted out away from the Propeller? If so, it needs a stronger pullup on the data line, and a weak pulldown on the clock line.

    There is not much difference between operating on 3.3V vs 5V. It only affects the temperature offset. In sensirion_integer, you will see constants defined at the top.
      T_OFFSET_5V0 = 4000
      T_OFFSET_3V3 = 3964
      T_OFFSET_3V0 = 3960
    
      T_OFFSET = T_OFFSET_3V3       ' <---- simply change this to the 5V0 value.
    
  • I haven't tried the capacitor yet. The sensor is about an inch from the Propeller. What is your definition of a stronger pullup resistor, more or less resistance?
  • Hmm, one inch shouldn't be a problem, but do try a 0.1µF capacitor really close to the chip. If it is mounted like the DIP module that Parallax used to sell or one of Andrew's twigs, it will already have a capacitor on board. A 3.3kΩ pullup should be fine. Also include a 10kΩ to 100kΩ pulldown on the clock line. Most of the time it will work without that, but occasionally it will fail to initialize properly if the power comes up dirty. The SHT11 protocol is sort of like i2c, but not, one thing is that the clock rests low instead of high.
Sign In or Register to comment.