Author Topic: Adding a 'current limit reached' LED to a 317 current source  (Read 8363 times)

0 Members and 1 Guest are viewing this topic.

icon

• Regular Contributor
• Posts: 246
Adding a 'current limit reached' LED to a 317 current source
« on: March 25, 2012, 01:07:44 pm »
Hi

I made a simple 317-based current source/7805 regulator combo after seeing our host's PSU design #1 video, where he rejects the idea as entirely unsuitable. I thought it was pretty neat - it hadn't occurred to me before that you could chain the two together (hey, this is the beginners forum!). While playing with it and a potentiometer on a breadboard, it dawned on me that there were two modes of operation going on - one where the external load is determining the current drawn and one where the 317 current source is limiting the current. If that's so, then it would be very handy to know which was true.

Is there a simple, low-parts-count way of doing this? Preferably with involving op-amps, since there's no convenient source of +-15V

John

alm

• Guest
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #1 on: March 25, 2012, 01:38:14 pm »
Why do you think opamps need +/- 15 V?

I don't immediately see an elegant solution with two three-terminal regulators (as opposed to say the design in the National LM317 datasheet involving an LM317 and an op-amp), which don't provide access to the base current to the pass transistor. I would probably do something like compare the voltage between the current-regulation LM317's adjust pin and its output terminal to 1.25 V. If it's less than 1.25 V, then it's in constant voltage mode. This is not very elegant, since it would need a second 1.25 V reference, which needs adjustment to match the LM317.

ivan747

• Super Contributor
• Posts: 2013
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #2 on: March 25, 2012, 02:30:14 pm »
Why do you think opamps need +/- 15 V?

I don't immediately see an elegant solution with two three-terminal regulators (as opposed to say the design in the National LM317 datasheet involving an LM317 and an op-amp), which don't provide access to the base current to the pass transistor. I would probably do something like compare the voltage between the current-regulation LM317's adjust pin and its output terminal to 1.25 V. If it's less than 1.25 V, then it's in constant voltage mode. This is not very elegant, since it would need a second 1.25 V reference, which needs adjustment to match the LM317.

You can do that with a differential amplifier, use a LM324 or LM358 because their output can go to ground. Use 10k to 100k resistors, that way the resistance won't affect your measurement. You will have the difference of both voltages on the output, if it is close to 1.25V, it's probably limiting the current. Now you can use the remaining op amp of your dual op amp chip as a comparator. Since this is a power supply, you may have a 1.25, 2.5 or 5V voltage reference. If not, add one, as accurate as your needs are. For detecting current limiting, you have to turn the LED on when the voltage is a bit LESS than 1.25V, just in case (there are tolerances involved).

TerminalJack505

• Super Contributor
• Posts: 1205
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #3 on: March 25, 2012, 06:24:55 pm »
It's hard to say without seeing a schematic of your circuit but you might be able to simply use a comparator and compare the two voltages at each of the ADJ pins.  One of these pins will always be ~1.25V--the other ADJ pin will be less.  If the voltage at the CC LM317 is higher than the voltage at the CV LM317 then the circuit is in current limit mode.

Edit: I guess I need to pay closer attention.  I see now that you are using a 7805 for the constant voltage instead of a second LM317.  In this case you can use a comparator with a built-in voltage reference and compare against either the 7805's output voltage or the LM317's ADJ pin voltage.  Or you could use a voltage divider on the 7805's output and compare the result with the LM317's ADJ pin.

Lots of ways to skin this cat.  There's probably some trick with an LM431 or LV431 as well.  A voltage detector IC is another option.
« Last Edit: March 25, 2012, 08:40:48 pm by TerminalJack505 »

icon

• Regular Contributor
• Posts: 246
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #4 on: March 25, 2012, 10:21:03 pm »
Quote from: alm
Why do you think opamps need +/- 15 V?

Ah, because I'm a noob. Says so next to my name. And the only ones in my box of bits, do.

Some good ideas; thanks for the replies. I'll have another play with it tomorrow and look at what the various voltages are doing under changing conditions.

Thanks
John

alm

• Guest
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #5 on: March 25, 2012, 10:37:09 pm »
Quote from: alm
Why do you think opamps need +/- 15 V?

Ah, because I'm a noob. Says so next to my name. And the only ones in my box of bits, do.
Even the ancient uA741 can run from a single supply. It's just only specified at +/- 15 V because that used to be common back then. Note that an op-amp has no ground pin. The only limitations are that the input voltage must be within the common mode range (which may be somewhere between the negative and positive rail) and the output voltage is usually also limited to somewhere between the voltage rails.

Some op-amps need less headroom between the supplies and inputs/outputs than others, for example the LM358 can go down to the negative supply, while the uA741 needs at least a few volts between the negative rail and its output. An uA741 powered from a single +9V rail should have no problems with input signals between 3 and 6 V and should be able to output similar voltages. An LM358 or its quad sibling the LM324, as suggested by ivan747, would probably be a better choice, however. Both are very cheap jellybean op-amps that you are likely to find in your junk box.

oPossum

