HOPE RF HH10D Humidity Sensor

westaust55

Moderator
Thought this information might be of interest to others.

Looking to add a simple humidity sensor to an 08M to use along with a DS18B20 (temp_ and LDR (light) as a mini weather station using a 433MHz link back to my main (40X1) PICAXE module.

Have found the HOPE RF HH10D sensor. Ref: http://www.hoperf.com/pro/hh10d.html

Futurlec have this for sensor for AUD$13.37

The module has an i2c EEPROM which the manufacturer puts a couple of bytes of calibration data in. Can read this calibration data once with the 40X1 as the data does not change.

Thereafter the actual measurements are a frequency output which the 08M can “read” and use the formula from the datasheet to calculate taking into account the offset and sensitivity values.

A search of the forum did not find anyone else having used this module but makes for a simple humidity sensor which does not require SPI or i2c and thus simple to interface to the 08M using a single input pin.


EDIT: should mention the HOPE RF datsheet does have an error on page 2 in the Application Circuit diagram where the Vdd and Vss are crossed between the microcontroller and the humidity module.:rolleyes:
 
Last edited:

manuka

Senior Member
Good find! Although we've just concentrated on their HM-TR transcievers,HopeRF make quite a range of well priced goodies. Sigh -I for one wish their data sheets were as supportive...
 
Last edited:

westaust55

Moderator
HOPE RF HH10D Humidity Sensors - Calibration data

Received the two HopeRF HH10D humidity sensors I ordered through Futurlec yesterday.

Have soldered a 5-pin head to both and connected them to a 3Vdc supply

Note that I have emailed HOPERF to check and they are adamant it should be 3Vdc. The onboard EEPROM and timer chips are both capable of operating at 5Vdc so I presume the 3Vdc limit is related to the capacitive humidity sensor element.

The onboard i2c EEPROM is only used to hold some fixed calibration data, so the module need only be connected to an i2c comms bus once to read that data.

The PICAXE program to read and see the calibration data is very simple:
The on-board EEPROM is permanently set at address 01.

So if you have an EEPROM in a "standard AXE022 protoboard you will need to remove it before you conenct the Humidity sensor to read the calibration data.
Code:
Main:	 HI2CSETUP i2cmaster, %10100010, i2cslow, i2cbyte
       HI2CIN 10,  (b0, b1, b2, b3, b4, b5)
       DEBUG
       END
Then just look in the DEBUG screen on your PC to see the values.

While the datasheet mentions three calibration values only two are in fact used.

From the two modules I purchased, the calibration data is as follows

Module 1:
Code:
Location         10,   11,   12,   13,   14,   15
Byte value       01    85    30    29    255  255    
Word Value         21761        7454      65535
Function        Sensitivty    Offset    TCS (not used)
And for Module 2:
Code:
Location         10,   11,   12,   13,   14,   15
Byte value       01    84    30    82    255  255    
Word Value         21505       21022      65535
Function        Sensitivty    Offset    TCS (not used)
The output from the HH10D is in the form of a frequency (series of pulses) relative to the humidity level.

The RH(%) = (Offset-Soh) * Sens /(2^12)
More later when I have a chance to get them into action.
 
Last edited:

manie

Senior Member
I posted a question on this RH% sensor a while back, did not think that using them is that easy, as I2C is mentioned in the datasheet... waiting for my Honeywell RH sensors from Rev-Ed, will be interested to know how yours work for future reference on chook-house controller...
Manie
 

westaust55

Moderator
Discovered a flaw in my assumption in the previous post. :rolleyes:
Namely, that the calibration data is NOT stored as high byte after low byte as the PICAXE does.


So the corrected information is as follows:

Module 1:
Code:
Location         10,   11,   12,   13,   14,   15
                 MSB   LSB   MSB   LSB   MSB   LSB
Byte value       01    85    30    29    255  255    
Word Value          341         7709      65535
Function        Sensitivty    Offset    TCS (not used)
And for Module 2:
Code:
Location         10,   11,   12,   13,   14,   15
Byte value       01    84    30    82    255  255    
Word Value          340         7762      65535
Function        Sensitivty    Offset    TCS (not used)
The output from the HH10D is in the form of a frequency (series of pulses) relative to the humidity level.

The RH(%) = (Offset-Soh) * Sens /(2^12)

So tonight from module 1, I get an indoor reading around 7110
==> RH = ( 7709-7110) * 341 / 4096 = 49.86%

and from module 2, I get a read around 7140
==> RH = ( 7762-7140) * 340 / 4096 = 51.63%

Hygrometer inside house is showing 49% so all is within the specified 3% accuracy that these humidity senors give. (This includes other sensors as well, not just the HOPERF HH10D).

Since the humidity sensor is a frequency relative to RH%, the simplest way to get the frequency is just to count the pulses for a 1 second period.

Below is the initial program I have in my mini-weather station to read each of the sensors (temp, humidity and light level) to check all is working:



Code:
; IO DEFINITIONS
;
SYMBOL ldres = 4
SYMBOL humid = 3 
SYMBOL RFdat = 2
SYMBOL temp  = 1
SYMBOL RFon  = 0
;
; VARIABLE DEFINITIONS 
#PICAXE 08M
; 
SYMBOL light    = b0
SYMBOL degC   = b1
SYMBOL RHumid= w1 ; = b3:b2
;
; MAIN PROGRAM
;
Init:
LOW RFon
;
Main:

READADC ldres, light            ; read the relative light level value

READTEMP temp, degC             ; read the temperature in Degrees C.

COUNT humid, 1000, RHumid       ; read the frequency (ie cycles in 1 second)
DEBUG

HIGH RFon  ; switch ON the RF Transmitter module
PAUSE 1000

serout 2, N600, ($55, $55, $55, "ABC", degC, light, b3, b2)


LOW RFon   ; switch OFF the RF Transmitter module

PAUSE 1000

GOTO Main
So in conclusion the HH10D is a reasonable buy. :D

Hopefully my "discovery" above will prevent others in future falling in the same trap with the calibration data having the MSB in the lower byte.



EDIT: (9 Oct 2009)
Having more data from others who also use the HH10D is enabling a “bigger picture” to be created and maybe some fine tuning of the formula.

From what I can see at present,
IF the calibration constant “Sens” is
<= 345 then divide by 19
>345 and <= 365 then divide by 18
> 365 then divide by 17

this is to prevent maths overflow.
 
Last edited:

westaust55

Moderator
I posted a question on this RH% sensor a while back, did not think that using them is that easy, as I2C is mentioned in the datasheet... waiting for my Honeywell RH sensors from Rev-Ed, will be interested to know how yours work for future reference on chook-house controller...
Manie
Hi Manie,
They have proven to be extremely easy to use.

When I first read in the frequency I was getting totally erroneous result - like RH% = 131. A search of the internet found others asking how to do the calcs but no answers.

Worked backwards on the maths and then looking at the calibration data realised I was using the high/low bytes for calibration back to front.

Now as per earlier post tonight all working well and should now be easy for all others to get the HH10D working. Just needs a couple of minutes connected to i2c to read the calibraton data out.

I will now put a stick on rear side of the pcb for each sensor with the calibration values on for future reference. :)
 

