Hi
I'm trying to read the i2c values from the HH10D and I am having some trouble. If I read from location 10, then I get:
1 114 29 205
I am unsure what to do next. According to the Silicon Chip article (using my values):
Sens = 1 * 256 + 114 = 370
Offset = 29 * 256 + 205 = 7629
These values differ slightly from SC's values of 341 and 7709. If I then use their code to determine RH%, I get 24% humidity. This isn't right! In my room, an old baro/thermo/hyrgometer reads about 41%. This is the code I use to calculate everything:
And this is the code I use to read the initial values:
Can anyone find fault with any of my code? Also, I should mention I am running on a 20X2. The sensor and axe both run off a pair of AAs @ 3.182volts. All of this is set up on a breadboard. The i2c pullups (4.7k) are fitted. My multimeter on frequency says the Fout pin is 6.86kHz.
I'm trying to read the i2c values from the HH10D and I am having some trouble. If I read from location 10, then I get:
1 114 29 205
I am unsure what to do next. According to the Silicon Chip article (using my values):
Sens = 1 * 256 + 114 = 370
Offset = 29 * 256 + 205 = 7629
These values differ slightly from SC's values of 341 and 7709. If I then use their code to determine RH%, I get 24% humidity. This isn't right! In my room, an old baro/thermo/hyrgometer reads about 41%. This is the code I use to calculate everything:
Code:
symbol humid = c.1
'Variables
symbol axefactr = b2
symbol Soh = w2
symbol diff = w3
symbol RH = w4
'Constants
symbol Offset = 7629
symbol Sens = 370
Main:
Count humid, 1000, Soh
diff = offset - Soh
axefactr = diff / 19 + 1
RH = 10 * diff / axefactr * sens
axefactr = 4096 / axefactr
RH = RH / axefactr
RH = RH / 10
sertxd ("RH% = ",#RH,cr,lf)
pause 5000
goto main
Code:
i2cslave %10100010, i2cfast, i2cbyte
readi2c 10, (b0, b1, b2, b3)
debug
Can anyone find fault with any of my code? Also, I should mention I am running on a 20X2. The sensor and axe both run off a pair of AAs @ 3.182volts. All of this is set up on a breadboard. The i2c pullups (4.7k) are fitted. My multimeter on frequency says the Fout pin is 6.86kHz.