PART 2 is HERE: http://www.youtube.com/watch?v=6Otr1I0OR18
Dave shows you how to design a simple constant current and constant voltage lab power supply that can be either software (PIC/AVR et.al microcontroller) or traditional pot controlled.
Starting with the venerable LM317, and ending up with an LT3080 solution, and the some thought processes that go into it all.
Part 1 is the conceptual design of this Open Hardware design.

Hi. One of the most popular Uh projects in electronics, especially for beginners is to build your own power supply, your own lab power supply and I highly recommend it as I've done on many occasions. You should build your own and a good lab. Power supply is one that has constant voltage and constant current.

As you might know if you don't know, you do now and how do you go about building one of those? Well, it's pretty simple. There's hundreds of designs out there using basic LM 317s or whatever you know, a voltage control knob, a current control knob for the constant current. Pretty simple, but a lot of people ask how do you do it with software control or at least have the capability to add software control be it from a P from an Atmail, an Aduino, or a PC or whatever uh, processor, or intelligent thing. You may not want to use a an expensive 10 turn pot which I've recommended.

you should have on a good lab Uh power supply. You may want to use an optical rotary encoder knob and hook it up to a a microcontroller and then control the voltage and current that way. How do you do it? It's a good question. It's a bit more complicated than your more traditional Uh design that just uses the knobs for the voltage and current.

They're very simple designs. It's hundreds of them out there. choose your own flavor for your own voltage and current requirements and stuff like that. but when you add that software capability, it's a bit more complex.

and also I thought I'd throw in an extra thing is a supply which goes down to Z volts as well. So let's go through the process of Designing building, breadboarding, and testing a lab power supply that has that sort of capability. Let's go. and of course, the first thing we're going to start with are the specs.

cuz if you don't have specs to work from, well, it's going to be a dog's breakfast. So let's have a look. uh, we want a very modest, uh, low range. uh Supply today just for the sake of argument 0 to 6 Vols Now that's important Zer volts output uh is not always easy to obtain in a lab supply if you're using a basic Lm317, especially when we get down the last one here I'll go into it anyway.

it's not as easy. Uh, a lot of power supplies traditional ones will only go down to 1.2 or 1.25 volts and the reason for that is the reference voltage used in say an LM 317 used in the design. Anyway, we'll go into that, but we want a complete from 0 to 6V range. We want a modest 0 to 1 amp constant current adjustment on it cuz a good lab power supply has got to have constant current adjust knob on it.

Uh, we want uh and this is uh, a key point. We want a optional. it's not mandatory, we can use knobs or we can replace those knobs with a microcontroller. uh software control of both the voltage and the uh constant current uh value.

usually using a pulse width um modulation scheme CU That's how you generate a voltage and voltage output easily from microcontroller. Like a Pi, you use a Pwm, a pulsewidth modulator. You can use a Dack but most micros don't have a Dack built in. so they have pulsewidth modulators and we want low noise.
Which basically means we're going to use a linear Uh power supply. We're going to design a linear power supply today, not a switching one. and uh, we want a single Supply input and you'll find um, as we, uh, go through, you'll find why. that's uh uh actually.

uh. important because it's hard harder to get a zero, a true Zer volt output range with only a single Supply input. So there's our specs. Remember them? That's what we're desiged around.

So let's get into the design. And of course, when you're building a lab power supply like this, one of the first devices you're going to consider is the classic LM 317 and you've probably seen this before and both of these uh, configur figurations. It's a classic device. It's robust, it's low noise, it works, It's relatively stable it.

uh Works in constant current and constant voltage configurations. which you can Cascade as we've done here. Very versatile device and uh, let's take a look at what. Uh, how you can build a Um a basic lab power supply with an LM 317 based Uh system.

Now we've got our voltage input here and uh, We've cascaded two LM 317s in series. Now what we've done is we've used the classic constant current configuration where we use a single in this case adjustable resistor. You'd have to use a wire wound uh, pot in there to set uh, your constant current or in this case a maximum constant current which it won't uh exceed. And to this formula is uh, very simple to uh calculate.