• Frequent Contributor
• Posts: 811
• Country:
• The other white meat
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #6 on: March 26, 2012, 01:48:24 am »
The LED will begin to glow a bit before the current limit is reached.

icon

• Regular Contributor
• Posts: 246
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #7 on: March 26, 2012, 08:50:01 pm »
The LED will begin to glow a bit before the current limit is reached.

Nah, too many parts.

You're right, it does. Playing with a pot as a load, it's possible to see a fairly sharp 'kink' in the voltage curve against current - the 317 turns the voltage down gradually at first, with diminishing resistance, and then drops off a cliff as (presumably) the current limit is reached - the LED comes on at that point. So far, so good. It seems very sensitive to having a finger pointed at it, though - if I wave a finger at it, the LED dims and brightens considerably, which is pretty but undesirable. Is there anything that can be done to diminish this effect? And what causes it, anyway?

Also, could you explain what the significance of the values of the resistors is?

Many thanks for taking the trouble to post the schematic.

John

T4P

• Super Contributor
• Posts: 3706
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #8 on: March 26, 2012, 10:15:58 pm »
Quote

if I wave a finger at it, the LED dims and brightens considerably, which is pretty but undesirable. Is there anything that can be done to diminish this effect? And what causes it, anyway?

Unless you have a LDR of some sort on the circuit itself it really shouldn't be happening .

icon

• Regular Contributor
• Posts: 246
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #9 on: March 26, 2012, 10:38:07 pm »
Quote from: Dave.S

Unless you have a LDR of some sort on the circuit itself it really shouldn't be happening .

And yet it does. I even tried a couple of different types of transistor - I don't know why I thought it would make a difference, but it doesn't.

J

ivan747

• Super Contributor
• Posts: 2013
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #10 on: March 27, 2012, 02:50:04 am »
Quote from: Dave.S

Unless you have a LDR of some sort on the circuit itself it really shouldn't be happening .

And yet it does. I even tried a couple of different types of transistor - I don't know why I thought it would make a difference, but it doesn't.

J

I think you are seeing the reflection of some other light source going into the body of the LED. It has happened to me before. Turn all the lights off and try again.

icon

• Regular Contributor
• Posts: 246
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #11 on: March 28, 2012, 09:51:09 pm »
Quote

I think you are seeing the reflection of some other light source going into the body of the LED. It has happened to me before. Turn all the lights off and try again.

And while I've been waiting for a conjunction of free time/darkness to play with this again I'd grown increasingly convinced you were probably right. However it turned out I wasn't imagining things, it really did do it. I spent a happy five minutes playing around with it, discovering that it happened if  I put my hand under the table, that it liked my hands flat (yes, I know how this sounds), and other behaviour that brought a theremin to mind. Eventually I thought I'd better do something more productive, so I pulled a leg of the LED out so I could clip a probe to it to measure the current flowing through it. Phenomenon ceased. Ah. Pushed the LED's leg back in the breadboard - effect gone for good. The breadboard is one that's been kicking around for quite a while and I wouldn't be surprised if the strips inside had become a bit corroded - could a very poor connection to the LED have been responsible, somehow.

Anyway, the circuit is more functional now, but I miss the playful LED . And maybe time to invest in a new breadboard.

Regards
John

Mint.

• Frequent Contributor
• Posts: 523
• Country:
• Account is inactive now. Thanks everybody!
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #12 on: April 01, 2012, 09:36:29 pm »
The LED will begin to glow a bit before the current limit is reached.
Can you please tell me why the led has to be placed in parallel with the resistor and not is series?
Personal Blog (Not Active Anymore), Mint Electronics:
http://mintelectronics.wordpress.com/

T4P

• Super Contributor
• Posts: 3706
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #13 on: April 02, 2012, 09:23:33 pm »

TerminalJack505

• Super Contributor
• Posts: 1205
• Country:
Re: Adding a 'current limit reached' LED to a 317 current source
« Reply #14 on: April 02, 2012, 10:07:32 pm »
The LED will begin to glow a bit before the current limit is reached.
Can you please tell me why the led has to be placed in parallel with the resistor and not is series?

Here's my take on that circuit...

R3--the 220 ohm resistor--is there to give a path for the current when the transistor is on but the voltage across the LED isn't enough to illuminate it.  The transistor comes on when there is ~700 mV dropped across the current sense resistor (R1.)  The LM317 isn't in current limit mode until the drop across R1 is 1.25V, however, so the LED shouldn't be illuminated just because the transistor is on.  So the 220 ohm resistor will give a path for the current.

So when does the LED come on?  And how does its illumination happen to coincide with the LM317 being in current limit mode?

First, remember that red LEDs require approximately 1.8V across them before they will illuminate.  The voltage drop across the LED is playing an important part in this circuit.  A different colored LED might not work due to it having a different Vf.

Now, if you look at the datasheet for the LM317 you will note that the minimum dropout voltage of the part is between 1.5V and 2.3V--depending on the current and the temperature.  This is basically due to the fact that the series pass element is a Darlington pair.

So, if you add the 1.25V drop across the current sense resistor and the 1.8V drop across the red LED that just so happens to be in the same neighborhood as the voltage that indicates that the part is in current limit mode.

Smf