Go Down

Topic: HR202 Humidity Sensor (Read 7497 times) previous topic - next topic

rudmac

Jan 20, 2013, 03:51 pm Last Edit: Jan 20, 2013, 04:37 pm by rudmac Reason: 1
Hello,

I got a HR202 humidity sensor and I have no idea how to convert the analog result to HR%. I haven't found any exemple code at internet.

If someone have a example, please send to me. I apreciate.

the datasheet is here: ftp://imall.iteadstudio.com/Sensor/IM120712018/DS_IM120712018.pdf

int analogPin = 0;

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

void loop()
{
 Serial.print("Analog: ");
 Serial.print(getValue());
 Serial.print(" Digital: ");
 Serial.println(digitalRead(digitalPin));
 delay(1000);
}

float getValue() {
 val = analogRead(analogPin);
 // need some calca to HR%
 return val;
}

robtillaart

Rob Tillaart

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


kuhntucker


Hello,

I got a HR202 humidity sensor and I have no idea how to convert the analog result to HR%. I haven't found any exemple code at internet.

If someone have a example, please send to me. I apreciate.

the datasheet is here: ftp://imall.iteadstudio.com/Sensor/IM120712018/DS_IM120712018.pdf


The datasheet you provided contains a chart which converts resistance of the sensor to humidity at a given temperature.  You could put that table an array, and then look up and interpolate values based on the value from the temperature sensor which it appears you are missing.
Alternatively, you could generate a function from the values in the table.   Spreadsheets graphs and trend lines are helpful for that.

kuhntucker


Alternatively, you could generate a function from the values in the table.   Spreadsheets graphs and trend lines are helpful for that.


I plotted the 25C results against the log of the resistance and found that a 4th order polynomial function fits the data quite well, with an R^2 value of 1.    Personally, I'd probably go with the function approach, since I find it more aesthetically pleasing. 

rudmac

ok, tks.

I will figure out to transform it into a formula using also the ambient temperature matter.

tks

mimo

hello, I just bought the sensor of HR202.
By the way have anyone had been successful how to get the reading in RH%? I had tried to search from the other sources, but it seems that not many info could get about this sensor.

robtillaart

Quote
You could put that table an array, and then look up and interpolate values based on the value from the temperature sensor which it appears you are missing.

you can use - http://playground.arduino.cc/Main/MultiMap - for non-linear mapping (it mixes lookup & interpolation)
Rob Tillaart

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

I am trying to get this sensor to work , but with out much luck, does anybody got the correct formula / calculation.


geir_moen

This looks like a horrible sensor ;-)
First of all - Relative Humidity is, by name, relative to the air temerature.
The reading from this sensor is therefore incomplete, and cannot be used unless you already know the air temperature.
.. And if I read the documentation right, you will have to create a 500-2000 Hz frequenzy at 1.5 volt. And then messure the inductance.
It will cost you about $10 in parts. ...and half the hair on your head ;-)

Can I recomend a completely difrent approach to your project?
Alternative 1 : "DHT11 Digital Temperature and Humidity Sensor"
  It is close to the range of HR202. It messures temp. and RH. It will give you the calculated RH digitaly over the serial port. It costs about $1.50 on eBay
Alternative 2 : "DHT22/AM2302 Digital Temperature Humidity Sensor"
  The same as DHT11. A bit more expensive, but it has a wider range and has better precision. If you want precision, it is worth the extra money.

chchengl

I got same problem.there is no related information in web.
So that,I did humidity experiment & got convert function as following.

Voltage:    4.01-4.20-4.32-4.36-4.48-4.52-4.63-4.78
Humidity:  99   -90  -86   -82   -80   -74   -70   -62

Slope:-47.65  intercept:290.63  R-square:0.9863

Humidity=-47.65*(Voltage)+290.63

Go Up