Author Topic: Below temperature circuits with leds  (Read 1668 times)

0 Members and 1 Guest are viewing this topic.

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Below temperature circuits with leds
« on: December 31, 2024, 05:00:56 pm »
I would like just information about what is supposed to happen.

I have seen  couple of different said circuits which use leds, and I ended up building one using an LM35 and LM741. There are 2 leds, 1 red and 1 green and when the circuit is powered by 9v both leds are lit but the red one can be turned off.

My question here is, if the temperature is below a certain figure does the red led come on, and should the green led stay off until the temperature reaches the set figure, say 20C, and then the red led goes off. is that how they supposed to work.

If required I'll post the link to the circuit I have built, which is still in testing  stage at the moment.
Thanks
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #1 on: December 31, 2024, 09:17:39 pm »
Sorry, my crystal ball has gone cloudy.

Note that the LM741 doesn't work when its inputs are within 2V of the positive or negative rail, so both inputs need to be within 2V to 7V, when run off a 9V battery.

Post a schematic.
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #2 on: December 31, 2024, 11:11:16 pm »
As requested:
https://www.gadgetronicx.com/temperature-controlled-led/

I changed the CA3031 for LM741
I changed BC107 to BC547,
The above changes were made because I didn't  have what the circuit called for, so I used equivalents

R3 is now 1K
R4 and R6 are now 1K
I am running it from a 9V bench supply Pin3 on IC1 is 0.209V, and Pin2 is 2.0V
The red led is off but the green one is permanently on with the current temperature at 20C

Thanks
« Last Edit: December 31, 2024, 11:18:48 pm by RobH »
 

Offline PGPG

  • Frequent Contributor
  • **
  • Posts: 396
  • Country: pl
Re: Below temperature circuits with leds
« Reply #3 on: January 01, 2025, 01:20:32 am »
I changed the CA3031 for LM741

CA3031 can work with input voltage from -0.5V up, while LM741 from 2V up.
As you write you have at pin3 about 0.2V. It is out of LM741 input voltage range.

You can replace OpAmp with popular LM393 comparator (LM193, LM293, LM2903 - all are practically the same). It will work with inputs close to 0V.
It has OC output so you need to modify driving Q1 a little, or probably even can do without Q1.
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #4 on: January 01, 2025, 11:27:27 am »
Thanks for the reply, and my apologies, as I had forgotten that I did change the LM741 to a CA3130, doh!
It was another temporary try out circuit I used a LM741, and the voltages on the respective pins 2 and 3 are different than on the CA3130. With the LM741, pin 2 is 1.8V , and pin3 is -0.07V

So, regarding my question about the leds, does 1 stay on below a set temperature, then goes off then another goes on etc. If not how do they work.
Thanks
« Last Edit: January 01, 2025, 11:38:12 am by RobH »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #5 on: January 01, 2025, 11:48:21 am »
It's possible to use the LM741 but the voltage on both inputs need to be within 2V of the supply rails.

I've redesigned the circuit to work with the LM741.

5V is too low for the LM741. Run it directly from 9V.

Add a 10k resistor from the LM35's negative supply and the potential divider to 0V. The current though the LM35's negative supply pin is fairly constant (typically 56µA) over a large temperature range, so you can get away with it. This will set the voltage at both of the LM741's to about 2.6V. If better temperature stability is required then reduce R3 to 1k and add another 1k to 5V. Another option is to use a voltage reference such at the TL431 and another resistor to the output of the 7805. Now the positive of the LM35 also needs to be connected to 9V, because it needs a minimum supply voltage of 4V and with 2.6V at the negative and 5V at the positive, it would only be 2.4V.

There's no need for those transistors. The op-amp is more than capable of driving the LEDs directly, if the forward current to about 5mA, which the op-amp should be able to handle. If using crappy old LEDs, reduce R4 and R5, but I wouldn't recommend going below 470R.
 

Offline SteveThackery

  • Frequent Contributor
  • **
  • Posts: 787
  • Country: gb
Re: Below temperature circuits with leds
« Reply #6 on: January 01, 2025, 01:30:15 pm »
I think the OP is asking what should happen with the LEDs as the temperature changes.

With reference to the original circuit, the output of the LM35 rises as the temperature rises.

TEMPERATURE BELOW THRESHOLD

Assuming that the LM35 output (connected to pin 3 of the comparator) is lower than the voltage you have set on pin 2, then the voltage on the comparator output (pin 6) will be close to ground. In fact it needs to be less than 0.6V so that it doesn't send current into the base of Q1. In this circumstance:

1/ Current flows from the 5V rail through R4, D1, R5 and into the base of Q2, switching it on, so that current can flow freely from Q2's collector to its emitter. Thus current can flow from the 5V rail through R6, D2 and Q2 to ground, lighting up the green LED (D2).

2/ The base current that switches on Q2 flows through the red LED, which is likely to glow dimly as modern red LEDs are very efficient.

TEMPERATURE ABOVE THRESHOLD

When the temperature rises such that the input voltage to pin 3 of IC3 goes higher than the reference voltage on pin 2, the voltage on IC3's output pin (pin 6) switches high - that is, switches to a voltage just a little under 5V.

This forces current into the base of Q1, switching Q1 on such that current will flow freely between its collector and emitter. This time, the current through R4 and D1 has an easier path straight to ground (via Q2) compared with having to go through R5 and Q2.  Thus two things happen:

1/ Current flows freely through R4, D1 and Q1, lighting up the red LED (D1) brightly.

2/ No current flows into the base of Q2 (because it's all gone through Q1 to ground), switching Q2 off, and therefore no current can flow through R6 and the green LED. Thus the red LED glows brightly and the green LED is off.

As you have already read, there are problems with this circuit, not least that the red LED will probably glow dimly even when it should be off. It also requires a comparator that will drive its output close to the -ve rail in order that Q1 remains completely off under low temperature conditions.

Anyway, that is how the original circuit should behave, which is what I think you were asking in your first post.
« Last Edit: January 01, 2025, 02:32:16 pm by SteveThackery »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #7 on: January 01, 2025, 02:04:23 pm »
Which is something he should be able to figure out for himself.

A a few of hints:

The LM35 has a positive temperature coefficient: +10-mV/°C

The op-amp is configured as a comparator. Its output goes high, when the voltage on +input > -input.

In the circuit linked to by the OP:
 Q1 turns on, when the op-amp's output goes high.
 When Q1 is off, Q2 is turned on, with the base current passing though: R4, D1 and R5.

In the circuit I posted:
D1 turns on, when the op-amp's output is low.
D2 turns on, when the op-amp's output is high.

 
The following users thanked this post: RobH

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #8 on: January 01, 2025, 05:41:47 pm »
Yes I hoped it would work as expected, but it didn't. Initially I built the circuit to the schematic, but when powered up both leds came on and I couldn't turn either off by the pot. I then changed some of the resistors so that I could then turn off the red led. This is the current situation and the green led is on all the time.
The red led is just off at 2.13V on pin2, and pin3 is at 0.213V , and the temperature is almost 21C
---------------------------------------------------------------------------------------------------------------------------------------------------------------
On the circuit which you provided here, if I have understood it correctly, I have not used a LM7805 as yet, because you said to run it off 9v. so I now have a 10k resistor on both the 2 outer pins of the 3K pot ,1 to 9v and the other to GND. In this situation the voltage on Pin2 is 3.62V. using a 3K pot, I can adjust the voltage from 3.62  upto 5.5V, and both leds are lit. The voltage on pin3 is now 0.169V

Thanks
« Last Edit: January 01, 2025, 06:42:35 pm by RobH »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #9 on: January 01, 2025, 07:44:21 pm »
The positive side of resistive divider (R1 & R2) should be connected to the LM7805's output. The negative side of R2, along with the LM35's negative pin, should go to 0V, via a 10k resistor. This is important because it keeps the voltages at both inputs well above 25V, with respect to the op-amp's negative rail.

The fact that pin 2 is at 2.12V and pin 3 is at 0.23V, indicates that the LM35's negative pin is connected to 0V, not the R3, according to my circuit. Check all of the connections again.
« Last Edit: January 01, 2025, 10:40:42 pm by Zero999 »
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #10 on: January 02, 2025, 01:01:08 pm »
I have now connected the LM7805, and rewired the circuit to suit. I have also checked it over as per your schematic, and hope I have it correct now.

The voltages  I get now are:

Across LM35 GND and outer pin of 3k pot: -5.4V
Pin2 of U3 Adjustable between 1.9V and 3V
Pin3 of U3 8.5V

From the OUT pin of LM7805 I get 5V

D2 is on all the time while D1 is off all the time, with a current temperature of 19C

I have attached a picture of my circuit and hope it is clear enough to see the wire connections, or any corrections I might have to make

Thanks for your help and patience.
« Last Edit: January 02, 2025, 05:41:18 pm by RobH »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #11 on: January 02, 2025, 06:32:17 pm »
The negative voltage doesn't make sense, unless you've got the meter probes the wrong way round.

Presumably the out of focus component with the red, yellow and black wires soldered to it, is the LM35. It has no negative connection, other than a capacitor, which will just charge up.
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #12 on: January 02, 2025, 07:42:02 pm »
Yes the out of focus item is the LM35 on wires to lift it up in the air.

Agreed, yes the negative voltage had me wondering why, but as I wired the circuit as per the schematic which shows a 10uf capacitor to the negattive side of the LM35. Should there be both that and a wire. Anyway I removed the capacitor and just used a wire to the negative of the LM35.

Now that makes a big difference:
From Negative of LM35 to the outer pin of the 3k pot, R2, I now get 2.54V on pin2, with both D1 and D2 lit, but D1 can be turned off by adjusting R2
Also the voltage on pin3 is now 0.208V with a current temperature of 20.3C.

« Last Edit: January 02, 2025, 07:44:47 pm by RobH »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #13 on: January 02, 2025, 08:56:36 pm »
Yes the out of focus item is the LM35 on wires to lift it up in the air.

Agreed, yes the negative voltage had me wondering why, but as I wired the circuit as per the schematic which shows a 10uf capacitor to the negattive side of the LM35.
But it's not connected to R3, so it can't possibly work. The capacitor will just charge up. The LM35 needs a DC path to 0V in order to work.

Refer to the picture below. I've added the component idents and a marking to indicate pin one of the op-amp (please do this in future, it doesn't take long). Note the extra missing wire, shown in blue, connecting the LM35's negative to R2 & R2.

Please check your wiring, then check it again, before asking further questions.
« Last Edit: January 02, 2025, 09:41:44 pm by Zero999 »
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #14 on: January 03, 2025, 05:37:27 pm »
I have now added the wire from the negative of LM35 to R2

The readings I get are:

From LM35 GND to R2: 0V
From Pin 2 of U3  between 2.3V and 3.2V
From Pin 3 of U3 2.5V.

The current temperature is 19.7C, so I can't help thinking something else is incorrect. There is only C2 in place with no GND wire

Thanks
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: Below temperature circuits with leds
« Reply #15 on: January 03, 2025, 10:54:50 pm »
Those voltages sound correct. Do the LEDs change state, as R2 is adjusted?
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #16 on: January 04, 2025, 09:19:15 am »
Thanks, but no the leds don't change state when I adjust the voltage on PIn2. When the voltage on Pin2 is at 2.471V  D1 is off and D2 is on. When I increase the voltage to Pin2 , to 2.487V, D1 comes on, but D2 stays on, but not full brightness, as it seems to dim somewhat.
Also, as the temperature has increased by 0.6C, so does the output voltage from U3 decreased by about 0.25V

The current temperature is now 18.9C.

Update:
With the current temperature now at 19.5C, when I adjust the voltage so that D1 lights up and D2 is a little dimmer, the voltage on pin6 goes down from 7.47V to 2.63V

I would be interested to know now, at what temperature D1 comes on and D2 goes off.
« Last Edit: January 04, 2025, 02:20:31 pm by RobH »
 

Online Xena E

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
Re: Below temperature circuits with leds
« Reply #17 on: January 04, 2025, 11:49:38 am »
The device you are using (741?) can't swing its output fully to the 0 volt rail whilst sinking current. If you want to have LEDs lit one at a time it won't be possible using that circuit.

