Craig’s thermostat circuits

August 9, 2009

Overview
The circuits below are variations on basic thermostat designs that can be used to control either heating or cooling devices. I’ve tried to make them as simple, cheap, and thrifty with power as possible. I’m rather fond of them. Potential applications include such diverse jobs as opening flaps or controlling heat in greenhouses, powering automatic fans that only cut in when needed, homebrew cooling and warming, air conditioning, space heating, and just about anything electrical that needs a thermostat to control it between the temperatures of -20 and 125°C. They make use of small components called thermistors, which provide much more accurate response to temperature change than traditional mechanical thermostats.

Simple version
Choose this circuit unless you:

  • Need especially tight hysteresis (see explanation below)
  • Need to drive a heavier relay or other load that will draw more than 50mA
  • Are powering it with small batteries and want to minimise power consumption
Simple version thermostat schematic

The above circuit uses three fewer components than the one below, thanks to the handy and unusual ability of the LM311 integrated circuit to sink up to 50mA directly through its output. This means that no separate transistor is needed for activating many common relay coils, such as the SY4062 from Jaycar that I’ve used.

The 311 is a purpose-built comparator chip (these circuits work by comparing a set voltage with a changing one produced by the inversely temperature-sensitive thermistor). For this application, however, it’s a bit like using a Ferrari to do the work of a wheelbarrow. The 311 is very sensitive and, unless significant feedback is provided, stray electrical noise will tend to make it oscillate (the relay will get jittery). In practice, this means adjusting the VR2 trimpot to achieve a minimum of about 1°C of hysteresis at 25°C (hysteresis is the interval between the points at which the circuit switches on and off). One degree is perfectly appropriate for most uses; but if you need a really tight hysteresis zone, use the circuit below.

Note that keeping all the left-hand-side resistors physically as close as possible to the IC chip helps reduce stray noise.

This circuit draws about 3.5 to 4mA of current in the resting state, which is peanuts in anyone’s language, although the version below draws around 2mA (both measured using 16 volt supply—consumption will be even less at lower voltages).

Versatile version
Choose this circuit if you:

  • Need especially tight hysteresis (see explanation above)
  • Need to drive a heavier relay or other load that will draw more than 50mA
  • Are powering it with small batteries and need minimal power consumption (see paragraph above)
Versatile version thermostat schematic

The above version replaces the LM311 comparator with a 741 operational amplifier integrated circuit acting as a comparator. It is less sensitive to minute disturbances and will allow hysteresis down to 0.5°C or less (at 25°C) without becoming jittery. It can also drive much higher loads thanks to the use of a separate transistor (but see notes 2&3 below).

Instructions for both versions
Cooling or heating?
Both circuits are displayed as cooling thermostats. But in both cases swapping the main inputs to pins 2 and 3 on the IC (integrated circuit, triangle symbol) converts these designs into heater control thermostats. If you do swap these two inputs for heater control, don’t swap the hysteresis feedback to the IC [always leave it connected to the same pin as shown, i.e. pin 2 in the simple version and pin 3 in the versatile version]).

Optionally, a double-pole-double-throw (DPDT) switch can be employed if you want your thermostat to perform both heating and cooling control. Wire the switch so that it acts as an intermediary, swapping the inputs to IC pins 2 & 3, as described above.

Accessibility: Decide whether you want to use the thermostat as a readily-adjustable device (like a wall thermostat) or as a single-temperature, set-and-forget device. If the latter, a trimpot can be used at VR3, or a single trimpot (perhaps a 20k item) can be used in place of both VR1 and VR3—although a single high-resistance trimpot will be touchier to adjust.

Calibration: Start by setting VR2 to roughly the middle of its adjustment arc. Then, assuming you are using two trimpots in series as per the diagrams above, you will need to set the minimum temperature of your desired adjustment-range with the VR1 trimpot. Do this by setting VR3 to its maximum resistance, bringing the thermistor to the temperature you want to use as the minimum, then adjusting VR1 so that the circuit trips at that point. Next you can either set (if using a trimpot) or calibrate (if using a potentiometer and panel-mounted dial) VR3. If calibrating a scale, it will not be perfectly linear because of the thermistor’s natural response curve, so you’ll need to mark off several points. Before firmly committing to either a scale or set-point, adjust the hysteresis trimpot, VR2, to provide an effect that suits your application. This change might throw off your scale or set-point slightly, so go back and check.

My unit, which matches the above diagram, is adjusted for a minimum temperature of about 18° Celsius. The main 5k panel-mounted pot extends the range up to about 28°C, marked in increments of one degree. If you want a wider range, use a 10k pot at VR3. If you wish to use the circuit for much lower or higher temperatures (the thermistor is rated for -20 to 125°C), you can subject the thermistor to the target temperature range extremes, measure its resistances with a multimeter, and plan out your pot values accordingly. The thermistor has lower resistance at higher temperatures. Its rated resistance of 10k occurs at 25°C. At 30°C it is more like 7k and at 17°C it’s something like 14k. See note 6 below if you want to work with much colder or hotter temperatures.

Warning: If you intend to use high voltage / household mains electricity in conjunction with these circuits, make sure you comply with local laws. Do not attempt to work with mains power unless you are suitably competent or qualified. I take no responsibility for damage or injury you might cause by electing to build, modify, or add to these circuits.

Shopping: All parts used in these circuits should be readily available around the world. Radio Shack in the US carries an equivalent thermistor, for example, and possibly all the other parts too. Here in Australia, Jaycar and Altronics, stock everything. Dick Smith only carry a 100k thermistor, which would suit a modified circuit for higher temps (note 6). Jaycar and Dick Smith are in NZ too. Parts in yellow are used in the second ‘versatile version’ circuit only.

Parts list

Component Detail Data
Sheet
Jaycar Cat No. Price approx,
AUD
IC LM311 or
LM741
PDF
PDF
ZL3311
ZL3741
1.30
Transistor PN200 or similar
PNP type
PDF ZT2284 0.25
Diode IN4148 or IN914 PDF ZR1100 0.32 / 5pk
R1,2,3,4 10k resistors     0.38?? / 8
R5 10k NTC thermistor PDF RN3440 0.95
VR1 10k trimpot     0.32
VR2 500k or 1meg trimpot     0.32
VR3 5k linear potentiometer (or trimpot for set-&-forget)     2.25 /
(0.32)
  $4-6 total !!

Extra components you might want

  • A power supply such as a plug pack or battery. 12 volts will provide easy compatibility with common relays, computer fans, bulbs, etc.
  • A relay of some kind if you intend to switch high currents and/or voltages.
  • A piece of punched fibreglass board on which to build the circuit.
  • An 8-pin socket to suit the integrated circuit. For a few extra cents, this protects the IC from soldering heat.
  • A housing of some kind. Jaycar and Altronics have great project boxes if you’re in Oz/NZ, otherwise electrical wholesalers carry big plastic junction-box thingos that can be used.
  • A front panel knob for the temperature-set pot.
  • Optionally, a double pole-double throw (DPDT) switch will allow the unit to control both heating and cooling apparatus. See above, under Heating or Cooling?.

LM311 LM741

PN200

