This is an easy build for most novices, and is a great beginners project for those who wants to learn how to solder, or have very few components at hand. The components are also cheap if you need to buy them.
With this instrument you are able to preset two temperatures with two rotary dials. One upper limit, and one lower limit. When the “on”-button is pressed, the rgb led will light up in either of it’s three colors (red, green, blue – RGB). Red light means that ambient temperature is above your upper limit and blue light means that ambient temperature is below lower limit. Green light indicates that you are within both limits. The instrument is only turned on while checking led color, so battery life is ~forever.
The main parts of this circuit is the 100K Ohm NTC thermistor and the LM393N dual comparator. A thermistor is a temperature dependent resistor, which resistance increases linearly with its surrounding temperature. The idea is to make three voltage dividers:
1. From potentiometer (pot) 1, and a fixed value resistor (v1)
2. From pot 2, and a fixed value resistor (v2)
3. From a thermistor and a fixed value resistor (v3)
v1 and v2 will increase and decrease depending on which way the pot is turned. Voltage v3 will vary depending on the NTCs surrounding temperature. What we want to do is compare both voltage v1 and v2 to v3. If v1 drops below v3, output on comparator #1 will drop to 0v, and start sinking current for the common anode rgb led “red” pin (from now on called the red cathode). Likewise, if v2 drops below v3, output on comparator #2 drops to 0v and starts sinking current for the blue cathode.
Now, if both comparator outputs are high, we know that we must be in between both set points, and need to sink current on the green cathode on the rgb led. This is solved by making a NAND-gate with two general purpose NPN transistors. A NAND-gate has two inputs and one output. The output is low only when both inputs are high The output is high on all other conditions. To the left you see the schematic of a NAND gate and the transistor equivalent. For the transistor equivalent to work exactly like real NAND-gate you will need an extra pull-up resistor for the output to go high on the correct conditions, but this is not needed in our case here.
Further down you can see the whole schematic. Please note that not all potentiometers nor NTC thermistors are alike, and this circuit is designed to match the values of what I had on hand.
– Thermistor (lower left corner). Not to be confused with a regular resistor!
– LM393N. DIP 8 package IRL, but pin-outs on schematic is not “comparable” (hah…).
– R7, the LED series resistor. This is the common series resistor for all cathodes, I’m allowing this because only one color is to be lit at the same time.
– R12, R13 (upper left corner). Pull-up resistors on the comparator outputs are needed for the comparator to be able to switch between Vcc and GND.
– R8-R11 (at the transistors). Biasing- and base resistors to keep transistor base voltages at the right level, and to ensure a fully switched off transistor when comparator outputs are low.
– SW1 (top). In my circuit this is a momentary switch, you can use whatever, but remember that this instrument does not need to be switched on while in use or while taking measurements. The thermistor resistance will increase and decrease by temperature even though no voltage is applied.