manie

Senior Member
Westaust: That is excellent work, thanks for the heads-up. I will work with the two Rev-Ed Honneywells I've got comming for now, seeing as I've paid for them, but these certainly seem like a good one to use.
Manie
 

manuka

Senior Member
Indeed- good work finding that just an 08M will read them. I'm in fact taken with the HopeRF HHT02D combo sensor (retailing at ~US$9) as it may serve to ease the DS18B20 monopoly! It's not mentioned on the HopeRF site, but diverse data is posted elsewhere however- combo pix below. Stan
 

Attachments

westaust55

Moderator
Mini Weather Station code with HH10D humidity sensor maths

Here is the program for my mini weather station "field" unit

It includes the maths needed to get the humidity sensor reading into a valid value in the range 0 to 100.
Some maths involved to ensure program does not have word variable overflow.

Have fun . . .

Code:
; =================================================
;   File....... MiniWeather
;   Purpose.... PICAXE 08M based weather station to measure the temp, humidity and light level
;               and transmit the data over a 433MHz radio link back to a base PICAXE unit 
;   Author..... Westaust55
;   E-mail.....
;   Started.... 12-03-2009
;   Updated.... DD-MM-YYYY
;  ===============================================
;The formula for RH% is: RH(%) = (Offset-Soh) * Sens /(2^12)    2^12 = 4096
;
:
#PICAXE 08M
;
; IO DEFINITIONS
;
SYMBOL ldres     = 4
SYMBOL humid     = 3 
SYMBOL RFdat     = 2
SYMBOL temp      = 1
SYMBOL RFon      = 0
;
; VARIABLE DEFINITIONS 
; 
SYMBOL light    = b0
SYMBOL degC     = b1
SYMBOL axefactr =	b2
SYMBOL Soh	    = w2	         ; w2 = b5:b2		
SYMBOL diff	    = w3	         ; w3 = b7:b6
SYMBOL RH	=	w4	         ; w4 = b9:b8
	
;
; CONSTANTS
;				
SYMBOL Offset   = 7709           ; HH10D module 1 calibration constant	
SYMBOL Sens	    = 341            ; HH10D module 1 calibration constant 
; 
; MAIN PROGRAM
;
Init:
      LOW RFon
;
;
Main:

      READADC ldres, light       ; read the relative light level value

      READTEMP temp, degC        ; read the temperature in Degrees C.

      COUNT humid, 1000, Soh      ; read the frequency (ie cycles in 1 second)
      
      diff = Offset - Soh
	axefactr = diff / 19 + 1   ; a factor to prevent number roll over error (ie >65535)
	RH = 10 * Diff / axefactr * Sens ; intermediate result (multiply by 10 is to enable 0,1 resolution later if required)
	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) as not transmitting fractional part only whole RH%

      
      HIGH RFon  ; switch ON the RF Transmitter module
      PAUSE 1000

      serout 2, N600, ($55, $55, $55, "ABC", degC, RH, light)

      LOW RFon   ; switch OFF the RF Transmitter module

      PAUSE 1000

      GOTO Main
 

westaust55

Moderator
Indeed- good work finding that just an 08M will read them. I'm in fact taken with the HopeRF HHT02D combo sensor (retailing at ~US$9) as it may serve to ease the DS18B20 monopoly! It's not mentioned on the HopeRF site, but diverse data is posted elsewhere however- combo pix below. Stan
Manuka, an equally good fine for the larger X/X1/X2 parts

The base humidity sensor is still 3% accuracy but they have some onboard "smarts" to linearise to get down to <<1%

A search with Google took me to the HOPERF website but as you say nothing found once there. :rolleyes:

Futurlec have a datasheet but no other pricing details on US or AUS sites.
http://www.futurlec.com/Datasheet/Sensor/HHT02.pdf
 

manuka

Senior Member
Yes-be informed I say! My recent humidity interest arises via a Kiwi R&D mate, who is considering such specialised applications as mushroom growing and concrete slab curing.
 

manuka

Senior Member
HopeRF inform their combo HHT02D thermo/hygro sensor mentioned above is only available in 3000 up orders! Sigh- back to their basic HH10D for humidity along with a regular DS18B20 for temps perhaps.

WestAust55- this nifty code of yours deserves wider airing (so to speak)- do you fancy joining forces in a SiChip article ?
 

westaust55

Moderator
HopeRF inform their combo HHT02D thermo/hygro sensor mentioned above is only available in 3000 up orders! Sigh- back to their basic HH10D for humidity along with a regular DS18B20 for temps perhaps.

