Pages: [1]   Go Down
Author Topic: HR202 Humidity Sensor  (Read 6574 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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;
}
« Last Edit: January 20, 2013, 10:37:20 am by rudmac » Logged

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

The link does not work.
Logged

Rob Tillaart

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

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

fixed. tks
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
There are 10 types of people in this world; those that understand binary numbers and those that don't.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
There are 10 types of people in this world; those that understand binary numbers and those that don't.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

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

ok, tks.

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

tks
Logged

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

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.
Logged

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

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)
Logged

Rob Tillaart

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

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

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

Logged

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

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.
Logged

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

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
Logged

Pages: [1]   Go Up
Jump to: