I think providing the code and circuit diagram in the post itself would improve your chances of getting response.
Below is an incubator
R1 - Fan
R2 - Heating Element
R3 - Humidifier
R4 - Dehumidifier
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 2
const int ok = A3;
const int UP = A1;
const int DOWN = A2;
const int relay1 = 8; // relay1 (FUN)
const int relay2 = 9; // relay2 (HEATING ELEMENT)
const int relay3 = 10; // relay3 (HUMIDIFIER)
const int relay4 = 11; // relay4 (DEHUMIDIFIER)
int ack = 0;
int pos = 0;
int sec = 0;
int Min = 0;
int hrs = 0;
int T_threshold = 30;
int H_threshold = 60;
int SET = 0;
boolean T_condition = true;
boolean H_condition = true;
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2);
void setup() {
// Buttons
pinMode(ok, INPUT);
pinMode(UP, INPUT);
pinMode(DOWN, INPUT);
// Relay
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(relay4, OUTPUT);
pinMode(relay3, OUTPUT);
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay4, LOW);
digitalWrite(relay3, LOW);
digitalWrite(ok, HIGH);
digitalWrite(UP, HIGH);
digitalWrite(DOWN, HIGH);
lcd.init();
lcd.backlight();
Serial.begin(9600);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temperature &");
lcd.setCursor(0, 1);
lcd.print("Humidity ");
delay (3000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Controller For");
lcd.setCursor(0, 1);
lcd.print("Incubator");
delay (3000);
lcd.clear();
Serial.println("Temperature and Humidity Controller");
}
void loop() {
if (SET == 0) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Set Temperature:");
lcd.setCursor(0, 1);
lcd.print(T_threshold);
lcd.print(" *C");
while (T_condition) {
if (digitalRead(UP) == LOW) {
T_threshold = T_threshold + 1;
lcd.setCursor(0, 1);
lcd.print(T_threshold);
lcd.print(" *C");
delay(200);
}
if (digitalRead(DOWN) == LOW) {
T_threshold = T_threshold - 1;
lcd.setCursor(0, 1);
lcd.print(T_threshold);
lcd.print(" *C");
delay(200);
}
if (digitalRead(ok) == LOW) {
delay(200);
T_condition = false;
}
}
lcd.backlight();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Set Humidity:");
lcd.setCursor(0, 1);
lcd.print(H_threshold);
lcd.print("%");
delay(100);
while (H_condition) {
if (digitalRead(UP) == LOW) {
H_threshold = H_threshold + 1;
lcd.setCursor(0, 1);
lcd.print(H_threshold);
lcd.print("%");
delay(100);
}
if (digitalRead(DOWN) == LOW) {
H_threshold = H_threshold - 1;
lcd.setCursor(0, 1);
lcd.print(H_threshold);
lcd.print("%");
delay(200);
}
if (digitalRead(ok) == LOW) {
delay(100);
H_condition = false;
}
}
SET = 1;
}
ack = 0;
int chk;
chk = DHT.read(DHT11_PIN); // READ DATA
switch (chk)
{
case DHTLIB_OK:
//Serial.print("OK,\t");
break;
case DHTLIB_ERROR_CHECKSUM:
//Serial.print("Checksum error,\t");
ack = 0;
break;
case DHTLIB_ERROR_TIMEOUT:
//Serial.print("Time out error,\t");
ack = 0;
break;
default:
//Serial.print("Unknown error,\t");
break;
}
// DISPLAT DATA
Serial.print("DHT11, \t");
Serial.print(DHT.temperature, 1);
Serial.print(",\t");
Serial.println(DHT.humidity, 1);
delay(100);
if (ack == 0)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Temp:");
lcd.print(DHT.temperature);
lcd.setCursor(0, 1);
lcd.print(" Humi:");
lcd.print(DHT.humidity);
delay(500);
if (DHT.temperature > T_threshold) {
if (DHT.temperature > T_threshold) {
digitalWrite(relay3, HIGH);
}
}
delay(500);
if (DHT.temperature < T_threshold) {
if (DHT.temperature < T_threshold) {
digitalWrite(relay3, LOW);
}
}
if (DHT.humidity > H_threshold) {
delay(500);
if (DHT.humidity > H_threshold) {
digitalWrite(relay4, HIGH);
}
}
if (DHT.humidity < H_threshold) {
delay(500);
if (DHT.humidity < H_threshold) {
digitalWrite(relay4, LOW);
}
if (DHT.temperature < T_threshold) {
delay(500);
if (DHT.temperature < T_threshold) {
digitalWrite(relay1
, LOW);
}
}
if (DHT.temperature > T_threshold) {
delay(500);
if (DHT.temperature > T_threshold) {
digitalWrite(relay1, HIGH);
}
}
if (DHT.humidity < H_threshold) {
delay(500);
if (DHT.humidity < H_threshold) {
digitalWrite(relay2, HIGH);
}
}
if (DHT.humidity > H_threshold) {
delay(500);
if (DHT.humidity > H_threshold) {
digitalWrite(relay2, LOW);
}
delay(25);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("No Sensor data.");
lcd.setCursor(0, 1);
lcd.print("System Halted.");
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay4, LOW);
digitalWrite(relay3, LOW);
}
delay(500);
}
}
}