WestAust55- this nifty code of yours deserves wider airing (so to speak)- do you fancy joining forces in a SiChip article ?
Hi Manuka,

Yes, I would not mind dabbling in an article for Si Chip. Thanks for the idea.
Years ago I wrote some articles for a local 4WD mag but they wanted to hold my photo slides for up to 4 years (no digital cameras then) so it all fell thru.

House selling and moving almost done so will have more time for social and hobby activities.
Could you send me a PM with some idea of what you have in mind.
 

westaust55

Moderator
Assembled my mini weather station in a plastic enclosure the size of two match boxes on top of each other. WHile the circuit was tested and working, as soon as I assembed in the box, it would not transmit.

Lifting the lid 10mm and it worked perfectly. After check for signs of sorting between PCBs (one on botton and one under lid), etc I concluded that there must be interefence between the HH10D which generates a 6 to 8kHz signal and the Keymark 433MHz transmitter module.

Re assembled into a larger box and works perectly.

A couple of pics attached.

Antenna connection using an RCA plug which gives me the option to experiment with differnt antenna types later.


Have also found that I was getting some loss of data between weather station and main PICAXE (receiver) system.

Incorporated a delay between the preamble and the qualifier followed by data as womai has suggested in another thread and problem solved.

The revised portion of the code is as follows:
Code:
HIGH RFon  ; switch ON the RF Transmitter module
      PAUSE 1000

      SEROUT RFdat, N600, ($55, $55, $55, $55, $55)
      ; now SEND NOTHING for a little more than one data byte (1 start bit, 8 data bits & 1 stop bit.
      ; i.e. 10 bits in total or e.g. 16ms at 600 Baud or 4.2ms at 2400 baud).
      ; This will make sure that wherever the receiver was at the end of the preamble,
      ; it is now idle and eagerly waiting for the next start bit.
      ; Just don't wait much longer than one byte, otherwise the receiver will lose lock again.

      [B]PAUSE 10  [/B]; less than 16 but seems to work perfectly okay.
      ;
      ;
      SEROUT RFdat, N600, ("ABC", degC, RH, light)

  ;    DEBUG ; rem out the HIGH RFOn and the LOW RFon when using the DEBUG
      
      LOW RFon   ; switch OFF the RF Transmitter module
So thanks womai for that find.

Did find that a pause less that 1 byte duration would also work well with no data lost. But that could be in part due to my slower transmission rate a present (600 baud)
 

Attachments

Last edited:

manie

Senior Member
Nice and tidy Westy. So was it the Hh10D interfering with TX ? In that case I'm glad I got the Honeywell RH sensor from Rev-Ed, albeit a bit pricy at 18 quid (ZAR 270.00). It works fine though. I like your RCA antenna plug idea. I use BNC (rj59) but had to buy an expensive crimping tool for that. the RCA would have been a lot cheaper. Good idea.
Manie
 

centrex

Senior Member
?Manie
I note you mentioned a bnc rj59 connector I think these are 75 ohm connectors 50 ohm type are RG58 probably wouldnt matter at these power levels.

?Westaust55
I like your little unit but where in Aus did you get the 3 volt 100ma regulator.

C
 

manie

Senior Member
Sorry, mistype, it is RG59's I got, about 5mm coax cable thickness, or was it RG58 ? No, I don't think so....
Manie
 

westaust55

Moderator
Source of 3V and 3.3V 100mA voltage regulators

?Manie
I note you mentioned a bnc rj59 connector I think these are 75 ohm connectors 50 ohm type are RG58 probably wouldnt matter at these power levels.

?Westaust55
I like your little unit but where in Aus did you get the 3 volt 100ma regulator.

C
3V 100mA regulator (LP2950) from Futurlec:
http://www.futurlec.com.au/

They have 3V and 3.3V regulators in stock. Internet and Storefront in Sydney (another in the US) but all parts dispatched out of Thailand for worldwide clients. I have had not problems with delivery - all parts have arrived and most cases within a week.
 
Last edited:

westaust55

