I'm pretty sure, He has incorrectly wired the lm35 and that caused the weird behaviour. Tested in proteus, working firmware with wrong lm35 wiring causes relay always on.
Conclusion, I need a drinkRichard's code and schematic is the correct one. Please use it, it works.
Just in case, here is the schematic and code for lm335:
Bookmarks