hello every one i need help in programing

I am making a project automatic egg incubator which show temperature and humidity on crystal lcd 16x2
and control the temperature with the help of 12v incandescent bulb and 12v fan and i use dht11 for sensing

EXPLANATION: when the temperature goes to 37.5c the light bulb and the fan will stop
and the gear motor get ON for 10 seconds and then OFF for four hours (the gear motor is connected to egg turner which turn the eggs 5 time a day every four hour of delay)
there are two relays RELAY1 and RELAY2
RELAY1 control the light and fan
RELAY2 control the gear motor
But the problem is when i give delay to the RELAY2(gear motor) for four hours the dht11 sensor also use that delay what i do
sorry for my english any one please help me i am uploading the codes check this codes please answer me

// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define DHTPIN 7 // Pin connected to the DHT sensor.

// Uncomment the type of sensor in use:
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

// See guide for details on sensor wiring and usage:
// Overview | DHT11, DHT22 and AM2302 Sensors | Adafruit Learning System

uint32_t delayMS;
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
// Data wire is plugged into port 2 on the Arduino

#define relay A0

  • The setup function. We only start the sensors here
    void setup(void)
    // start serial port
    lcd.begin(16, 2);
    pinMode(relay, OUTPUT);
    // Start up the library

// Print temperature sensor details.


  • Main function, get and show the temperature
    void loop(void)
    lcd.setCursor(0, 0);
    // Get temperature event and print its value.
    float h = dht.readHumidity();
    // Read temperature as Celsius (the default)
    float t = dht.readTemperature();
    lcd.print("Temp: ");
    lcd.setCursor(0, 1);
    // Get temperature event and print its value.

lcd.print(“Humid: “);
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
// Send the command to get temperatures

// After we got the temperatures, we can print them here.
// We use the function ByIndex, and as an example get the temperature from the first sensor only.

// Serial.print("Temp C: ");
// wait a bit:

if (t>19.00)
digitalWrite(relay, HIGH);

digitalWrite(relay, LOW);

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn’t show the posting toolbar, then you can manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

But the problem is when i give delay to the RELAY2(gear motor) for four hours the dht11 sensor also use that delay

This is why you should not use delay. Please spend some time studying File > Examples > 02.Digital > BlinkWithoutDelay and the associated tutorial:

That will teach you how you can use millis() to time actions in your code without blocking the operation of the rest of the code, as delay does.