Notes

  1. The thermistor can be used as a remote probe. It can be encased in silicone, epoxy, or something similar for applications where it will be immersed in liquid.
  2. In theory, this circuit should work with anything between 5 and 36 volts DC. If you deviate too far from the middle ground of this voltage range, however, you might need to tweak some of the right-hand-side resistor values. I’m not sure. My circuits run at 16v, employing a 150 ohm / 0.5w resistor in series with the relay coil to drop the voltage to around the 12v it requires.
  3. Likewise, if using higher currents through the transistor to power, say, a heavy-duty relay, solenoid, fan, or lamp, you might need to reduce the value of R4 down to 5k, 1k, or lower to ensure that the transistor remains saturated. The 10k item as depicted is known to work with a relay coil drawing 50mA, so any coil requiring less would be covered too, provided your circuit voltage is not too much lower than mine. In fact, the above also worked with R4 at 20k, so there’s some leeway built in. If your circuit doesn’t work for you, either consult some appropriate literature on configuring transistors, or maybe try a 500ohm resistor at R4, and work your way up. When the transistor is adequately saturated, the voltage at its collector (the ‘C’ pin) should be near Vcc (the circuit’s full positive voltage).
  4. The maximum current available to power the relay, solenoid, etc, is dictated by the “Ic” rating of the PNP transistor chosen. Consult the data sheets for your intended load device and transistor. The PN200 used here will handle up to 500mA.
  5. The diode protects the IC from damaging voltage spikes caused by the collapse of the relay coil’s field when it shuts off. Omit this component only if you’re powering something without a coil. If powering a fan in equipment sensitive to radio noise, place an electrolytic capacitor across the fan junction (say, 1000 microfarad).
  6. If you intend to control much higher or lower temperatures, you might want to consider using a thermistor better matched to your target temperatures. The NTC (negative thermal coefficient) thermistor will have a much higher resistance in sub-zero temperatures and much lower in, say, boiling water. A 4.7k or 1k thermistor would probably be more appropriate for cold conditions; a 47k item, at least, would better suit the hotter end of things (remembering that these thermistors are physically rated for -20 to 125°C, so cryogenics and furnace work is out!). The point is to balance the comparator’s voltage seesaw (so that the resistance feeding the “-” pin on the IC is similar to that feeding the “+” pin). You might notice that these circuits, operating around the 25°C point, use two resistors at the top-left that coincide with the thermistor’s resistance around that temperature (10k @ 25°C). Similarly, the temperature-control pots attempt to anticipate and match the thermistor’s resistance swing through the operational temperature range. So if you know you will be working with more extreme temperatures, buy a thermistor at least one step removed in the series and you might be pleasantly surprised to find that the above circuits need minimal or no modification. See the thermistor data sheet for options.
    NTC resistance formula [Update] Ilija has kindly tipped me off to this formula for calculating NTC resistance at a targeted temperature (where T is in degrees Kelvin). He provides the following example for 35°C: R(35) = 10000*e^4100(1/273.15+25 – 1/273.15+35) = 6350 ohm.
  7. Optionally, you might like to calculate and modify your circuit’s expected hysteresis, and learn more about the Schmitt Trigger concept that these circuits employ at this site. There you will find a useful online calculator for key circuit values. Or you can refer to the following Schmitt Trigger formulae (again, thanks to Ilija).

    Schmitt trigger formulas

  8. By the way, your power supply’s negative is connected to the ground symbol (lower) side of the circuit, in case anyone is wondering…

 

In Conclusion
Please don’t be fooled by the above into thinking that I know heaps about electronics. This has been a collaborative effort with the people listed below. If you have really serious technical questions, there’s probably no point contacting me; but I’d be very pleased to hear any stories of success and obscure / creative uses.

My thanks to:
Boot
Bob Monsen
Terry Rinnel
Michael Ballbach
Rob Paisley
John Fields
Stefan Trenthan
Mariss Freimanis

My finished unit

 

Postscript
Ilija has very kindly provided a few files detailing his reportedly successful prototype adaptation of the LM741 circuit above. He has incorporated a simple mains / 10 volt power supply into the circuit which drives a TIC226 triac load. Many thanks Ilija!

Note that the power supply portion of Ilija’s circuit contains an error. The BZV10 is actually rated at 6.2V, not 10V. Ilija’s intention was to use any 10V zener diode. Alternatively, he suggests a 7810 voltage regulator instead of the zener, which will provide for more stable voltage.

Note also that I have not tested these variations myself and cannot vouch for their effectiveness. I presume that the PCB design would have to be slightly modified for a 7810, for example, and I see that the layout in the top picture does not quite match the photograph.

Eagle format printed circuit board (5kb)
Eagle format schematic (29kb)
Browser image schematic (40kb)

 

PCB design

Front

Back

http://www.craig.copperleife.com/tech/thermo/

Leave a comment