The maximum current is the reference voltage 1.25 volts as we've seen uh divided by uh R1 up here and that gives your you your maximum constant current and because uh, basically very little uh current flows through these resistors and it's basically in series with your load. Your output here, uh, then your output load will not exceed that maximum value you've said, but it can draw less. No problems at all and it passes it straight through. So if you put uh, a constant current LM 317 first uh, before a voltage a standard voltage mode lm317 Bingo you've got your constant current and constant voltage Lab Power supply And of course the output is just the Classic uh voltage configuration with the divider resistors and adjustable pot.

Here you can adjust your voltage. Beautiful! So what's wrong with it for our design today? Well, turns out there's quite a few things wrong with it actually. uh, the first one is you remember our spec from Z volts up to whatever uh voltage we need to go down to Zer volts. But the Lm317 doesn't allow you to go down to0 volts.

It only allows you to go down to a minimum of 1.25 volts. And that is because of the internal uh voltage, uh, reference inside of it. And uh, the second one is is that, um, uh, this adjustment uh, pot here it you can't. It's uh, not, uh, terribly good down at the very low level.
say if you wanted to set an output current of 1 milliamp, you know it's not that great down there. Third, uh, how do you adjust these with a uh, you know, a microcontroller or a software function? It's quite difficult. Well, it turns out it's not that hard for the voltage you can. Actually, what you can do is get these out of the circuit completely and just drive this directly with a buffer from a pulse width modulated, um, filtered of course to turn it into a voltage, but you can feed that directly from a voltage and that can come from your microcontroller or come from another pot or whatever.

You can drive it directly. You can effectively override, um, the internal uh, reference and circuitry and actually drive it direct. The problem with that though, is that whatever. V if you feed in 1 volt here, you don't get 1 volt out, you actually get 1 volt plus the reference voltage of 1.25 volts.

You'll get out 2.25 Vols here. and well, you can take care of that in software. It's not too hard, so the Uh voltage configuration. you can actually drive it with software.

So let's actually build up this LM 317 circuit and verify that it actually uh does what we think it does now. Uh, here it is. Got my LM 317 I got bypass caps on the input and output the inputs. The top Uh rail up here coming from my lab power supply.

ground is down the bottom here. Um, the right hand pin over here is the input. There it is there. The uh Uh output is the center pin or the tab.

Uh, the center pin is electrically connected through to the Uh tab up there. I've got a load here I've got a 1K load just to Um because these devices, if you check the D sheet, do actually need a minimum load and we'll take a look at that in a sec. And this orange wire. over here is our adjust pin, which with a typical Lm317 as you would know, it's a basic build-in block circuit.

You would have a voltage divider on the output and then you'd feed it back to the adjust pin to get your output voltage. But in this case we're going to actually uh, ground it like this and see what we get and also then drive that from our low impedance. Uh. Second Lab Power supply.

Uh, actually drive a voltage into that um, adjust pin and see what we get out. All right, let's check it out. see what we've got? Our Uh input voltage is, uh, just over 7 volts and uh, our input pin is grounded. Let's measure our output here.

Bingo There it is. 1.25 3 Vols And that is the reference Uh voltage the internal reference voltage used in the Lm317. And if you've only got a single Supply input like we've got here from 0 to um, uh, 0 to Uh 7 or whatever voltage it is, then you can't get any lower than that 1.25 Vols output cuz we've grounded our input here. we can't get any lower than that.

So that's why a lot of um, traditional, uh, lab power supplies will only go down to 1.25 Vols because it's the reference voltage used in there now. I Mentioned that load's important. Well, let's actually check what happens to the output if we disconnect the load like that. So all we've all we've got now now is the bypass cap.
Well, let's check it out. Remember it was, uh, there we go. It's jumped up to 6.4 Vols It is not 1.25 anymore and if we plug it back in Bingo we'll get 1.25 There you go. Now, Ordinarily, you don't really have to worry about this with a traditional Lm317 circuit with the voltage divider on the input cuz the voltage divider if you read the data sheet is designed to, uh, the values are low enough to actually present, uh, the minimum load requirement of the LM 317.

