Hello all,

I have been using SHT11 and Tracy Allen's code for some time. I recently got a SHT21 and found the conversion does not work.

I found this on the Basic Stamp Forum:

Just to compare in red and blue, the formulae for the SHT2x:
°C = -46.85 + 175.72 * rawT / (2^resT) resT is 14 bits default
%RH = -6 + 125 * rawH / (2^resH) resH is 12 bits default
res = resolution, tradeoff with speed, set in the user register.

with formulae for SHT1x:
°C = -40.1 + 0.01 * rawT on 14 bit setting and 5V supply
%RH1 = -2.0468 + 0.0367 * rawH - 1.5955E-6 * rawH^2 on 12 bit setting
then temperature compensation
%RH = (°C - 25) * (.01 + 0.00008 * rawH) + RH1
The SHT1x too has both high and low resolution modes.
Does anyone else use a SHT21 and what does the code actually look like?

Thanks in advance

Mike2545