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

Parallax HS1101 Humidity Sensor

xanaduxanadu Posts: 3,347
edited 2013-07-23 20:15 in Accessories
I'm using this sensor and the demo come it comes with on a *semi-new BS2 USB HW board. The sensor has been in storage for over a year but was working last time I used it. On both the debug terminal and LCD it is outputting a four digit percentage, instead of a two digit percentage. I will probably just order another sensor, but in the meantime I was wondering if there was a way to check the sensor I have, possibly resistance across the two pins?

*The new BS2 was purchased locally and when I got home I noticed it had already been used and repacked, but I ran a bunch of similar math functions on it and they came out okay.

I also omitted the 220 ohm resistor in the PDF because the HW board has them built in.

Thanks.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-02 13:39
    According to the documentation for this sensor it is essentially a variable capacitor, so measuring resistance wouldn't give you a usable value for test purposes. If your meter has a capacitor checker you could compare readings with someone else to see if the sensor is still within the range it should be. Did you type the code in manually or copy/paste it?
  • xanaduxanadu Posts: 3,347
    edited 2013-07-02 13:57
    Thanks Chris.

    I measured it at .244nf but I don't think my multimeter is accurate.

    I c&v the code but there was one funny character so I replaced all of the characters and numbers in the RCTIME section just to be sure.

    I also tried a different pin on the HW board.

    I think I'm going to order another sensor, I need some other small parts anyway. I don't think I could have missed anything else at this point, double checked everything.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-02 14:46
    I'm wondering since you've replaced those characters if perhaps there may be an error in your code? It looks like normal capacitance is between 177 and 183 pF. My meter (the one I have with me) doesn't go that low.
  • xanaduxanadu Posts: 3,347
    edited 2013-07-02 15:03
    Should have posted earlier, I've been running this stripped down version:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    time VAR Word
    humidity VAR Word
    RHconstant CON 12169 ' Relative Humidity Constant * 10   
    
    DO
    HIGH 7
    PAUSE 1
    RCTIME 7, 1, time
    time = time * 10
    humidity = (time - RHconstant) / 24
    ' Debug Display:
    DEBUG HOME, DEC humidity
    PAUSE 100
    LOOP
    
  • xanaduxanadu Posts: 3,347
    edited 2013-07-02 15:12
    I built the RCTIME test circuit using a 1000uf cap and a 1k ohm resistor using the code below. The cap doesn't seem to ever discharge.
    ' What's a Microcontroller - PolledRcTimer.bs2
    ' Reaction timer program modified to track an RC-time voltage decay.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    timeCounter VAR Word
    counter VAR Nib
    DEBUG CLS
    HIGH 7
    DEBUG "Capacitor Charging...", CR
    FOR counter = 5 TO 0
    PAUSE 1000
    DEBUG DEC2 counter, CR, CRSRUP
    NEXT
    DEBUG CR, CR, "Measure decay time now!", CR, CR
    INPUT 7
    DO
    PAUSE 100
    timeCounter = timeCounter + 1
    DEBUG ? IN7
    DEBUG DEC5 timeCounter, CR, CRSRUP, CRSRUP
    LOOP UNTIL IN7 = 0
    DEBUG CR, CR, CR, "The RC decay time was ",
    DEC timeCounter, CR,
    "tenths of a second.", CR, CR
    END
    
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-02 15:14
    Try the following code and tell me if you get anything different?
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    time VAR Word
    humidity VAR Word
    RHconstant CON 12169 ' Relative Humidity Constant * 10   
    
    
    DO
    HIGH 7
    PAUSE 1
    RCTIME 7, 1, time
    time = time * 10
    humidity = (time - RHconstant) / 24
    ' Debug Display:
    DEBUG HOME, DEC humidity, "    "
    PAUSE 100
    LOOP
    
  • xanaduxanadu Posts: 3,347
    edited 2013-07-02 15:35
    I tried a few variation of that to see but the output looks the same. ~2716.

    I just noticed, I get really strange results if I touch the wire going into either of the headers. If I wiggle them just right I think that it works correctly...
  • xanaduxanadu Posts: 3,347
    edited 2013-07-02 15:42
    It looks like some of the headers on the BS2 HW board aren't contacting right. Using a slightly too large of a jumper wire seemed to fix it. It was an open box, someone must have plugged stuff in that was too large because it seems all of the headers are too large using the included wire.

    The measurement is matching my humidity meter now :) Thanks a bunch I'll go exchange this board where I got it.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-02 15:47
    I'm glad to hear you got this figured out. :thumb:
  • xanaduxanadu Posts: 3,347
    edited 2013-07-14 12:04
    Chris,

    I spent some more time on this and wanted to follow up that the BOE socket(s) were okay after all. I think touching the wires might have added the needed capacitance to get a reading. I'm going to try a new sensor now.
  • xanaduxanadu Posts: 3,347
    edited 2013-07-19 16:39
    I've now tried this with two Stamp HW boards, and three sensors. Still the same results.

    I used this sensor a couple years back on a BS2 BOE board and had no problems with it. I am not sure how that can make a difference, but it seems to be the only variable left.

    Since the HW board already has 220 ohm resistors on the pins I left that off, otherwise I'm following the schematic exactly. I have tried a few different 10 meg resistors.

    Any other ideas?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-07-23 08:11
    Is this on the new one or the one you had trouble with?
  • xanaduxanadu Posts: 3,347
    edited 2013-07-23 20:15
    The new sensors and the old sensor both read the same. The Stamp board was fine, that was just me not focusing on the task at hand 100% and jumping to conclusions. I apologize for any confusion there.

    I think that the capacitive cell may need continuous calibration over time. Even though I show a strange reading, if I adjust the code enough I can see that the sensor still works to some degree. It just doesn't seem to work inside of the parameters it needs to.

    I had emailed your support on Friday because I needed to do some humidity comparisons over the weekend, sorry if that counts as a double post or harassment I just needed this working on Saturday and thought maybe someone would be there. I was able to get it close enough to show the humidity going up and down which is all I really needed it for. Nick wrote back and said that he was looking into it.

    I'll probably just get the temp/humidity module at some point if this project continues. Given the price and simplicity of the HS1101 I kinda figure that it might have some downsides like what I'm experiencing now.
Sign In or Register to comment.