NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Sensors, Actuators, and Robotics » How to read data sheet

September 17, 2009
by apurcell
apurcell's Avatar

Good day all,

I have been kicking around the idea of adding a humidity sensor to my kit and having some trouble deciphering the datasheet for the sensor I am looking at.

In particular: Honeywell HIH-4000 http://sensing.honeywell.com/index.cfm?ci_id=142959

Page 2 has a table of specs. I am not clear as to what one I should be looking at to code the conversion of the output voltage. If someone could steer me as to where to look I would be most grateful. Also if anyone has used a different humidity sensor, I am open to that input as well.

Regards, Anthony

September 17, 2009
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi Anthony,

I haven't used this part before, but looking at page 2 of the datasheet, I think the proper place to look is "Voltage output (1st order curve fit)" where it says that

VOUT=(VSUPPLY)(0.0062(sensor RH) + 0.16)

Then I think that for a 5V power supply and 0% RH you'll read

VOUT=5.0*(0.0062*0 + 0.16) = 0.8 volts

and for 100% RH you'll read

VOUT=5.0*(0.0062*100 + 0.16) = 3.9 volts

So if you want to go the other direction from voltage back to RH, you just have to invert the function properly:

RH = ((VOUT/5.0) - 0.16)/0.0062

Of course, if you're using the ATmega168's Analog to Digital Converter (ADC), then you first have to get from the 10-bit ADC reading to voltage. So your code could look something like this:

uint16_t last_sample;
double v_out;
double rh;

while(1) {
  last_sample = adc_read();
  v_out = last_sample * (5.0 / 1024.0);
  rh = ((v_out/5.0) - 0.16)/0.0062;
  // now rh should hold a number between 0 and 100
  // (it may exceed these bounds depending on the accuracy, temperature, and other conditions
}

Hope that helps!

Mike

September 18, 2009
by apurcell
apurcell's Avatar

Mike,

That was more than I hoped for! Thanks so much!

Regards, Anthony

Post a Reply

Please log in to post a reply.

Did you know that you can follow NerdKits on Facebook, YouTube, and Twitter? Learn more...