Moderator
Nice and tidy Westy. So was it the Hh10D interfering with TX ? In that case I'm glad I got the Honeywell RH sensor from Rev-Ed, albeit a bit pricy at 18 quid (ZAR 270.00). It works fine though. I like your RCA antenna plug idea. I use BNC (rj59) but had to buy an expensive crimping tool for that. the RCA would have been a lot cheaper. Good idea.
Manie
Thanks Manie.

Yes for hobby/experimenting I see no problems with the RCA plugs and sockets.
Would be a different story if a commercial project - then, yes use BNC connectors.

Darn sure it was interferrence. The small green strip board mounts to the top of the box and has a 5 pin header so I can use a short ribbon cable to interconnect. With the smaller box the senor board was directly over the Keymark transmitter module on the AXE021 proto board. As soon as I lifted the lid 6 to 10mm on the small box the Tx to a separate PICAXE worked perfectly. Tx module (switched by transistor) was only on when the transmisssion was to start. In case of an unforseen short/bridging when the box was closed I even as a test put some paper between the two module but did not help (and paper was not punctured) so good assumtion it was the ~6.6kHz signal from the HH10D getting into the Tx module.
The Keymark modules are AM modulation (the HOPERF modules a frequency modulated).

Spread out in a box that is a ~6mm wider, same height but double the length and problem has gone.
 
Last edited:

centrex

Senior Member
? for Westaus
The humidty module data sheet states that it is 24mm by 8mm with the pin spacing at 2.54mm.
To me it does not seem possible to fit 5 pins at 2.54mm in an 8mm wide board.
Can you please confirm the actual measurements as I have ordered a unit but want to have the pcb made before it gets here.
Thanks
C
 

westaust55

Moderator
? for Westaus
The humidty module data sheet states that it is 24mm by 8mm with the pin spacing at 2.54mm.
To me it does not seem possible to fit 5 pins at 2.54mm in an 8mm wide board.
Can you please confirm the actual measurements as I have ordered a unit but want to have the pcb made before it gets here.
Thanks
C

The module is:
24mm (which included the "overhang" of the sensor) x 13mm
The sensor itself is ~9mm diameter
 

centrex

Senior Member
Thanks for the information.
The device arrived today, good service less than a week even with the Easter break here in Aus.
Only one problem the 3.0 volt regulator came as a 3.3 volt device now have to wait.

Regards
C
 

manuka

Senior Member
Wait??? That 3.3V, although at the upper supply range, is quite acceptable to the HH10D. However you could always test it (& the 08M) out with a coupe of AA cells.
 

westaust55

Moderator
Wait??? That 3.3V, although at the upper supply range, is quite acceptable to the HH10D. However you could always test it (& the 08M) out with a coupe of AA cells.
The CMOS 555 chip and the EPROM are both rated to 5Vdc. HOPERF have previously advised me that 5Vdc not allowed.
I suspect it is more to do with the effect on the timing and might change the output signal frequency. AT best, give it a try at 3.3V but the signal may be a little off spec.
 

retepsnikrep

Senior Member
Receive Code?

Have also found that I was getting some loss of data between weather station and main PICAXE (receiver) system.

Incorporated a delay between the preamble and the qualifier follwoed by data as womai has sugegsted in another thread and problem solved.

The revised portion of the code is as follows:
Code:
HIGH RFon  ; switch ON the RF Transmitter module
      PAUSE 1000

      SEROUT RFdat, N600, ($55, $55, $55, $55, $55)
      ; now SEND NOTHING for a little more than one data byte (1 start bit, 8 data bits & 1 stop bit.
      ; i.e. 10 bits in total or e.g. 16ms at 600 Baud or 4.2ms at 2400 baud).
      ; This will make sure that wherever the receiver was at the end of the preamble,
      ; it is now idle and eagerly waiting for the next start bit.
      ; Just don't wait much longer than one byte, otherwise the receiver will lose lock again.

      [B]PAUSE 10  [/B]; less than 16 but seems to work perfectly okay.
      ;
      ;
      SEROUT RFdat, N600, ("ABC", degC, RH, light)

  ;    DEBUG ; rem out the HIGH RFOn and the LOW RFon when using the DEBUG
      
      LOW RFon   ; switch OFF the RF Transmitter module
