Yeah, but I upload this code in arduino, add a wires, relays, display and temperature sensor and it works.
Maybe there is some mistake in wiring? But i dont think so.
I test schematic. Heater starts at 23 degrees, stops on 25 degrees, when the temperature drops down again to 23 heater starts again.
If I use this code:
if(temperature < 23)
{
digitalWrite(red,HIGH);
digitalWrite(blue,LOW);
lcd.setCursor(0, 3);
lcd.print(" Silda");
digitalWrite(RELAY1,0);
digitalWrite(RELAY2,1);
}
else if(temperature > 27)
{
digitalWrite(RELAY1,1);
digitalWrite(RELAY2,0);
digitalWrite(red,LOW);
digitalWrite(blue,HIGH);
lcd.setCursor(0, 3);
lcd.print(" Dzese");
lcd.setCursor(0, 3);
}
}
Then heater starts at 23 degrees and stops only in 27 degrees, when cooler starts. Every time the heater or cooler is on. Thats the problem. In other words The RELAY1 or RELAY2 is every time on, but I dont need that. In need when the RELAY1 or RELAY2 starts only at the temperature,
which one I set in code.