For school project I'm making controlled air quality(temperature,humidity(DHT22) and co2(mq135)) in farm. For controlling co2 I'm using linear actuator on window, for temperature I'm using heater, the humidity is not so important for now. The linear actuator is controlled with two relays (forward/backward) and the heater with one relay (on/off). Temperature is different every day, on first day need to be 30°C on last day 15°C, but air quality must stay at least good all the time. The problem become with writing the code because I don't know what to use to make the project working. I was thinking to use PID library for controlling CO2 (controlling window)(because I have no position of linear actuator). I can control temperature with heater only for 15 days because after that day animals reduce enough heat by them self and is not so good if on 30 day is temperature 25 instead 20 even the air is good. So I need to compromise somehow temperature and air quality with window after 15 days. Does anyone have any good idea how to control this two parameters with window after 15day ?
What are these animals? Are you making some kind of incubator/litter raising system?
chickens, yes something like that.
First you need to have some idea of how the position of the window should change to alter the conditions. For example does more CO2 require more opening? Does a higher temperature require more opening, etc.
Then I would write a short and simple program that reads the sensors and moves the window in response.
When you have that simple system working it will be time to consider whether it needs a more sophisticated control system.