From what I understand you have temperature control since you have a heater in the system. How you go about it, for humidity control can vary significantly depending on the system implementation
Suggested Humidity control through cooling heating
If you want to actually control the humidity the way a lot of HVAC units do is to:
- first cool the air you are taking in to the dew temperature so that the extra moisture condenses
- then heat it up again to the desired temperature.
In order to find the dew temperature you'd need to know the
- the target temperature $T_t$ in the greenhouse and
- the desired humidity $RH_d$
Once you have those (e.g. $T_t=25^oC$, $RH_d=50\%$), you go to the following map, and
- find you starting point (from the Dry bulb temperature you go up until you meet the 50% RH curve).
- Then you turn left and go to the far end of the curve of RH 100%
- Then you move downwards and the dry bulb temperature you arrive at is the dew temperature (in this case $14^oC$).
Basically, one interpretation of the dew temperature (in this context), is that at dew temperature the air can hold at most moisture content, that at the desired temperature you will have the desired humidity.
Of course a shorter (and less accurate way is to use the following equation):
$$T_d = T_t \cdot\frac{ 100- RH}{5}$$
where:
- $T_d$: is the dew temperature
- $T_t$: is the target temperature
- $RH$: is the relative humidity expressed in % units.
So for the above example the dew temperature would be predicted as $T_d=15^oC$, which is quite close as an approximation.
The above is the suggested solution if you want to control temperature. Otherwise you'd be dependent on the weather to let air in, and that by itself encourages mold.
Algorithm for your setup
If you can't have that (it's actually quite intensive to cool air and then heat it up again), after you have determined the ideal conditions for your greenhouse (see above) you can use the map to estimate what is the desired water in grams per kg or dry air. To do that you follow the green arrow to the right (for the example of $T_t=25^C$, $RH_d=50\%$) you get 10g of water per kg of dray air.)
Then you calculate the humidity ratio (g of water per kg of dray air) for the conditions of the intake air. if the humidity ratio is greater than the desired you don't let the air in. If the humidity ratio is less than your desired you can let it in. (or you can do that with the approximation of the dew temperature).
Also a really good site for getting simplified equation for the moisture in the is the following. If you are tech savvy then you'd be able to program the thing yourself.