# Lighting LEDs with a wide range of Celcius values using thermal switching

#### Ja Jang Myeon

Joined Nov 2, 2018
16
Ok, so before I go into this I will admit that I've read so many different possible solutions to this that I think Id have more luck designing a new hotdog. There is a reason I'm a programmer first and a circuit guy last.

What I am trying to build is a circuit that lights one of 5 LEDs based on temperature (figured based on reading that means the LM35 and LM3914?). The LEDs I need to display represent the following temperature ranges:

<0C = White
<=0C to 25C = Blue
>=25C to < 50C = Green
<=50C to < 75C = Yellow
>= 75C = Red

My supply voltage is 24VDC. And what I'm looking for is what I read is being a "dot" solution. As I said, there seems to be a lot of "suggestions" out on Al Gore's Amazing Internet. But none seem to have the input voltage range I have. Can anyone point to a references that might help?

#### wayneh

Joined Sep 9, 2010
16,399
What you’ve read is exactly what I’d use, an LM35 to sense temperature and the LM3914 to divide the temperature ranges into buckets and control the LED display.

The devil will be in the details. It possible you’ll need a opamp to expand (amplify) the voltage range from the LM35, I’m not sure. Still very doable either way.

#### Ja Jang Myeon

Joined Nov 2, 2018
16
What you’ve read is exactly what I’d use, an LM35 to sense temperature and the LM3914 to divide the temperature ranges into buckets and control the LED display.

The devil will be in the details. It possible you’ll need a opamp to expand (amplify) the voltage range from the LM35, I’m not sure. Still very doable either way.
Yep, shows I can read. But that's about it. And, I can look stuff up on Mouser. But beyond that I'm better at herding cats. I need some pretty serious examples. Thank you for confirming my suspicions. I appreciate it

#### Colin55

Joined Aug 27, 2015
519
What you have to do is draw the circuit for the two items and we will fill in the bits between

#### AnalogKid

Joined Aug 1, 2013
8,532
Front page of the TI (formerly National Semiconductor) datasheet, 2004: max. operating temp spec is +70C. If the circuit is in the air mass being sensed, this is a problem for long-term reliability.

Consider basically growing the inside of a 3914 with discrete parts. A quad comparator like the LM339 is available in industrial and MIL temperature ranges.. The circuit is a bit more effort because you create manually the resistor divider string built into the 3914, and provide your own voltage reference. Not a big deal, just stuff to do. There is a circuit trick to switch 5 LEDs with only 4 comparators. The tradeoff is that the output is bar-graph-style rather than moving dot. Adding 3 diodes converts it back to dot-style.

Are the LEDs being switched standard little 20 mA types, or larger strings/arrays?

ak

#### djsfantasi

Joined Apr 11, 2010
6,687
You are a programmer first, you say. Then let me provide a programming solution.

Use a microprocessor. An Arduino Nano will fill the bill. And it’s what I am most familiar with, Arduinos.

Connect the LM35 output to an analog pin. Read in the voltage and depending on the value and use an if block statement to drive one of five pins, corresponding to the measured voltage range.

You shouldn’t drive the LED directly. Use a 2N2222 between each pin and it’s LED.

The Arduino is programmed with a free IDE in a variant of C. Very easy.

#### Ja Jang Myeon

Joined Nov 2, 2018
16
You are a programmer first, you say. Then let me provide a programming solution.

Use a microprocessor. An Arduino Nano will fill the bill. And it’s what I am most familiar with, Arduinos.

Connect the LM35 output to an analog pin. Read in the voltage and depending on the value and use an if block statement to drive one of five pins, corresponding to the measured voltage range.

You shouldn’t drive the LED directly. Use a 2N2222 between each pin and it’s LED.

The Arduino is programmed with a free IDE in a variant of C. Very easy.
I appreciate you bringing up this possible solution, as I have considered it as well. However, The direction I am trending toward is an IC-less solution if at all possible. The reason for that is the lack of space, the management of an additional software baseline and the consumption of power and production of additional heat.

#### Ja Jang Myeon

Joined Nov 2, 2018
16
I've searched the world wide web for videos pertaining to possible solutions and this one strikes me as one that might be useful.
I can probably figure out how to replicate this 5 different times, with a different cutoff for each of the temperature levels I indicated earlier in this post. I am assuming that I can find a thermal switch for each of the cutoffs I listed (maybe not a safe assumption). The problem would be that as the temperature rises in the enclosure, each corresponding light would come on and at some point all lights could conceivably be on. I only want one at a time to light indicating the range of the temp.

Is this pie-in-the-sky?

#### BobTPH

Joined Jun 5, 2013
2,492
A microcontoller is likely to be the smallest solution you could come up with, so don’t reject it on that basis.

An 8 pin PIC could do it, and you do not need transistors if the LEDs are less than 20 mA.

Bob

#### Ja Jang Myeon

Joined Nov 2, 2018
16
A microcontoller is likely to be the smallest solution you could come up with, so don’t reject it on that basis.

An 8 pin PIC could do it, and you do not need transistors if the LEDs are less than 20 mA.

Bob
Do you have a model or part number I can explore?

#### djsfantasi

Joined Apr 11, 2010
6,687
Do you have a model or part number I can explore?
Here is one possible solution.

https://www.microchip.com/wwwproducts/en/ATtiny85#datasheet-toggle

It can be programmed with the Arduino IDE, but needs the Reset pin redefined.

It also comes in a SMT version, really minimizing the space. The DIP form occupied about 0.3”x0.4”. As BobTPH mentioned, if you keep the LED current below 20ma, in addition to the LM35, it’s a one chip solution.

Last edited:

#### AnalogKid

Joined Aug 1, 2013
8,532
The direction I am trending toward is an IC-less solution if at all possible. The reason for that is the lack of space, the management of an additional software baseline and the consumption of power and production of additional heat.
Assuming you meant a uC (microcontroller)-less solution, then ...

I appreciate the sentiment, always my first choice. However, nothing will be smaller, cheaper, less complex, and lower power than one of the newer low-power PIC controllers - IF IF IF you already have a development platform, experience with a language, and compiler you trust.

Separate from that, five thermostats staged 25 degrees apart certainly will work. Good news - zero static power. Bad news - accuracy, size, and cost. Look up "snap disc thermostat". Selco is a big name. An old name is Klixon; used to be a part of TI.

Back in the 80's I did something similar for an experimental image processing system at an air base in Alaska:
Below 0C - heaters
0C to +40C: nothing
Above +40C: fans
Above +60C: more fans

Three snap discs, no "electronics", ran forever. However, snap-discs rated to survive at -50C were expensive. The one fan that ran with the heaters was $1200. Back to you, if you still want to go uC-less, I think the comparator circuit will work well for you. ak Last edited: #### djsfantasi Joined Apr 11, 2010 6,687 Assuming you meant a uC (microcontroller)-less solution, then ... I appreciate the sentiment, always my first choice. However, nothing will be smaller, cheaper, less complex, and lower power than one of the newer low-power PIC controllers - IF IF IF you already have a development platform, experience with a language, and compiler you trust. Separate from that, five thermostats staged 25 degrees apart certainly will work. Good news - zero static power. Bad news - accuracy, size, and cost. Look up "snap disc thermostat". Selco is a big name. An old name is Klixon; used to be a part of TI. Back in the 80's I did something similar for an experimental image processing system at an air base in Alaska: Below 0C - heaters 0C to +40C: nothing Above +40C: fans Above +60C: more fans Three snap discs, no "electronics", ran forever. However, snap-discs rated to survive at -50C were expensive. The one fan that ran with the heaters was$1200.

Back to you, if you still want to go uC-less, I think the comparator circuit will work well for you.

ak
Why would you use five separate thermostats?

#### AnalogKid

Joined Aug 1, 2013
8,532
Why would you use five separate thermostats?
I didn't.
I did something similar
I used three, one NC and two NO (for increasing temperature).

ak

#### djsfantasi

Joined Apr 11, 2010
6,687
Separate from that, five thermostats staged 25 degrees apart certainly will work. Good news - zero static power. Bad news - accuracy, size, and cost. Look up "snap disc thermostat". Selco is a big name. An old name is Klixon; used to be a part of TI.
Ok, I misunderstood your previous post. Particularly the reference to five thermostats.

#### AnalogKid

Joined Aug 1, 2013
8,532
The "five thermostats" came from extending the video posted by the TS to his original question in post #1.

ak

#### Ja Jang Myeon

Joined Nov 2, 2018
16
All,

I found some documentation on a TI LM26 series Factory-Preset, Solid-State Thermostat. They look very interesting, SMD mount and very small. Cute little buggers, not that looks have anything to do with it. I would have to have a buck converter to drop the voltage from 24vdc to the 5VDC range, but from my small nut-storage bin I see 5 pre-programmed LM26s with LEDs and a smattering (technical term) of resistors/capacitors to get it to work. Sanity check?

In case anyone is curious, here is the Mouser part number for one of the LM26 Solid State thermostats, specifically the 45C one. 926-LM26CIM5NPANOPB

Last edited:

#### AnalogKid

Joined Aug 1, 2013
8,532
For the power levels you are working with, consider a linear regulator. also, Analog Devices (now including Linear Technology) and Maxim (now a part of Microchip) also make solid state thermostats.

Note - for long term reliability, never run an output pin at more than 1/2 its rated current. Many thermostat IC outputs are designed to drive a microcontroller input pin, not an LED. This is why I asked about the LEDs.

ak

#### Ja Jang Myeon

Joined Nov 2, 2018
16
For the power levels you are working with, consider a linear regulator. also, Analog Devices (now including Linear Technology) and Maxim (now a part of Microchip) also make solid state thermostats.

Note - for long term reliability, never run an output pin at more than 1/2 its rated current. Many thermostat IC outputs are designed to drive a microcontroller input pin, not an LED. This is why I asked about the LEDs.

ak
I'm sincerely sorry I missed your question about the LEDs, AnalogKid. My problem, and I know they're many, is I don't know how to build the circuit. I can think it, but I can't write it. Can you sanity check my thought processes?

1. The basic LM26 would be the 0C one and be "on" by default and driving a blue LED.
2. Once the temperature went above 0C, the 0C LM26 would "fire" and the circuit would cut off power to the blue LED and "somehow" allow power to the LM26 that cuts off at 45C, and drives the green LED.
3. If the temperature rises above 45C, the MS26 fires and cuts off temperature to the Green LED and pass power to the Yellow LED at 65C.
4. Same thing as it passes power to the final LM26 which fires at 75C and lights the red LED.
I can already figure there are transistors and other things here. But does this make sense? The part I'm interested in is that the LM26s are all preset at the factory so that there is nothing more than the LM26s and whatever components like LEDs to make it work. No code or micro-controllers. Am I outstanding in my field (as the saying goes)?

#### AnalogKid

Joined Aug 1, 2013
8,532
The question about the LEDs is what is the voltgae and current for each one? For example, if these are single, small LEDs then the voltage drop across them is called the forward voltage, with the symbol Vf. For standard little red, yellow, and green LEDs it usually is around 1.8 V to 2.1 V, with a standard operating current of 20 mA. White and blue LEDs usually have higher Vf values.

With this information we can determine whether or not a sensor chip or comparator circuit can drive the LEDs directly, or if we need to add a driver transistor (current amplifier) to get full brightness.

ak

Last edited: