Hi there,
The two diodes D5 and D6 are there to provide a pseudo minus supply voltage for the LM358. Without a negative supply the output of the op amp can not reach down as low as 0.000 volts, but may only make it down to 0.050 volts or so. Since the output of the LM35 is about 10mv per degree C, at 5 deg C the output will be 50mv which is already as high as the op amp output could reach without a minus supply voltage and without any hysteresis. With the minus supply voltage provided by the two diodes, the op amp pin 1 output can reach down below zero volts which means it can be adjusted as low as needed even with the added hysteresis, which of course means pin 1 has to go even lower (about 33mv) in order to adjust for 5 deg C.
The secondary effect is that the op amp output at pin 7 can also go lower than zero volts which provides a little better hysteresis.
With the output at pin 1 adjusted for a trip point of 5 deg C, after the trip occurs the temperature would have to drop to about 3 degrees C in order to turn the relay off again. That's only 2 deg C of hysteresis which may or may not be enough for the app itself, as well as probably not enough to get past the effects of noise from the relay when it switches.
One fix for this may work that is not too hard to do, depending on how bad the environmental noise is. Right now the circuit has only DC hysteresis which works ok most of the time, but for these tight settings we may have to add some AC hysteresis too and that may help a lot. The simplest way to do this would be to connect a capacitor of 100uf in series with a 10k resistor, then connect that series combo right across the 4.7M resistor with (+) terminal of the cap at pin 7 of the op amp. The cap will charge up to around 8v, then when pin 7 goes low it will pull pin 5 down very very low which will keep pin 7 low regardless what the LM35 does after that (such as it's reaction to the relay noise). The cap will discharge after some 1 to 5 seconds which will allow
the op amp to be ready for the next time the LM35 output goes lower and trips the lower set point. Once that happens, the output will again go high which will force a rather high voltage at pin 5 which will keep the output at pin 7 high for that same time period of 1 to 5 seconds, after which it will again allow normal operation.
Note that this is something to try and cant be guaranteed that it will work because it depends on the other noise factors too.
A second additional fix may come from filtering the output of the LM35 with a 75 ohm resistor in series with a 1uf cap with the cap to ground and 75 ohm connected to the output of the LM35. That will help reduce noise transients from the output of the LM35 when the relay switches.
What else we need to know however is what the TWO trip points are, not just the one.
We need to know what temperature the relay is to turn on and what temperature it is to turn off.
Often a "window" comparator is best for these temperature applications because it allows us to adjust the upper trip point and the lower trip point independently of each other, and thus gives complete control over set point and hysteresis. That would require several circuit changes too however.