But because we don't have that voltage divider and we're just driving the input uh pin like this, then uh, there's no minimum load and we're going to need a minimum load on there to make to actually make this thing stable now. I've got the adjust pin of the LM 317 connected through to my external another second external uh, variable lab supply which we can adjust here and I've got the meter. uh, just just, uh, hooked up with some alligator clips there to the output and I'm feeding in 1.25 Vols from my lab power supply and look what we're getting out: 2.51 Bingo It adds up. So any voltage you feed in to this, uh, adjust pin on the Lm317, you've got to add 1.25 Vols And there it is there.

And if we adjust that set PIN to 5 Vols what do we get? You guessed it, 6.25 or 6. 27 bit of error there, but uh, there there you go, we. whatever voltage you feed into that set pin, you've got to add 1.25 Vols And that's really quite annoying. From a um, well, from a software point of you, it's probably not that bad because you can do the math and do the adjustment in software.

Whatever value you set on your pot, you know you've got an output 1.25 volts higher than that. but it's It's not nice, it's not not elegant. And of course, LM 317 doesn't go down to 0 volts so that's hopeless. And of course, uh, I had to turn just in case.

For those who are wondering out there, Yes, I did have to turn my input voltage up from the 7 volts cuz we were too close to the Dropout voltage the regulator. Remember there's a couple of volts Dropout voltage on an Lm317. Now you can actually get the output of the Lm317 to go down to uh, closer to zero volts if you, uh, feed in a negative voltage uh into the set pin and you offset it by that 1.25 Vols Now in this case, I am actually feeding in minus 1.25 Vols because I've swapped the leads. Look, I've got my negative lead going into the adjust pin and so I'm effectively feeding in minus 1.25 from my Supply instead of plus 1.25 And I can do that because my power supply is floating.

the outputs are floating. Remember that that's important now. Um, I'm feeding in -1. .25 and we're getting out 0.125 Vols It's not quite the zero as you'd expect.
That's because Whoop turned itself off there. We're falling victim to the Uh minimum load requirement. You'll notice that this isn't the 1K value resistor anymore we were using before to get our minimum load. This is a this is a 100 ohm resistor so it's only going to let us go down to1 125 Vols If we lower that value resistor again, we'll Al to be get closer to zero Vol And just to prove that I changed the resistor value to 22 ohms.

And there you go, we're getting pretty darn close to zero about 28 MTS. So that's an example of something you've got to be careful of when you're designing these sort of power supplies with these voltage. Regulators That minimum load requirement is actually quite important, and you'll find that we'll have to, uh, take that into account later on in our final design. but it doesn't satisfy our requirement of a Zer volt output.

Not unless you start using split supplies and driving things negative and doing fancy stuff like that. But yeah, it's just it doesn't meet our spec there. Another thing it doesn't uh me is, how do you adjust this pot here? How do you convert this pot into digital control? Well, it actually turns out that it's uh, reasonably difficult. You can't just.

well, you could get like an E squared pot or something like that. but you got to watch your maximum voltages. A lot of those will only go up to six. or or you know, getting ones that go up to 12 volts are quite rare.

Any higher than that? Rarer. Again, you've got uh, big Dropout voltages. Your voltage here has to be uh, several volts greater than your output and you got another uh, drop on here. It's just.

it's not pretty at all and it's not going to meet our requirements. We're going to need something different, but although we might end up using something different today for our final design, the configuration is going to be uh, quite similar or can be quite similar. You can actually design some circuitry around here to replace an Lm317 type, uh, constant current configuration, and we will actually use the technique of overriding a pin on a voltage regulator. So stand by.

So how exactly do we start designing a circuit to overcome some of the limitations? Well, I Think the first thing you should do is take a look at how these LM 317s actually work because you might be able to, uh, maybe duplicate them with some similar circuitry. Now, if you have a look inside a typical Uh LM 317 broken down, you've seen this before. It's just an error amplifier with a series pass transistor. In this case, it's a Darlington usually a Darlington uh transistor pair like that, your input terminal, your output terminal.

Usually there's some like little protection, small amount of protection resistance in there and there's overload protection circuitry in there and thermal overload and there's some extra stuff. but the basic operation is just that, series pass, error amplifier and the voltage reference here and whatever. And of course, you've seen how this works before. The Opamp uh controls the series pass transistor to make sure that the output voltage matches the input voltage.
cuz that's what Opamp does. It makes it does whatever it needs to on the output here to make sure that these two inputs are the same value. And in this very simplified block diagram here, you can actually see why we have to add on the reference voltage onto our adjust pin. But you can see that we can actually why we can force the adjust pin because it's effectively just setting the value on that opamp there.

So really, um, in theory, it's possible we can use a discrete Uh transistor, a Darington transistor on the output like that. We can have an Op Amp like that and we can feed it back and we can just feed our voltage directly into this pin. And that way you can actually uh, design a constant voltage, um, power supply using a, well, a linear regulator like this, using um, a software control or something like that, cuz this value can come from a pulsewidth modulator SL dck. It could come from a pot, could come from whatever.

So as a first step, let's replace our LM 317 voltage circuit with effectively what's inside there. If we use a discret Uh Darlington transistor on the output can be a standard transistor, can be a mosfet. You know it. Let's not get into the details of that, but we use a series pass transistor and Opamp just can be a regular Uh Op amp and uh, we put it in the error.

configuration like this: need some output capacitance? uh to keep keep it stable. But there we get rid of the voltage reference which is inside and our vet pin Whatever voltage we put on the non-inverting input of the opamp like this should be on the output like that. Bingo But you'll find that in practice this is not an inherently stab stable configuration. It's very tricky to get this stable in a lab.

power supply like this, over a whole bunch of output, load, capacitances and configurations and and currents and all sorts of things. So by all means build this up. Try it yourself. Experiment with it.

you will be able to get it to work. But I think you'll find be a little bit unstable. but anyway, that that is a way that we can do the constant voltage uh aspect and this V set of course can go right down to zero and the output will go down to 02. In theory, subject to minimum load and other things to keep it stable.

so we can drive this vet directly from either a pot, multi-term pot, single turn pot, or from a DAC or pulsewidth modulator micro output. So just like using an Lm317, I don't want to muck around with trying to, uh, make it, you know, stabilize this and worry about all that I Want to use an off-the-shelf solution? Aha I Remember the LT 38038 from my first blog and I've mentioned it a couple of times. It's one of my, uh, favorite. uh, little linear Regulators cuz it has if you look inside of it exactly this circuitry and it's designed to be stable Bingo or use the LT 3080.
So I think we might have the constant voltage part sorted out. What about constant and current? It's a bit harder to try and adjust this value in here, but anyway, let's try it using the same technique of replacing it with this kind of circuitry? and to do that? I think I'm going to need a little bit more room so I'll erase all this and we'll concentrate on the constant current part. So what have I come up with to replace the Lm317 constant current circuit? Well, Tada Here it is and it's rather neat. I think I like it now.

It looks a little bit complicated, but stick with me, it's not. Trust me. now. we've uh, replaced.

We've got the LM 31 circuit constant current equivalent circuit in this red box here. Remember, we've just replaced it with the Aor amplifier, the series pass transistor and we've got a 1 Ohm um, current sense resistor. Here it's 1 Ohm because 1 Ohm makes the math really easy because what we're after here is what we want to do. is we want to because we want this PC controlled.

Remember, we want software micro controlled. we want to convert uh, say 0 to one volts from a microcontroller or from a pot or whatever Source it is into a 0 to 1 amp. Uh, constant current limiter circuit like this. So we want to feed in 0 to 1 volt and get 0 to 1 amp out.

Okay, let's try and explain this circuit, shall we? Now hopefully we won't get lost. Now here's our voltage control input. We'll call it vet and we want 0 to one volt to represent 0 to 1 amp Uh current limiting around this circuit. So we've got a buffer here because you need a buffer if this comes from a pulsewidth modulated output with an RC filter you want, that's not good enough to drive this circuit.

So you need a buffer there. So this is our 0 to 1V control uh input. Now it goes into this adder or summer circuit here. Uh, and then that is fed into a X 2 amplifier here into to the um, non-inverting input of this constant current equivalent circuit.

Now if you remember how the Lm317 uh worked because it had a voltage reference in here of 1.25 Vols and it fed directly around to this pin here with no additional circuitry like that, then the current equaled 1.25 Vols uh, divided by 1 Ohm or 1.25 amp in this case and we're basically replacing that Direct feedback with a circuit that allows us to inject this 0 to 1 Vol uh signal and raise it up so that it can control this higher voltage circuit up here. And this is what this little part of the circuit does. Now, the reason we've got a gain of x two here is because this divider here is effectively dividing that, uh, this voltage by half. So we need to compensate for that by having a gain of two here and you can Muck around with these ratios or you want.
But they've got to basically uh, match each other so that uh, they're equivalent. Uh, but we need. but because we have to feed in this voltage down here and it's got to go into this Adder we have to compensate with this gain uh of times two here now. I Could try and explain it, but let's just go through a worked example and I Think that's probably the best way to illustrate it.

Let's start with the example at the extreme bottom where we've got zero volts here. so this is effectively grounded. and let's say our output here is uh, 10 volts. So this Uh node here is going to be exactly half of that half of 10 minus Zer.

So it's going to be 5 volts here on this node. and of course, this has got a gain of two. So we're going to have 10 volts here. So this voltage here at this point is going to be 10 Vols as well.

And if you've got 10 volts on either side of a resistor like that, what's the current flowing through it? Zero Ohms law. So when we've got zero volts input here, we have zero current flowing through that resistor. Regardless of what the load is trying to do, the loads tell I want more current I want more current I'm shorted out I'm You know, give me current. it's not going to because there's zero volts across that resistor.

Can't be Do's law. And just as a reminder that works because of Opamp action, this Opab tries to do whatever it can on its output to make sure that these two inputs are the same. So this voltage here is 10 volts. and we Fe Well, 10 volts here on this pin because it's been fed back and raised by two.

There's 10 volts here. It makes this pin here 10 volts as well. It drives all this circuitry to make it 10 volts. And that's why this input.

there's a Dropout voltage. It needs to be higher than that 10 volt. Significantly higher so that it can so that the actual circuit itself can function. And if you're wondering about the power supply for these up, amps it.

Uh, all of this, by the way, works from our single Supply cuz that's part of our spec. So this would be grounded here like this. and this actually would be connected to the input like that. So the input voltage must be significantly higher than uh than the voltage that we're actually trying to uh control.

so there will be some Dropout uh voltage there. But all of this, all these Op amps can be powered from this one supply. All right. We've done the minimum case of Z volts control signal.

what if we do our maximum case of 1 volt? So our control voltage here is 1 VT And once again, we're going to assume 10 volts there just for the sake of this uh calculation. Now, if we' got 1 volt here and 10 volts there, it's actually 9 VT drop across these. so it's 4.5 Vols per resistor and 4.5 volts down from 10 Vol Our node here is going to be 5.5 Vols and you see how it's added that. it's it's added that 1 volt above.
If because if this was ground and it was only 9 volts, drop, it' be 4 1/2 volts here. But it's not. We've added on that 1 Vol because our reference point is up the top here. So this node here is 5.5 Vols a gain of two Bingo We get 11 volts out here.

VR Our reference voltage is 11 volts and that due to opamp action, we're going to get 11 Vol here. and what's 11 Vol - 10 Vol over 1? It's 1 Vol over 1 Ohm is 1 amp. So regardless of what the load is trying to do, it's screaming, It's shorted out. It's doing whatever you can short this puppy out to ground like this and it will.

It will generate one Volt across that resistor and limit the current to one amp magic and it's pretty obvious that it's going to be linear within that range. We've tested the two extremes and it works. So you just because this? you know there's nothing nonlinear going on here. You know that it's going to work in those ranges and if you want to, you can go through and you can actually, uh, test out different cases.

at half a volt or 10 you know, 0.1 volts or something like that for 100 milliamps. Do whatever. One thing to remember though, is that with the 1 Ohm resistor here at 1 amp, you're going to get 1 VT drop across there and that's an additional drop. So you've just got to take that into account in your design, it may be fine for you CU your input voltage may be quite High you one volt here plus your additional drop.

Further on on your next stage for your Uh voltage, uh, side of the voltage regulation, you've got an additional uh minimum uh Dropout voltage there. Then it all adds up. Just make sure and if you wanted to lower the value of that resistor, say to 0.1 Ohms, then you can compensate with the gain of this circuit. No problems whatsoever to lower your voltage drop, but you know you can't go arbitrarily low cuz Then you get down in noise problems and things like that Now I Encourage you to go and build this circuit up and try it for yourself and maybe even simulate it and do stuff like that.

But um, ultimately. um, as with all these type of configurations, they can be quite hard to stabilize, especially when you've got a variant load in lab power supply. So ultimately, uh, you might want to replace this with an already Uh stabilized solution like the Lt380. Now, as it turns out, this circuit is quite in efficient in terms of Uh Parts utilization.

We can actually eliminate an an Op Amp entirely from this circuit. How do we do that? If you had your thinking cap on, you could see that uh, the gain of two can be actually put in this feedback path instead of the gain of two. Here, you can actually uh, divide by two in this path. So if we get rid of this and feed that directly into their like that and then we break into here like this, we can add our 10K there and we can have a 10K going to ground like that and that is exactly the same configuration.
If you don't believe me, go through the example and try it again. So hey, now we're getting somewhere. Here is our Uh Lab Power supply. So far, it's got two LT uh, 3080s, one for constant current, one for constant voltage, and we've got two voltage set pins.

From the current set pin goes from 0 to 1 volts, which represents 0 to 1 amps. We've got our voltage set pin from 0 to 10 volts or whatever your maximum output voltage you want consistent with the uh, maximum specs of your components. and you know it's getting there. And of course you're probably want a few extras.

You probably want a big beefy protection diode on the output like that. And and you remember that thing we said about minimum Uh current load as well the output of this sucker if it's drawing no current, not that great, doesn't go down to that lower voltage and uh, can cause issues. We could have some major issues there, so we may have to add some um, uh, some sort of uh load on there to uh, get our minimum current out of there. and oh, that's okay, but jeez, gosh, darn it.

I don't know the Lt380. It runs to about three or four bucks each or something. Jeez, you want to shave that cost off Simplicity And if you got two devices like this, remember they will be sharing the heat as well. So not only do you have to have a heat sink that actually, uh, you can mount both both devices on there in constant current mode.

You're going to be dissipating most of your heat in uh, the constant current regulator. In constant voltage mode, you're going to be dissipating most of the heat in this regulator and so on. But I reckon we can eliminate one of these. Regulators Let's give it a go.

So just how do we plan to eliminate one of these? Regulators I Hear you ask? Well, you've obviously got to have your Uh voltage regulator. That's got to be there. But maybe we can do something with this. adjust pin here to uh regulate the current instead of having a whole another.

Um, you know, instead of having limiting it back here, actually limit limit the current inside this device. get this device to do both jobs. Voltage and current Limit Lii in how do we do that? Well, we'll find out now. Uh, if we want to get rid of this, we still need a current Sens resistor.

We're still going to sense the current. So let's keep our 1 Ohm resistor and let's tap off the voltage on there and see what we can do with it. Okay, here's what I've come up with Now once again, it may look a bit complicated, but it's not. Stick with me.

It's all basic build-in block stuff. Now what we've done is we've got rid of the Uh current. Um, uh, Lt380 up here. The current regulator up here replaced it.

We've still got the 1 Ohm current shunt resistor. You got to have that. You got to have something to measure the Uh current actually flowing in the input and you can do this. By the way, Ignore this.
You can put this uh before the regulator cuz there basically is very little current flowing out of the control pins of most voltage. Regulators so all the current in is going to be basically equal to the current out. You may have to take it into account, as you might see, but uh, basically that's how you can get away with doing it here instead of on the output. Something like that where you end up dropping the voltage cuz if you put in the output either the high side or in the return ground path which is called the lowside current shunt, then uh, that will drop some voltage and your output voltage isn't going to be uh as well, it's going to have a voltage drop.

It's not exactly what you set it, so not ideal, so it's better to have it on the input side of the voltage regulator and let it handle it anyway. We've replaced it with a differential amplifier, and if you know your basic building block opamp configurations, this is a single opamp differential amplifier. It's not that great, but it's probably good enough for our purposes. You could actually replace all that with Um A a proper Um, off-the-shelf Um differential amplifier like an Ad620 or something like that, but they're quite expensive and you know you don't need that sort of precision.

Anyway, what the differential amplifier does is the output voltage here at this point here will be equal to the difference in voltage across that resistor. So if there's one amp flowing through there, there'll be a 1vt voltage drop and you'll get 1 volt out of here. Simple. Now, one of the key parts to this is this little bit here and this is the current limiter and how this works it's using.

You'll notice there's no feedback on this Op amp. It's using it as a comparator and once again, you could replace this with a comparator. but we'll use an amp in this uh particular circuit. Now you'll notice that because this input to this Op amp is high impedance, you don't need this driver anymore.

You're can eliminate that entirely and just connect your iset. So we still got our three opamp configuration. We haven't increased our number of opamps, but we have dropped, um, one current uh, regulator device over here. so that's a parts count and uh, possibly cost Advantage Now obviously if this is working as a comparator, if this voltage here, let's say we've got one amp flowing through here.

One volt. We've got one volt here. If that is greater than the the Uh current we've set on our pot. Remember from 0 to 1 volt, 0 to 1 amp if we set it to you know 0.99 volts or 0.999 volts, then this 1 volt will be greater than that and it will switch on this transistor here which is the same.

We've got the same circuit here before. remember this is exactly the same. Just ignore these resistors for a second. and before we had this connected directly to the adjust pin to control our output voltage.
Simple, but we can't just short out. We can't just add this transistor which will short out the output of this Op amp. It's not very nice for the opamp and it's not going to work too well. so we need a series current limiter resistor in there.

Let's make it 1K and let's make another Uh 1K resistor there and bingo when um, this uh input. sorry when this is 1 volt when it goes into current limiting mode I.E The Uh volt. The current flowing through this resistor has exceeded the value, exceeded the value set by your adjustment PT or your microcontroller. whatever it is, Then we'll turn on this transistor and pull this pin, adjust pin low, which will then drag your output voltage low with it.

But of course, because you've got output capacitance here, it's not going to instantly drop to zero. It's actually going to uh, slowly, go down, or go down. It'll go down reasonably quickly, but it'll drop and then it will sort of uh Sero so the current. So the output voltage will drop.

So therefore, your load, the current in your loob will drop. So therefore it will kind of like oscillate and Servo and control that and keep it at an average value of one amp and also I Think we're probably going to want to add in some capacitance in there as well. not only to know, lower the noise of the regulator if you look at the data sheet which we will later for the Lt380. if you put a cap there, you can actually lower the Uh output noise, but uh, that will also um, just help uh, stabilize things and you know, slow down the operation of the Uh current adjustment and stuff like that.

But that's the whole mechanism behind this thing is that it basically switches the output off and on, off and on so that it gets that average value only in current limiting mode though does that happen When if you've got one volt set for your current limit 1 amp set up here and your output current is less than 1 amp, then none of this turns on. This transistor just stays permanently Switched Off and this acts just like a uh, the standard Uh voltage regulator by set in this pin. If you've got 1 VT set in 1vt output, you'll have 1 volt here and Bingo! This transistor is turned off so that's not there. There's effectively no current drop through these resistors and you'll have one volt here and you have one volt there.

Easy. But as always I simplified things and uh, lied to you a little bit by saying that there was no current drop in these resistors. But if we check out the data sheet for the Lt380, might be a couple of traps for young players. so let's go have a look at the data sheet.

but hey, here's our circuit I Think we'll build this one up.

Avatar photo

By YTB

19 thoughts on “Eevblog #221 – lab power supply design – part 1”
  1. Avataaar/Circle Created with python_avatars Blessed chinopera says:

    I am trying to construct a 50v 10 amps variable powersupply where i can varry current from 1A-10A

  2. Avataaar/Circle Created with python_avatars Bigyan Bhattachan says:

    Dog's Breakfast comment had me laughing so hard!

  3. Avataaar/Circle Created with python_avatars Evan Barnes says:

    This is exactly what I've been looking for! All these years later and it's still relevant. Thanks!

  4. Avataaar/Circle Created with python_avatars Nathanael Newton says:

    This is still the first result for

    power supply circuit design

    Excellent 😁

  5. Avataaar/Circle Created with python_avatars Simon Linser says:

    idk man this seems like it's adding complexity because I'm only doing analog circuits so why would i want to learn how to use a microcontroller when i can't write a single line of code. i wish i could but I'm just never gonna get anywhere that way adding another thing to learn here. this is good advice though, good stuff.

  6. Avataaar/Circle Created with python_avatars Man Of Mesopotamia says:

    Could we wire more lm317 on series to get more amps on output 🤔?
    For example, i need 1.5- 5 volt output and 10 amps for my electrolysys project

  7. Avataaar/Circle Created with python_avatars vijay sharma says:

    जीयो हजारों अंग्रेज समझ नही पार्ट टाइम हो गया तुम्हारे पापमय है कंपनी का कारण ऐक नबर गद्दार पैदाईश रुद्रा अभिषेक के लिए धन्यवाद

  8. Avataaar/Circle Created with python_avatars vijay sharma says:

    जीयो हजारों अंग्रेज समझ नही पार्ट टाइम हो गया तुम्हारे पापमय है कंपनी का कारण ऐक नबर गद्दार पैदाईश रुद्रा अभिषेक के लिए धन्यवाद

  9. Avataaar/Circle Created with python_avatars Jona Yamaha says:

    even i understood it omg, greetings from argentina thank you so much for the free classes.

  10. Avataaar/Circle Created with python_avatars paul .a larner says:

    why wasnt this ever finished,did it beat you?

  11. Avataaar/Circle Created with python_avatars Woo Six says:

    Dave: (about circuit) Beautiful!
    Dave, a few minutes later: It’s hopeless!
    pretty dramatic

  12. Avataaar/Circle Created with python_avatars leo /yr U. says:

    lm317 goes only up to 40v is there any other simple and cheap like it that can go higher like 80 -90v or even 200v ?

  13. Avataaar/Circle Created with python_avatars jose carlos says:

    Outstanding.

  14. Avataaar/Circle Created with python_avatars Daniel Carroll says:

    This video was better than most of my electrical engineering lectures I paid thousands of dollars for

  15. Avataaar/Circle Created with python_avatars Ryan says:

    my speakers do not like the constant tapping on the board lol. Not one bit.

  16. Avataaar/Circle Created with python_avatars mark man says:

    Very cute

  17. Avataaar/Circle Created with python_avatars Jboy says:

    How to calculate the filter capacitor

  18. Avataaar/Circle Created with python_avatars Σταμάτης Μαβιτζης says:

    man you're great. I really enjoyed this! Escpeccialy the time you took to explain the theory to us. I cant believe you re going to build it even if you know its not perfect yet xD

  19. Avataaar/Circle Created with python_avatars Paul says:

    Why would you want to go so low on your regulator? Is there a component that uses less than 3 Volts?

Leave a Reply

Your email address will not be published. Required fields are marked *