HS1101 Humidity sensor calibration
lfreeze
Posts: 174
HUMIDITY HS1101 4 30 2012.spinI have been testing the HS1101 humidity sensor. I am getting results that seem reasonable, but I am not sure
if I have adjusted the math correctly. Has anyone got This sensor to work correctly with the propeller? If you have
please share the program, The sensor is reading between 38 and 45% humidity.I have
read most of the previous posts on this subject and this seems to be a common issue. I have attached the program I have been using
Thanks for any help you may offer
Larry
Sorry I can't seem to attach code correctly, here is the program
CON
_clkmode = xtal1 + pll16x ' use crystal x 16
_xinfreq = 5_000_000
OBJ
ser : "FullDuplexSerial"
PUB main | humidity
ser.start(31, 30, 0, 4800)
ctra[30..26] := %01000
ctra[5..0] := 2 '11
frqa := 1
repeat
dira[2] := outa[2] := 1
waitcnt(clkfreq/100_000 + cnt)
phsa~
dira[2]~
waitcnt(clkfreq + cnt)
humidity := (phsa - 12169)/3400 #> 0
ser.tx(13)
ser.str(String(" HUMIDITY = "))
ser.dec(humidity)
ser.str(string("%"))
waitcnt(clkfreq/2 + cnt)
if I have adjusted the math correctly. Has anyone got This sensor to work correctly with the propeller? If you have
please share the program, The sensor is reading between 38 and 45% humidity.I have
read most of the previous posts on this subject and this seems to be a common issue. I have attached the program I have been using
Thanks for any help you may offer
Larry
Sorry I can't seem to attach code correctly, here is the program
CON
_clkmode = xtal1 + pll16x ' use crystal x 16
_xinfreq = 5_000_000
OBJ
ser : "FullDuplexSerial"
PUB main | humidity
ser.start(31, 30, 0, 4800)
ctra[30..26] := %01000
ctra[5..0] := 2 '11
frqa := 1
repeat
dira[2] := outa[2] := 1
waitcnt(clkfreq/100_000 + cnt)
phsa~
dira[2]~
waitcnt(clkfreq + cnt)
humidity := (phsa - 12169)/3400 #> 0
ser.tx(13)
ser.str(String(" HUMIDITY = "))
ser.dec(humidity)
ser.str(string("%"))
waitcnt(clkfreq/2 + cnt)
Comments
math in the hs1101 program. I'm not sure if this is the best approach, I have set up one hs1101 with a stamp and the program provided by parallax.
I have set up a second hs1101 with a propeller and used the rcdecay counter program. I have tried many many variations of the propeller math but cannot
get a valid numidity number that will track with changes in the humidity.
Larry