So thanks womai for that find.

Did find that a pause less that 1 byte duration would also work well with no data lost. But that could be in part due to my slower transmission rate a present (600 baud)
Can you post your working receive code as well please so we can have a look it. Thanks Peter
 

westaust55

Moderator
Can you post your working receive code as well please so we can have a look it. Thanks Peter
Here is a stripped down version to show receipt of the information and display to an LCD display

Code:
; =================================================
;   File....... 433MHz Receiver Program
;   Purpose.... Receive temperature and light level from a remote PICAXE via 433MHz radio link
;   Author..... Westaust55
;   E-mail.....
;   Started.... 25-02-2009
;   Updated.... 25-02-2009
;  ===============================================
;
; -----[ Program Description ]---------------------------------------------
;
; A program to receive temperature, humidity  and light level from a remote PICAXE via 433MHz radio
; link. Data is received from Keymark Receiver module with the SERIN command and displayed on the
; LCD module with the SEROUT commands.
;  
; 
;
; -----[ Revision History ]------------------------------------------------
; A = First issue
; 
;


#PICAXE 40X1
;
; -----[ I/O Definitions ]-------------------------------------------------
;
SYMBOL lcd_data = 1          ; serial data output to LCD module
SYMBOL Rx433_In = 7          ; serial data input from 433MHz module

; -----[ Variables ]-------------------------------------------------------
;
SYMBOL counter = w3
; 
SYMBOL light = b0            ; value for light level   received from radio link
SYMBOL degC  = b1            ; temperature in Deg C    received from radio link
SYMBOL humid = b2            ; relative humidity level received from radio link

; 4 x 20 char LCD commands
SYMBOL lcd_bs  = $08
SYMBOL lcd_lf  = $0A
SYMBOL lcd_ff  = $0C
SYMBOL lcd_cr  = $0D
; 
SYMBOL lcdcmand = $FE         ; = 254 - send this before following commands
SYMBOL lcdclear = $01         ; clear screen and cursor to home position
SYMBOL lcdhome  = $02         ; move cursor to home position
SYMBOL lcdnocur = $0C         ; display on with no cursor
SYMBOL lcdcuron = $0E         ; display on with visible cursor
SYMBOL lcdcblnk = $0F         ; display on with blinking cursor
SYMBOL lcdline1 = $80         ; move to start of 1st line
SYMBOL lcdline2 = $C0         ; move to start of 2nd line
SYMBOL lcdline3 = $94         ; move to start of 3rd line
SYMBOL lcdline4 = $D4         ; move to start of 4th line
SYMBOL lcdlitof = $FC         ; turn backlight off
SYMBOL lcdLiton = $FD         ; turn backlight on



; MAIN PROGRAM
;
Init:  SEROUT lcd_data, N2400, (lcdcmand,lcdclear)
       PAUSE 10
       SEROUT lcd_data, N2400, (lcdcmand,lcdnocur)
       PAUSE 10
