HS1101 Relative Humidity Sensor
chris jones
Posts: 391
Hello
i am not sure if anyone will help me but i can at least try. [noparse]:([/noparse]
is there anyone that can help me read a HS1101 Relative Humidity Sensor and read it from my terminal.I dont know how to even start it only has a ground and send pin and i dont know how this works without a power pin.
Thanks in advance
i am not sure if anyone will help me but i can at least try. [noparse]:([/noparse]
is there anyone that can help me read a HS1101 Relative Humidity Sensor and read it from my terminal.I dont know how to even start it only has a ground and send pin and i dont know how this works without a power pin.
Thanks in advance
Comments
Have you read this document?
http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/27920-HS1101-v1.0.pdf
Jim
humidity = (time – RHconstant) / 24
I'm unsure if you are using a Basic Stamp or Propeller?
Jim
' {$PBASIC 2.5}
' RelativeHumidityReading.bs2
' Displays relative humidity in the Debug Terminal or the Parallax Serial LCD.
LCD PIN 0 ' Serial output to LCD
time VAR Word
humidity VAR Word
LcdBaud CON 84 ' Baud rate of LCD
RHconstant CON 12169 ' Relative Humidity Constant * 10
LcdCls CON $0C ' Clear LCD (use PAUSE 5 after)
LcdCR CON $0D ' Move pos 0 of next line
LcdBLon CON $11 ' Backlight on
LcdBLoff CON $12 ' Backlight off
LcdOff CON $15 ' LCD off
LcdOn1 CON $16 ' LCD on; cursor off, blink off
LcdLine1 CON $80 ' Move to line 0, position 0
LcdLine2 CON $9A ' Move to line 1, position 5
HIGH Lcd ' Setup serial output pin
PAUSE 100
SEROUT Lcd, LcdBaud, [noparse][[/noparse]LcdOn1] ' Initialize LCD
PAUSE 250
SEROUT Lcd, LcdBaud, [noparse][[/noparse]LcdBLon] ' Turn Backlight on
PAUSE 5
SEROUT Lcd, LcdBaud, [noparse][[/noparse]LcdCls] ' Clear LCD
PAUSE 5
DO
HIGH 7
PAUSE 1
RCTIME 7, 1, time
time = time * 10
humidity = (time – RHconstant) / 24
' Debug Display:
DEBUG HOME, "Relative Humidity = ", DEC humidity, "%"
' LCD Display:
SEROUT Lcd, LcdBaud, [noparse][[/noparse]LcdLine1, "RelativeHumidity",
LcdLine2, DEC humidity, "%" ]
PAUSE 100
LOOP
Jim
http://forums.parallax.com/showthread.php?p=867134
You should be able to use it to convert the BS2 code. RCTIME is included. It doesn't have the LCD command, but you could use the Parallax Serial Terminal, (PST), instead of DEBUG to start with for the output.
Jim