Pages: [1] 2   Go Down
Author Topic: Using an HS1101 humidity sensor  (Read 10890 times)
0 Members and 1 Guest are viewing this topic.
New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an Arduino sampling temperature(DS18B20) in my house & sending it to a web server so I can graph it. I thought it would be nice to get humidity too, so I needed a sensor. Unfortunately, I went cheap and didn't research this enough: I bought a couple of Parallax HS1101 sensors. I was expecting to just read an analog pin, do a bit of computation & be done. Instead, it looks like I need to add a 555 and ancillary circuitry, which I could do, but do I have to? Writing the code is no issue - I wrote C for a living for a while, but the electronics? That's the dark side.

However, looking at the Parallax circuit for the stamp, it looks like this thing is just a variable capacitance device affected by humidity. Can I connect it's output to an analog pin with a large pulldown on it, set an analog pin to digital out, set it high, set it back to analog read and record the decay? What of the 220 ohm resistor the Parallax circuit uses between the arduino pin & the device? I sincerely don't know enough to decide whether this is feasible so advice or abuse would be equally welcome.
Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe you could provide us with a direct link to the data sheet.

Have you tried searching for an Arduino library for a similar device?
Logged

Just another Hacker

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1663
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Somewhere in Arduino land... somebody created some code to emulate the BASIC STAMP RCTIME function.

AHA  found it:  http://www.arduino.cc/en/Tutorial/RCtime

You can probably use this tutorial above and reference the SAMPLE PARALLAX code to get it working.

It clearly relies on STAMP processor speed (the RHCONSTANT value) so you will need to experiment...   :-(
« Last Edit: March 21, 2011, 08:33:21 am by pwillard » Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perfect, got it working with that exact sketch. Thanks for your help.
Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 227
Posts: 14040
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

COuld you please post the final sketch ? (HW & Software)
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It really is the literal code given in the example sketch pwillard linked, with a longer delay in loop i.e.:
Code:
int sensorPin = 4;              // 220 or 1k resistor connected to this pin
long result = 0;
void setup()                    // run once, when the sketch starts
{
   Serial.begin(9600);
   Serial.println("start");      // a personal quirk
}
void loop()                     // run over and over again
{

   Serial.println( RCtime(sensorPin) );
   delay(1000);

}

long RCtime(int sensPin){
   long result = 0;
   pinMode(sensPin, OUTPUT);       // make pin OUTPUT
   digitalWrite(sensPin, HIGH);    // make pin HIGH to discharge capacitor - study the schematic
   delay(1);                       // wait a  ms to make sure cap is discharged

   pinMode(sensPin, INPUT);        // turn pin into an input and time till pin goes low
   digitalWrite(sensPin, LOW);     // turn pullups off - or it won't work
   while(digitalRead(sensPin)){    // wait for pin to go low
      result++;
   }

   return result;                   // report results  
}  

The circuit diagram is attached.


* HS1101-a.jpeg (73.45 KB, 666x1800 - viewed 686 times.)
« Last Edit: March 21, 2011, 01:50:34 pm by wildbill » Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1663
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad to help out. 

I actually have one of these sensors as well... but I opted to use the SHT-11 instead.

I think we need to talk to mr WildBill... we need to urge you into using a freebie drawing tool or using IRFANVIEW to crop your hand sketches.  Way to much blank space in that schematic, sir.
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Trimmed it a little bit  smiley-wink Also took the opportunity to correct it. That's a 1M resistor, not a 1K - d'oh!
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So i have recently begun working with this sensor as well, however i have been having some trouble getting readings from outside the house to make any sense. Have you guys have good results? If anyone who has got this to work has any tips i'd love to hear them!

Basically i built the 555 timer circuit as indicated in the data sheet http://www.datasheetcatalog.com/datasheets_pdf/H/S/1/1/HS1101.shtml and it works very well using the frequency counter library. After several different attempts of trying salt solution calibrations etc ... i calibrated it with a wetbulb/drybulb at approx 87% ( bathroom after a shower with no exhaust fan) and 28% ( outlet of a dehumidifier ) and the readings seem to be very accurate and consistent. The problem is i tried it outside this morning, where I am it was below 0C and there was frost so the humidity should have been very high,(weather center said 85%) but the sensor read 32%!

So my question is does this sensor actually read RH like it claims, or absolute humidity? Does it need thermometer correction? Or maybe the temp compensation curve for the 555 is not proper? if thats the case i could just correct it with software ?

Eventually i'd like to use one of these sensors outside but so far i can only get good readings at 22C ...!
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 102
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello everyone
  I want to use the HS1101 humidity sensor, and I do not know if I should use the ne555 or to connect directly to an Arduino analog input
thank you
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, in my experience capacitative humidity sensors require extra calibration and fine tuning.

I currently have both DHT11 and HS1101 (actually a HTF3223 module), and I have the following readings at the moment. Both sensors are on my computer desk, temperature is 26C. DHT11: 27%, HTF3223: 45.16%. I'm using the interrupt-based frequency counting method for the latter.

Without a calibrated humidity meter, what are the choices to get these right?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 102
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello and thank you  ...
So I can directly connect the sensor Arduino
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 102
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello,
how to get results is given by Ardu-ion on a PC network
thank you.
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 72
Posts: 3763
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

While I was trying to figure the HS1101 out, I ordered a Honeywell sensor: http://sensing.honeywell.com/index.cfm/ci_id/142959/la_id/1/document/1/re_id/0. Yesterday, I decided to hook it up. It's very simple, 5V in, voltage pretty much in proportion to humidity out. So I stuck it on the breadboard, wrote a few lines of code and fired it up. It just worked. Curiously, I'm not elated, in fact I feel a little bit cheated; just worked? Where's the fun in that?

Code:
const float Vsupply=1024.0;
const int   analogHumidityPin = 0;

void setup()
{
Serial.begin(9600);
}

void loop()
{
float Vout = analogRead(analogHumidityPin);
float RelativeHumidity=(Vout/Vsupply)*100.0;
Serial.print((int)Vout);
Serial.print(" ");
Serial.print(RelativeHumidity);
Serial.println("%");
delay(500);
}
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey wildbill:

How does your HS1101 sensors results compare to Honeywell sensor HIH-4000?
Any input on this will help.

Thank you.
Logged

Pages: [1] 2   Go Up
Jump to: