# Switch on and off a relay based on two different thermistor values

I am planning to add an electric fan to cool down an old car's radiator based on coolant's temperature.

I have a temperature sensor of which I know the resistance/temperature profile. Let's say when the coolant reaches 90°C (50 Ohms) I'd like a relay to close to drive the fan. Then when the coolant goes below 70°C (97 Ohms), I'd like the relay to open as the car is then cold enough.

Switching the fan ON circuit is commonly found such as this example.

I have trouble figuring a way to open the relay at a different resistor value than the value it required to close.

I know I could use a microcontroller and a few lines of code to make this, but for reliability and simplicity (and personal curiosity), I would prefer a fully electronic system.

Looking for an example circuit or tips to drive me to a possible solution.

• I would prefer a fully electronic system. A microcontroller is also "fully electronic", you mean you want an "analog" solution. If you have a spare contact on the relay you could use that contact to add/remove a resistor in the circuit to shift its on/off decision point. The same (adding hysteresis) can be achieved without the extra relay contact, one way is to use an opamp, here's an example: craig.copperleife.com/tech/thermo Commented Jun 11, 2021 at 7:57
• Indeed, I wasn't sure how to phrase this. Also "hysteresis" is the word I was missing in my research. Seems like this should help me find lots of example. Commented Jun 11, 2021 at 8:08

You're looking for a comparator with some hysteresis to create a difference between switch on and switch off.

Figure 1. Image from Techniques for analyzing Comparator circuits? where there is further information on the topic.

You may want to regulate the voltage supply to your circuit to prevent variation in operation with engine speed and noise.

VREF can be generated by voltage divider or a potentiometer. VIN will come from a potential divider consisting of a resistor and your temperature sensor.

• This seems like the way to go. Not sure it makes the circuit simpler than using a microcontroller, if I have to regulate the voltage and all, but will try to make it work. Thanks. Commented Jun 13, 2021 at 15:24
• You'd need a 5 V or 3.3 V regulator for the microcontroller anyway. With the right comparator you can run this circuit on 5 V too. Commented Jun 13, 2021 at 15:30

You can also use a digital gate with hysteresis. Some are operating to 15 V. You can adjust the levels with added resistors. see CMOS 4000 series (4093 quad 2-input NAND with Schmitt trigger inputs). The 4093 has Schmitt trigger inputs to provide good noise immunity. They are ideal for slowly changing or noisy signals. The hysteresis is about 0.5V with a 4.5V supply and almost 2V with a 9V supply... See https://electronicsclub.info/cmos.htm You must use a driver (Transistor or MosFet or integrated function) for the relay.

• That seems like a great solution. Is there any way to control the upper and lower threshold ? I have only one temperature sensor hooked, and with a voltage divider the hysteresis thresholds are dependent of a single resistor value (Once R chosen for a a specific ON temperature, the OFF temperature is dependent of that R value). Commented Jun 11, 2021 at 14:02
• @Fredovsky, no, both the threshold and the hysteresis will be fixed. Commented Jun 11, 2021 at 16:45