Hint: Consider making use of the different forward voltages of the LEDs  to effect the switching.

X
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #18 on: January 04, 2025, 12:28:15 pm »
The device you are using (741?) can't swing its output fully to the 0 volt rail whilst sinking current. If you want to have LEDs lit one at a time it won't be possible using that circuit.

Hint: Consider making use of the different forward voltages of the LEDs  to effect the switching.

X

I am using a LM741, but what other device do you recommend then. I have LM1458, LM324, LM358, LM4562, LM339 and a CA3130

Sorry, but how do I 'making use of the different forward voltages of the LEDs  to effect the switching'. Please explain to an amateur .

Thanks
« Last Edit: January 04, 2025, 01:03:13 pm by RobH »
 

Online Xena E

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
Re: Below temperature circuits with leds
« Reply #19 on: January 04, 2025, 01:49:42 pm »
When I'm home I'll sketch something for you to try, I assume you want the green LED to light when the output of the chip is low?

X
« Last Edit: January 04, 2025, 03:53:24 pm by Xena E »
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #20 on: January 04, 2025, 01:59:02 pm »
Yes, I want the green led to light up at a set temperature and the red led to go off at that same temperature. But how do I set the required temperature of say 21C.

thanks
 

Online Xena E

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
Re: Below temperature circuits with leds
« Reply #21 on: January 04, 2025, 03:49:52 pm »
Heres how to drive the LEDs from a 741

Circuit and post edited for accuracy.

The green LED will be lit when the output of the 741 is low, and the red when it is high.

Using a comparator such as a 393 would have made your life so much easier, though this way it will work.

how do I set the required temperature of say 21C.

thanks

You will have to set the comparator circuit to  toggle the LEDs when the output of the LM 35 is @ 210mV.

Can you post an accurate diagram of what you have built so far, (not external links).

X

« Last Edit: January 04, 2025, 05:32:06 pm by Xena E »
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #22 on: January 04, 2025, 04:31:13 pm »
Thanks for the drawing, and I don't have any 1N4147 diodes but just  Zener diodes.

What I have built , please refer to Reply N05 by zero999. It is the picture he did for me as a modification to the one I posted a link to which I built
 

Online Xena E

  • Frequent Contributor
  • **
  • Posts: 640
  • Country: gb
Re: Below temperature circuits with leds
« Reply #23 on: January 04, 2025, 05:09:23 pm »
I'll have to alter that sketch it should be 1N4148 diodes :palm:

Any silicon signal or small rectifier diodes will work they're only being used to raise the turn on voltage of the LED so that only one is on at a time, for instance 1N4000 series would do fine, 2.7V Zener may be OK but remember the Cathode marked connection goes to Positive.

A bag of 1N4148, 1N914, or similar are dirt cheap and always worth keeping by.

As for the circuit I'm not sure about being able to use the LM35 like that without my checking the app notes, (Zero999 isn't often wrong   ;) ), the problem is trying to use that arrangement and with a 741, which is an antiquated op amp, and isn't suited to single supply rail use. Have you not said you have already had it switching?

Try the LED circuit and then go from there...
 

Offline RobHTopic starter

  • Regular Contributor
  • *
  • Posts: 84
  • Country: gb
Re: Below temperature circuits with leds
« Reply #24 on: January 04, 2025, 05:57:24 pm »
Just some observations from a brand new circuit , part from xero999 and part from yourself.

I can get the green led to come on when I alter the pot to 2.9V on pin2. At the same time pin6 goes from 8.5V down to 2.77V.

The red led does not light up at all.
When the green led is on, I then get a negative voltage of upto -9V on the 1N1418 diodes

Out of interest can I swap the LM741 for any of the op amps that I already have to improve it.

Edit:
I changed the UA741 for a CA3130EZ which I had, and was used in the original circuit.
It hasn't made any difference to the red led not coming on, and still has a negative voltage.
Thanks
« Last Edit: January 04, 2025, 08:25:48 pm by RobH »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf