# What is the cause of the error/unexpected outcome in water temperature control heating system circuit?

Here is the circuit with components I built as shown over here. The title of the circuit is water temperature controlled system. The function of this system is to control the heating while sensing the temperature, but due to safety purposes, I used a red LED to represent as the heating element. The op-amp act as a comparator to compare the voltages of the NTC thermistor,VA and the potentiometer at preset resistance,VB as shown in the diagram.

The resistance of the NTC thermistor is 2kohm when the water temperature is 50˚C, so I set the potentiometer 2k so that when the water temp. is approximately below 50˚C, the LEDs will up; when temp. is above 50˚C, the LEDs won't light up. To do this experiment, I used hot water around 52˚C and I started recording the data until it cools down to lower than 50˚C, to see if the outcome is expected or not.

The expected outcome is that when the water temp. is approximately below 50˚C, there will be a positive voltage difference between VA and VB (VA>VB), the op-amp will turn on and both green and red LEDs will light up to show that the transistor and relay are turned on and so is the heating element (represented by red LED).LEDs won't light up when VA=VB,and VA less than VB

Here is the problem. The actual outcome I observed is not expected:

In 50.7˚C, VA=4.25V, VB=4.54V, No LEDs light up. but there is voltage difference

In 50.6˚C, VA=4.25V, VB=4.58V, ONLY green lights up (unexpected outcome).

In 49.3˚C, VA=4.25V, VB=4.71, then BOTH red and green start to light up

Both LEDs only light up when the voltage difference is a bit larger which is 0.46V. Why does the red LED light is a few degree Celsius delayed from the green LED? Is it the cause of hysteresis in the op-amp?

*In the diagram,the orientation of the green LED is wrong, the positive terminal should connect to relay.

• Check the output of the opamp in those three setting you already did for the inputs, due to the high gain of the opamp it is weird that you have a difference of VA=4.25V, VB=4.54V and still the opamp has not saturated its output to the positive supply.
– jDAQ
Mar 1 '20 at 6:06
• Actually, since you $V_A < V_B$ in all cases this all seems very weird, as you output should have been 0 V all the time. The output of the opamp is $V_o = K(V_A- V_B)$. Try switching $V_A$ and $V_B$ and that will probably get the result you want.
– jDAQ
Mar 1 '20 at 6:09