New Jersey
Offline
Edison Member
Karma: 24
Posts: 2351
|
 |
« on: March 18, 2011, 07:51:58 pm » |
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
Sr. Member
Karma: 4
Posts: 437
Arduino rocks
|
 |
« Reply #1 on: March 18, 2011, 09:06:20 pm » |
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
Edison Member
Karma: 12
Posts: 1389
Ultimate DIY: Arduino
|
 |
« Reply #2 on: March 21, 2011, 08:30:22 am » |
Somewhere in Arduino land... somebody created some code to emulate the BASIC STAMP RCTIME function. AHA found it: http://www.arduino.cc/en/Tutorial/RCtimeYou 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
Edison Member
Karma: 24
Posts: 2351
|
 |
« Reply #3 on: March 21, 2011, 09:15:59 am » |
Perfect, got it working with that exact sketch. Thanks for your help.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9401
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #4 on: March 21, 2011, 10:16:13 am » |
COuld you please post the final sketch ? (HW & Software)
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2351
|
 |
« Reply #5 on: March 21, 2011, 10:38:00 am » |
It really is the literal code given in the example sketch pwillard linked, with a longer delay in loop i.e.: 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.
|
|
|
|
« Last Edit: March 21, 2011, 01:50:34 pm by wildbill »
|
Logged
|
|
|
|
|
Cumming, Ga
Offline
Edison Member
Karma: 12
Posts: 1389
Ultimate DIY: Arduino
|
 |
« Reply #6 on: March 21, 2011, 12:10:56 pm » |
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
Edison Member
Karma: 24
Posts: 2351
|
 |
« Reply #7 on: March 21, 2011, 01:51:48 pm » |
Trimmed it a little bit  Also took the opportunity to correct it. That's a 1M resistor, not a 1K - d'oh!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 46
|
 |
« Reply #8 on: March 26, 2011, 03:33:12 am » |
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
Full Member
Karma: 0
Posts: 102
|
 |
« Reply #9 on: March 31, 2011, 03:42:49 am » |
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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #10 on: March 31, 2011, 08:16:19 am » |
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
Full Member
Karma: 0
Posts: 102
|
 |
« Reply #11 on: March 31, 2011, 09:47:02 am » |
hello and thank you ... So I can directly connect the sensor Arduino
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 102
|
 |
« Reply #12 on: April 01, 2011, 02:25:52 am » |
hello, how to get results is given by Ardu-ion on a PC network thank you.
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2351
|
 |
« Reply #13 on: April 23, 2011, 08:36:05 am » |
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? 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
Newbie
Karma: 0
Posts: 16
Arduino rocks
|
 |
« Reply #14 on: August 28, 2011, 05:22:02 pm » |
Hey wildbill:
How does your HS1101 sensors results compare to Honeywell sensor HIH-4000? Any input on this will help.
Thank you.
|
|
|
|
|
Logged
|
|
|
|
|
|