;
Main:
       counter = counter + 1
       SERIN 7, N600, ("ABC"), degC, humid, light 
       SEROUT lcd_data, N2400, (lcdcmand,lcdline1)
       PAUSE 1
       SEROUT lcd_data, N2400, ("Counter = ", #counter,  "    ")
       PAUSE 1
       SEROUT lcd_data, N2400, (lcdcmand,lcdline2)
       PAUSE 1
       SEROUT lcd_data, N2400, ("Temp     = ", #degC,  " C ")
       PAUSE 1
       SEROUT lcd_data, N2400, (lcdcmand,lcdline3)
       PAUSE 1
       SEROUT lcd_data, N2400, ("Humidity = ", #humid,  " % ")
       PAUSE 1
       SEROUT lcd_data, N2400, (lcdcmand,lcdline4)
       PAUSE 1
       SEROUT lcd_data, N2400, ("Light    = ", #light, "  ")
 
 SERTXD (#degC, "  ",#light, "  ", #counter, "  ", CR, LF)  
 ; must select Prog Editor erminal (F8) at 4800 baud to see this

GOTO Main
;
 
Last edited:

drgipatel

New Member
which transmitter used?

Which transmitter have been used? is it the rf12? from hope rf?




Here is the program for my mini weather station "field" unit

It includes the maths needed to get the humidity sensor reading into a valid value in the range 0 to 100.
Some maths involved to ensure program does not have word variable overflow.

Have fun . . .

Code:
; =================================================
;   File....... MiniWeather
;   Purpose.... PICAXE 08M based weather station to measure the temp, humidity and light level
;               and transmit the data over a 433MHz radio link back to a base PICAXE unit 
;   Author..... Westaust55
;   E-mail.....
;   Started.... 12-03-2009
;   Updated.... DD-MM-YYYY
;  ===============================================
;The formula for RH% is: RH(%) = (Offset-Soh) * Sens /(2^12)    2^12 = 4096
;
:
#PICAXE 08M
;
; IO DEFINITIONS
;
SYMBOL ldres     = 4
SYMBOL humid     = 3 
SYMBOL RFdat     = 2
SYMBOL temp      = 1
SYMBOL RFon      = 0
;
; VARIABLE DEFINITIONS 
; 
SYMBOL light    = b0
SYMBOL degC     = b1
SYMBOL axefactr =	b2
SYMBOL Soh	    = w2	         ; w2 = b5:b2		
SYMBOL diff	    = w3	         ; w3 = b7:b6
SYMBOL RH	=	w4	         ; w4 = b9:b8
	
;
; CONSTANTS
;				
SYMBOL Offset   = 7709           ; HH10D module 1 calibration constant	
SYMBOL Sens	    = 341            ; HH10D module 1 calibration constant 
; 
; MAIN PROGRAM
;
Init:
      LOW RFon
;
;
Main:

      READADC ldres, light       ; read the relative light level value

      READTEMP temp, degC        ; read the temperature in Degrees C.

      COUNT humid, 1000, Soh      ; read the frequency (ie cycles in 1 second)
      
      diff = Offset - Soh
	axefactr = diff / 19 + 1   ; a factor to prevent number roll over error (ie >65535)
	RH = 10 * Diff / axefactr * Sens ; intermediate result (multiply by 10 is to enable 0,1 resolution later if required)
	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) as not transmitting fractional part only whole RH%

      
      HIGH RFon  ; switch ON the RF Transmitter module
      PAUSE 1000

      serout 2, N600, ($55, $55, $55, "ABC", degC, RH, light)

      LOW RFon   ; switch OFF the RF Transmitter module

      PAUSE 1000

      GOTO Main
 

giokal

New Member
Westy, excuse my ignorance but do not understand as to define the calibration constant "sense" of this sensor, I'm using the HS1101, because these ranges for the division? .. on Thread: DIY humidity and temperature sensor, Jeremy Harris develops a code with the same philosophy, however, uses a calibration constant of 354 calling her sensitivity and if you divide by 16 .... aclarame this confusion ..


EDIT: (9 Oct 2009)
Having more data from others who also use the HH10D is enabling a “bigger picture” to be created and maybe some fine tuning of the formula.

From what I can see at present,
IF the calibration constant “Sens” is
<= 345 then divide by 19
>345 and <= 365 then divide by 18
> 365 then divide by 17

this is to prevent maths overflow.[/QUOTE]
 
Hi Westaust55,

We got that going well with an 18M2 but may cahngew to use alleycat's 31/15 divide subroutinre to get better maqths resolution http://www.picaxeforum.co.uk/showthread.php?21494-A-Simple-quot-Double-Word-quot-Division-Subroutine-(maximum-31-bits-by-15-bits)

We needed absolute humidity for our rainforest research program www.whirinakirainforest.info/ecosystems_services_value. With a cross reference table using RH and temp we relatively easily got to provide that in gms / m3

If anyone is interested here is the code for that.

Code:
;********************************
; Now convert the absolute humidity in grams/m3 using the EEPROM table   
; this provides the stored humidity to two bytes (low = rh%, high = abs value (gms/m3) 


humcalc:
		peek temp_degr,wb1 
		   				; get temperature in whole degrees		
		let wb2 =wb1 & %10000000 			; isolate the sign bit7
		if wb2 = 0	then goto humcalc01		; if temperature positive	; 
		let wb1 = wb1 & %01111111			; if negative clear the sign bit	
		let wb2 = humidity_table +80-wb1-wb1		; point to position in table
		if wb1<41 then goto humcalc03
		 
humcalc02:	let ww4 = 0
		goto humcalc04
		
humcalc01:	if wb1>40 then goto humcalc02
		let wb2= humidity_table + 80 +wb1+wb1		; positive temp so get index to table for this
		
		
humcalc03:  							; note double index as its two bypes per entry
		read wb2, WORD ww4				; read abs humdity (100%) for this tempoerature
		
		let ww4 = ww4/2					; divide by 2 to get near full/100
		let ww4= ww4*humid_rel				; multiply by humidity % figure
		let ww4= ww4/100					; divide by 50 to get absolute for this h%hum
									; it stores value as half actual to fit in a byte
humcalc04:  
		poke humid_abs,ww4l				; save it away for transmission




;********************************
; absolute humidity table (in grams per M3) used to compute this from the temperature and relative Humidity 
; (this table is used to get the 100% value for temperatures  of -30 to +50  scaling between them  
; then this is scaled by the % humidity to get the absolute value ([url]http://rolfb.ch/projects/humidity-table/[/url])
		
symbol humidity_table = 20		;		
		EEPROM 20, (2,0,2,0,2,0,2,0,3,0,3,0,3,0,3,0,4,0,4,0)					;-31 to -40
		EEPROM 40, (5,0,5,0,5,0,6,0,6,0,7,0,8,0,8,0,9,0,10,0)					;-21 to -30
		EEPROM 60, (11,0,12,0,13,0,14,0,15,0,16,0,17,0,19,0,20,0,22,0)			;-11 to -20
		EEPROM 80, (24,0,25,0,27,0,30,0,32,0,34,0,37,0,39,0,42,0,45,0)			;- 1 to - 9
		EEPROM 100,(48,0,52,0,56,0,59,0,64,0,68,0,73,0,77,0,83,0,88,0)			; 0 to 9
		EEPROM 120,(94,0,100,0,106,0,113,0,120,0,128,0,136,0,144,0,153,0,163,0)		;10 to 19
		EEPROM 140,(172,0,183,0,194,0,205,0,217,0,230,0,243,0,1,1,15,1,31,1)		;20 to 29
		EEPROM 160,(47,1,63,1,81,1,99,1,119,1,139,1,160,1,182,1,205,1,229,1)		;30 to 39
		EEPROM 180,(254,1,24,2,51,2,80,2,110,2,140,2,173,2,206,2,241,2,22,3)		;40 to 49
		EEPROM 200,(60,3,99,3,140,3,183,3,228,3,18,4,66,4,115,4,115,4,167,4,221,4)	;50 to 59
 
Last edited by a moderator:
B

bob @ rmb electronics

Guest
Just what I've been looking for!

I read Stan Swan's article on this sensor in Silicon Chip (http://www.siliconchip.com.au/cms/A_111451/article.html) and wanted to get hold of one. I approached the HopeRF NZ agent and was quoted NZ$20 each, minimum order of 4 and the freight.....NZ$80 (eighty)! So I didn't bother.

Then I saw them in Mindkits catalogue, from Sparkfun, about $25 including freight. They are due next week.

Great timing, many thanks.
 
Top