Shop OBEX P1 Docs P2 Docs Learn Events
HS1101 Relative Humidity Sensor — Parallax Forums

HS1101 Relative Humidity Sensor

chris joneschris jones Posts: 391
edited 2010-06-25 17:06 in Propeller 1
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

Comments

  • hover1hover1 Posts: 1,929
    edited 2010-06-24 23:26
    Chris,

    Have you read this document?

    http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/27920-HS1101-v1.0.pdf

    Jim
    chris jones said...
    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
  • chris joneschris jones Posts: 391
    edited 2010-06-24 23:40
    yes i have to pull my basic stamp board out but it does not state what the signal pin needs to be hooked to
  • chris joneschris jones Posts: 391
    edited 2010-06-25 00:28
    i see it says hook it to pin 7 i read the full document but when i run the code on my basic stamp it says
    humidity = (time – RHconstant) / 24
  • chris joneschris jones Posts: 391
    edited 2010-06-25 00:28
    sorry it says undefined symbal -
  • hover1hover1 Posts: 1,929
    edited 2010-06-25 00:49
    Have you connected likethis:

    I'm unsure if you are using a Basic Stamp or Propeller?

    Jim


    chris jones said...
    sorry it says undefined symbal -
  • hover1hover1 Posts: 1,929
    edited 2010-06-25 00:52
    Could you post your code?
    chris jones said...
    sorry it says undefined symbal -
  • chris joneschris jones Posts: 391
    edited 2010-06-25 02:20
    its just the demo code form the documentation and yes hover i do have a propeller and with i could hook it up on that first. but i wanted to show you i am trying so i pulled out the basic stamp to see if the code from the documentation works.
  • chris joneschris jones Posts: 391
    edited 2010-06-25 02:21
    ' {$STAMP BS2}
    ' {$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
  • hover1hover1 Posts: 1,929
    edited 2010-06-25 11:06
    The Basic Stamp Editor did not like the minus sign in the line. I deleted it and then added it again and the sytax check worked fine.

    Jim
    chris jones said...
    i see it says hook it to pin 7 i read the full document but when i run the code on my basic stamp it says
    humidity = (time – RHconstant) / 24
  • chris joneschris jones Posts: 391
    edited 2010-06-25 15:25
    ok i ran it and it worked so will this work the same in the propeller lang not the basic stamp code but the concept
  • hover1hover1 Posts: 1,929
    edited 2010-06-25 17:06
    That's good news Chris. I would suggest you start with PropBasic for the Propeller:

    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
    chris jones said...
    ok i ran it and it worked so will this work the same in the propeller lang not the basic stamp code but the concept
Sign In or Register to comment.