Humidity Sensor HH10D

Hello everyone.

I am looking for the code of this sensor .I tried to do it by myself but i begin to discover I²C and it is pretty difficult to understand it , so I have searched in this forum but i always fall on this dead link:
http://tushev.org/articles/electronics/46-interfacing-hh10d-with-arduino

If someone have this code, i will be happy to see it. Thanks.

Try

This is good too.
http://www.patrikhermansson.se/?q=node/437

Thanks a lot but i tried these links.

I have an error with your 2nd link, when i check the code, i have these error:

error: ‘class TwoWire’ has no member named ‘send’
error: ‘class TwoWire’ has no member named ‘receive’

The second link is mine :slight_smile:
The errors has to do with Arduino 1.0 compability. In the readCalib routine, change every "Wire.send()" and "Wire.receive()" to "Wire.write()" and "Wire.read()"

See http://forum.pololu.com/viewtopic.php?f=14&t=4728 for more information.

hi phermansson.
i noticed that you do not connect fout to pin 5
i am curious as to how you work out the freq to obtain final RH%
(by the way, does fout stand for frequency output?)

phermansson:
The errors has to do with Arduino 1.0 compability. In the readCalib routine, change every "Wire.send()" and "Wire.receive()" to "Wire.write()" and "Wire.read()"

Oh, thank you very much, the code work. I'll try with the sensor thursday! ( i can't test it before )

phermansson, i have a ( maybe stupid ) question: Where is the value of Humidity ?

Ok i have on the Serial Monitor the Offset and sensitivity but there is always the same results:

Sensivity: 379
Offset: 7720

I don't know what does it mean.

Hi again, the link that i sought work again. :slight_smile:

I finally use the code of Tushev and when i launch the code, my Humidity displays a result between -7 and +7.

I followed the advice of robtillaart in this topic:

robtillaart:
OK, question arises if you need to read the Sensitivity and Offset every time? If not keeping those two numbers in memory makes the code a bit simpler. You just request them once in setup().

Furthermore it is not clear from the spec if Sensitivity and Offset are signed or unsigned integers. Looking at the values it seems not relevant but when multiplying all those ints one may get an overflow which causes errors. Better make the vars unsigned long to prevent this.

Rob

So i changed variables int "freq", "offset" and "sens" to unsigned long.
Now i have a consistent result.

PS: I use a MEGA 2560 and the pin FOUT go in Digital Pin 47, not in Digital pin 5.

Check this topic for more information: Logger Shield and FreqCounter for the Mega 2560 | Kevin Kessler's Projects