Trouble reading Cal values from HH10D

borz

Member
Hi I have got myself a HH10D and am using 18X to get retrieve the Cal values .

Just wanted to confirm that do I have to connect both i2c comms from HH10D (SCL & SDA) to 18X pins 10 / scl and pin 7/sda ? with correct code of course .


thanks
 

manuka

Senior Member
I've only used this humidity module with an 08M, but Wayne (who trialled with an 18X) found they're usually within ±1% of the values shown in the code below. You can hence assume they're close to 7700 (Offset) & 340 (Sens.)-the June 2009 "Silicon Chip" has full usage details. A cross check with a wet & dry bulb hydrometer may appeal if you want to get more fundamental =>www.picaxe.orconhosting.net.nz/hopehum.htm
Code:
#PICAXE 08M 
'HopeRF HH10D humidity module program- Wayne Geary for June 2009 SiChip
'Ref resources => www.picaxe.orconhosting.net.nz/hopehum.htm
'IO and VARIABLE DEFINITIONS 
SYMBOL humid        = 3
SYMBOL axefactr     = b2
SYMBOL Soh	    = w2	    'w2 = b5:b4		
SYMBOL diff	    = w3	    'w3 = b7:b6
SYMBOL RH	    = w4	    'w4 = b9:b8
'
'CONSTANTS -strictly need I2C reading for each module,but can be assumed close
SYMBOL Offset   = 7709     'HH10D offset calib. constant-a 2nd module has 7762 
SYMBOL Sens	= 341          'HH10D sens. calib. constant-a 2nd module has 340
' 
Main:
COUNT humid, 1000, Soh            'read the frequency (ie cycles in 1 second)   
diff = Offset - Soh               'factor in calib. value
axefactr = diff / 19 + 1          'factor stops roll over error if >65535
RH = 10 * Diff / axefactr * Sens  'int. result (x10 gives possible 0.1 resoln)
axefactr = 4096 / axefactr        'a factor to prevent number roll over error
RH = RH / axefactr                'final value for RH%
RH = RH / 10               	    'divide by 10 (for now) for integer RH%
SERTXD ("RH% = ",#RH,cr,lf)       'display on editing PC via F8 & prog. cable
wait 5                            'wait 5 sec. between readings-alter to suit
GOTO Main
 
Last edited:

borz

Member
Thanks manuka . I did read the silicon chip artilce and he did indicate you could just use 7740 & 340 . Just wanted to go through the exercise of getting the vaules !

Thanks
 

westaust55

Moderator
HH10D Humidity sensor

Not sure if you are having a specific problem or just wanting confirmation before you attempt to read the calibration values.
Some notes:
1. The HH10D operates at 3/3.3V. Suspect this may be more for the calibration of the 555 with the capacitor as the module components are rated higher but suggest stick with 3 or 3.3V.
2. The 18X can be programmed and operate at 3.3V –I am doing that myself.
3. Connect the 18X SCL to the HH10D SCL and the 18X SDA to the HH10D SDA lines. Don’t forget to have a 4.7 kOhm pull up resistor from each line to the supply (Vcc)
4. try with this code:
Code:
I2cslave %10100010, i2cfast, i2cbyte  ; the EEPROM hardware address is %001
I2cread 10, (b0, b1, b2, b3, b4, b5)
DEBUG,   ; so you can see in the PE window
END
[code]

Have you read the details relating to the HH10D I gave in the thread:
http://www.picaxeforum.co.uk/showthread.php?t=11749
 

borz

Member
I was having trouble reading the values but I Have just realise my mistake I didn't connect the 4.7 kOhm pull up resistor from each line to the supply (Vcc). will try again after work .

I have read the thread . Very good information .

Thanks mate
 

westaust55

Moderator
I was having trouble reading the values but I Have just realise my mistake I didn't connect the 4.7 kOhm pull up resistor from each line to the supply (Vcc). will try again after work .

I have read the thread . Very good information .

Thanks mate
Good luck.
Highly likely the the pull up resistors is the problem, as absence of these two resistors has caught out many in the past.
 

westaust55

Moderator
well is was the pullup resistors . I have got my cal values .

Thanks westaust55
Can you post the calibration values you have from your module.
Would be good to get some extra values to expand the known range.
thanks in advance
 

borz

Member
with those values I got and the code that you provided Westaust55 . my humidity levels are reading 0%.

Just wondering if I have damaged it because the supply was at 4v and I hadn't adjusted my regulator to 3v ?
 

westaust55

Moderator
Trouble with HH10D

Please post your code and a schematic diagram and we can first look for other errors before presuming that the humidity sensor is dead. If you can supply a photo as well would be good.
 

borz

Member
this is my code and I calculated 7886 & 359

#PICAXE 18M 'set it to 18m default
'HopeRF HH10D humidity module program- Wayne Geary for June 2009 SiChip
'Ref resources => www.picaxe.orconhosting.net.nz/hopehum.htm
'IO and VARIABLE DEFINITIONS
symbol humid = 1
SYMBOL axefactr = b2
SYMBOL Soh = w2 'w2 = b5:b4
SYMBOL diff = w3 'w3 = b7:b6
SYMBOL RH = w4 'w4 = b9:b8
'
'CONSTANTS -strictly need I2C reading for each module,but can be assumed close
SYMBOL Offset = 7886 'HH10D offset calib. constant-a 2nd module has 7886
SYMBOL Sens = 359 'HH10D sens. calib. constant-a 2nd module has 359
'
Main:
COUNT 1 , 1000, Soh 'read the frequency (ie cycles in 1 second)
diff = Offset - Soh 'factor in calib. value
axefactr = diff / 19 + 1 'factor stops roll over error if >65535
RH = 10 * Diff / axefactr * Sens 'int. result (x10 gives possible 0.1 resoln)
axefactr = 4096 / axefactr 'a factor to prevent number roll over error
RH = RH / axefactr 'final value for RH%
RH = RH / 10 'divide by 10 (for now) for integer RH%
SERTXD (#RH,"% RH",cr,lf) 'display on editing PC via F8 & prog. cable
wait 5 'wait 5 sec. between readings-alter to suit
GOTO Main
 

westaust55

Moderator
Your calibration values look okay.

I am using the same program code in both an 08M and a 18X with differnt HH10D modules without problems.

In the absence of a schematic:

1.do you have the middle pin of the HH10D connected to input 1 of your PICAXE for the Fout signal?

2. Can you look at the count value you are receiving at pin1. To do that:
After the line:
COUNT 1 , 1000, Soh​
Add the line
SERTXD ((#Soh, “count”,cr,lf)​
And see if you are receiving any pulses at all.
 

centrex

Senior Member
I have one of these humidty sensors ticking away on the bench at this moment.
The values that I get from the device are 7786 and 339.
With these values my device reads pretty close to another humidty sensor that I have.
Regards
 

borz

Member
Yes I am adamant the connection is correct but I will recheck it and add that extra bit of code

thanks
 

borz

Member
well I did add that extra bit of code and I am receiving pulses . The interesting thing is that when change the cal values to what you have . It seems to give me some decent readings .

will try another sensor and see what happens ?
 

fernando_g

Senior Member
Some notes:
1. The HH10D operates at 3/3.3V. Suspect this may be more for the calibration of the 555 with the capacitor as the module components are rated higher but suggest stick with 3 or 3.3V.
2. The 18X can be programmed and operate at 3.3V –I am doing that myself.
Some questions on your notes:
1.-Yes I also suspect that they chose this low voltage to improve calibration and/or accuracy.

2.-Is there a particular trick or consideration to achieve that? I've a chart that Hippy published on the PICAXE family characteristics, and on the power supply issue, it recommends the following:

Vsupply Summary
4.5V to 5.5V = 28X1 (16/20MHz), 40X1 (16/20MHz)
4.2V to 5.5V = 28X2, 40X2
4.0V to 5.5V = 18A, 18M, 18X, 28, 28A, 28X, 40X
3.0V to 5.5V = 18
2.2V to 5.5V = 08
2.0V to 5.5V = 08M, 14M, 20M, 28X1 (4/8MHz), 40X1 (4/8MHz)
 
Last edited:

westaust55

Moderator
well I did add that extra bit of code and I am receiving pulses . The interesting thing is that when change the cal values to what you have . It seems to give me some decent readings .

will try another sensor and see what happens ?
What is the pulse count that you are receiving?
 

westaust55

Moderator
operating 18X at 3Volts

Some questions on your notes:

2.-Is there a particular trick or consideration to achieve that? I've a chart that Hippy published on the PICAXE family characteristics, and on the power supply issue, it recommends the following:
the 4.0V is bbsed around the INTIO2 clock operating mode.

The datasheet does suggest can operate to 2V with an external oscillator.

I have done nothing more than try at 3V and found that it will operate and program without problems.
 

Attachments

Last edited:

westaust55

Moderator
The calibration values you have given are much greater than other examples seen to date. For example other cases have Sens around 340 whereas your value is 359.

I believe that the problem is that maths overflow is occurring in the intermediate calculations.

Can you try changing the line:
axefactr = diff / 19 + 1 'factor stops roll over error if >65535​
to
axefactr = diff / 18 + 1 'factor stops roll over error if >65535​

The value of 18 instead of 19 will help prevent roll over in the intermediate math values but from some quick calcs, due to the PICAXE integer maths increases the error of the results by around 0.2%
 

borz

Member
I did change the code to 18 and found RH to be 42%(indoors). u beauty !That looks a bit better . The pulse count that I am are receiving is about 7435.
I did do a sertxd for each calculation step last night and found that my number was greater than 65535. 67,339 to be exact with 18 I calculate 63491 much < 65535

I didn't fully comprehend that part code that's why I came unstuck . guess that what forums are for ! And to learn from people like you.

Thanks mate
 
Last edited:

fernando_g

Senior Member
Westaus55......Thanks for the info.
From what I can gather from the datasheet snippet, the 16LF88variant which can operate all the way down to 2.0 volts, is only recommended to operate at the industrial temp range.... whereas for operation at the extended temperature range you must use the 16F88 variant which is spec'd at a minimum of only 4.0 volts.

Makes sense....for critical apps, the guaranteed operating range is narrowed.
But since I'm not operating nowhere near temperature limits, 3 volts should be just fine.
 
Last edited:

westaust55

Moderator
HH10D calibration and calculaitons

Borz and All,

Unfortunately, HopeRF do not provide a range for the calibration values on their HH10D datasheet as they do for the HP03 barometric pressure sensor.

Having more data from others who also use the HH10D may enable a &#8220;bigger picture&#8221; to be created and maybe some fine tuning of the formula.

From what I can see at present, if the calibration constant &#8220;Sens&#8221; is
<= 345 then divide by 19
>345 and <= 365 then divide by 18
> 365 then divide by 17

Maybe if manuka reads this he can add a note to his hosting site where the PICAXE program code is kept.

I have added an edit note in my original thread on the HH10D for those who follow with the able notes on altering the divisor to prevent maths overflow.
 
Last edited:
Top