#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
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
Good luck.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
Can you post the calibration values you have from your module.well is was the pullup resistors . I have got my cal values .
Thanks westaust55
Some questions on your notes: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.
What is the pulse count that you are receiving?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 ?
the 4.0V is bbsed around the INTIO2 clock operating mode.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: