Temperature control using relay.

wvmarle:
What you call interval most would call lastMillis or something like that, as the 600000 value is the interval. Very confusing to use wrong words for variable names.

It is also customary to use booleans to keep track of the status of various pins, rather than doing a digitalRead() on those pins time and again. Of course it works, it's not the best way (slower & increases program size).

There's a point where the temperature goes over 30 and comments state you start the exhaust.

A bit further there's a point where the temperature is <28 and your comments say that there you start cooling the room. That doesn't make sense.

Statements like exhaust= !exhaust toggle the value - while probably what you really want to do is set it to a certain level, so you should make that exhaust = HIGH or exhaust = LOW as needed. That also makes your code a bit clearer again in what it should do.

Otherwise you have to be really really careful that you don't toggle the value time and again: in your software as long as the temperature is <28 you'll be toggling that exhaust value every time the loop runs, which is almost twice a second.

I am using relays for controlling the exhaust and the cooler .my understanding is this when the pin mode is HIGH the relay turns OFF and turns ON if the pin mode is LOW .I am quite confused at the millies part. Is the millies not an option to my sketch?