Relative Humidity Sensor and PICAXE 28X1

Dear All

I am making a greenhouse climate control system for my A2 project in Electronics, and I am using a transmitter/receiver connecting to a PICAXE that will monitor and control Temperature/Humidity/Water in Soil. I have got a couple of humidity sensors that work like a variable capacitor I think, they connect into a 555 circuit and as the humidity changes the frequency of the astable changes. At normal humidity it makes 6666Hz which is quite a bit I would imagine?

My question is however how would I interface this with the PICAXE to then get it to do certain things at different humidities?

I can get some info on the model etc. and data sheets if you need, but if there is a simple answer please let me know! :)
 

eclectic

Moderator
My question is however how would I interface this with the PICAXE to then get it to do certain things at different humidities?

I can get some info on the model etc. and data sheets if you need, but if there is a simple answer please let me know! :)
Welcome.
Please post the datasheet and any circuits/programs
that you are using. e
 
Sorry, I can't get access to the data sheets until monday because I have foolishly left them at school and haven't got a cat in hells chance of finding them online because I don't know the code for them :(
 

BeanieBots

Moderator
Have a look the commands "count" & "pulsin".
These can be used to measure frequency & period.
It may well be possible to tailor your 555 circuit to produce a frequency range better suited to one or other of those commands.
 
Have a look the commands "count" & "pulsin".
These can be used to measure frequency & period.
It may well be possible to tailor your 555 circuit to produce a frequency range better suited to one or other of those commands.
Thank you, I will look into this. It doesn't look like it will be too hard then! I was expecting the worst and fearing that it would be really complicated to do!

I belive this is what your looking for...
Yes... got it in one, I am using that exact same humidity sensor, the code on it seems to ring a bell. Strange hey... how you can never remember something but then when someone shows you a picture or reminds you it comes to you just like that! :)
 

BlackDawn

New Member
:D
pay attention to bug's in code, i found two:

in the lookup channel command

and this part:

Code:
   ' RH_10 = 5577 - 0.759 * Num_Pulses

	  RH_10 = 7 * Pulses / 10
      RH_10 = 6 * Pulses / 100 + RH_10
      RH_10 = 5 * Pulses / 1000 + RH_10
      RH_10 = 4 * Pulses / 1000 + RH_10
i would love to know of your progress & how do you measure water in soil?
 

George Sephton

Senior Member
I don't suppose you could explain your humidity sensor circuit and code as Ive had plans to do the same thing but have had difficulty. Mine's a vishay humidity sensor which the capicatance one like yours.
 
Will do once I have made it myself. Haven't really looked into it myself yet. But once I have made it I will be more than happy to tell you how it went etc.
 

westaust55

Moderator
At normal humidity it makes 6666Hz which is quite a bit I would imagine?

My question is however how would I interface this with the PICAXE to then get it to do certain things at different humidities?
Have a look the commands "count" & "pulsin".
These can be used to measure frequency & period.
It may well be possible to tailor your 555 circuit to produce a frequency range better suited to one or other of those commands.

The COUNT command can handle up to 25kHz when the clock frequency is 4MHz so 6.6kHz is well within the capabilities.

At 4 Mhz, the PULSIN command has a resolution of 10us and since 6.6kHz has a period of 75ms for a half cycle it may be possible to use but you may only get values in a range like 3 to 11 which dos not offer much resolution.

COUNT does seem a better option in terms of "resolution" / potential accuracy.
 

hippy

Technical Support
Staff member
PULSIN is good for accurately determining the length of reasonably long pulses while COUNT is often better for determining the number of shorter pulses. As "f=1/t" it's possible to convert between the two and often possible to handle both by different algorithms without having to convert.

Something like a bike speedometer can perform best when dynamically deciding to use PULSIN ( when travelling slowly ) or COUNT ( when at speed ).

Don't forget that ( although sometimes handy for determining frequency ), a COUNT doesn't have to sample for a full second.
 

matherp

Senior Member
There is another type of temp/humidity sensor available - the Sensirion SHT1x range which work well. I've posted working code for using one of these with a 28X1 on http://www.picaxeforum.co.uk/showthread.php?t=11442
The SHT11 version is available on a certain auction site at a very good price and can be carefully soldered to a SOIC carrier.

best regards

Peter
 
Okay, haven't done much with the humidity sensor recently as I have been focusing on moisture probes and sensors. I have made a 555 timer circuit which opperates with the HS1101 and produces 6666Hz at normal humidity (that is to say what it was in the room at the time).

If I connect to the 5th input pin (pin 4) and use this code:

Code:
main:
count 1, 1000, w1 ‘ count pulses in 5 seconds
debug w1 ‘ display value
goto main ‘ else loop back to start
Then it should count the number of pulses in a second? Which should be 6666. My question is though instead of using w1 whatever that is, can I replace it with one of the variables? For example b1 then use if b1 = 6666 do this if 5555 do this etc.
 

eclectic

Moderator
@holmedwa04

Variables and values.

Have a look at Manual 1, page 44,
for important background information.

And as further help, the Windows calculator,
Dec / Bin will be useful, in the future.

e
 
Top