Pages: [1]   Go Down
Author Topic: Honeywell HIH 4030 Humidity Sensor Library  (Read 824 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've written a small c++ library for the honeywell hih4030 humidity sensor that I figure I'd post for anyone who needs it. I've been using it for a bit now and it does the job. Its very simple. There is a constructor that accepts the pin number, the millivoltage of the power provided to the IC (it accepts 4 - 5.8V), and your ADC resolution. The output is ratiometric to the voltage input hence the requirement to tell the library the mV of the power supply and the ADC resolution. There is one public method "getRh(int)" which accepts a temperature value in celsius (you can just input 25 degrees C if you don't have temperature sensing capability but I recommend it for more accurate readings) and returns the relative humidity as a float.

I instantiate a global var and use it wherever needed in my code but more than one instance can be constructed at a time (there is a copy constructor for convenience):

#include <hih4030.h>
HIH4030 hih(humPin, maxMVolts, adcResolution);

If anyone has questions please let me know.


* hih4030.h (0.77 KB - downloaded 10 times.)
* hih4030.cpp (1.61 KB - downloaded 16 times.)
Logged

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

i recently got some HIH-4602-A and C sensors as samples from honeywell. ( http://sensing.honeywell.com/samplerequest ). which is awesome of honeywell as the sensors are around $80 each.

ill need to compare datasheets, but it looks like they work in a similar manner to the 4030s. if i need to extend your library, are you down? or you think just use it as a template and make a separate one? thoughts? comments?
Logged

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

You should definitely extend this library if its practical to do so.  Let me know if you have any questions.  Cheers!
Logged

Pages: [1]   Go Up
Jump to: