Well that is what I am getting at. I did not know humidity is not much of a problem. So I would maybe have the algorithm wrong. I still think the only ones that can write a correct algorithm for a system is one that completely understands the system. Getting that into code is another story, many here can help with that.

About the gas sensor. If you can not find one for ammoniac, maybe use an O2 sensor. If I remember correctly, when NH4 goes up O2 goes down. If nothing else is messing with the O2 levels...