A power supply is one of those electronics projects that is popular among beginners. And linear supplies are popular in this case for their seemingly simple nature. However, their design can be deceptively complex when you add more and more functionality to them. Unfortunately, I myself have neglected to make one of my own. That’s why I’ve documented my design process so hopefully you can make one of your own. So without further ado, let’s dive in!
Before we start designing, it’s a good idea to decide what exactly we need our supply to do. Since it will be a linear design, we really should make sure to limit how much power we will use since heat is a linear supply’s biggest problem. For this reason, I will aim for 12 volts with a maximum of about 1 amp. I also want there to be a constant current mode as well. I will use the famous LM317 as the core of this project.
Let’s start with why everyone thinks linear supplies are so simple. Here is the basic circuit used in most every guide involving the LM317. I’d recommend you watch my older videos about the functionality of these LM317’s for a more involved explanation, but basically, the voltage on the adjust pin will be added to a reference voltage of 1.25 volts. The output will be the result of that addition. The resistor divider is there to simply divide the output correctly so that there is a 1.25 volt difference between the output and the adjust pin.
We are already off to a good start, but already there are several issues we need to address. Let’s start with the LM317’s current and heat problem. In my personal experience, the LM317 seems to have problems with sourcing any large amount of current. Even within the datasheet specifications it can fry itself. Maybe there is another explanation, but I decided that it would be best to just bypass the issue.
That’s when this example circuit revealed itself to me in the LM317 datasheet. Its intended purpose was to increase the maximum current through the regulator by adding a power transistor to handle the current. In case you are wondering, the smaller PNP transistor is there to form a Sziklai pair. This pair has the same end goal as a Darlington pair which is to increase the hFE (current gain). The main difference in this case is that the internal transistors are of opposite types. Anyways, the LM317’s purpose now is just to regulate the voltage, and very little current flows through it because of that 22 ohm resistor. This circuit will work perfectly for my LM317 current problem.
This will also solve my heat problem with the LM317. If you’ve watched my old video about heatsinks, you’ll remember that TO-3 heatsink. It has incredible performance when removing heat and it’d be perfect for this project. The only problem before was that my LM317 is in a TO-220 package, so it is not exactly compatible. There are variants of the LM317 in TO-3 form, but they are expensive. The 2n3055 NPN transistor, on the other hand, is not too expensive and works perfectly well with the example circuit.
I only made one modification to the example, which was that I replaced the 22 ohm resistor with four 100 ohm resistors. The purpose of this was to increase the power the resistors could handle. The four ¼ watt resistors combine together to form one 25 ohm 1 watt resistor instead. The 25 ohm resistor is perfect because it allows enough current through to allow the LM317 to satisfy its minimum load requirement, while still limiting it enough to pass it through the transistor instead for larger loads.
Speaking of the minimum load requirement, I opted to use an LM334 for this task. Normally, the resistor divider would handle this problem, but I used relatively large resistors which would have decreased the current enough to cause a problem. That’s why I used that LM334 current source IC. It guarantees us enough current to always get at least 10mA flowing. It is also more efficient than just using a resistor since it reacts to changes in the output voltage.
After this point I stopped breadboarding and decided to just finish the schematic and make a PCB. So, here are the results of my engineering.
Let’s talk about the initial power source. I decided that I should use mains power, so we will be starting off with 120 volts AC. Linear designs always use a power transformer to step the AC voltage down. In my case, I have a transformer that takes 115 volts AC and turns it into 12 volts AC. From there, I passed it into a full bridge rectifier with a smoothing capacitor.
Let’s now talk about how I managed to get the circuit adjustable down to 0 volts. I used a negative charge pump for this purpose. Watch my recent video about charge pumps if you want to learn more. A charge pump is perfect for this purpose because we already have an AC voltage source. The required current is also very low. We still need a stable –1.25 volts to get exactly 0 volts on the output, luckily there is specific IC for that. Meet the LM317’s cousin, the LM337. It is almost identical except that it operates as a negative linear regulator. So, I simply connected its adjust pin to ground and presto, we’ve got a stable negative 1.25 volts and I can adjust all the way down to 0 volts.
With our 0 volts, we can now implement a proper current limit circuit. To do this, I used a current sense resistor with a value of 100 milliohms. From there, each end is connected to a differential amplifier which multiplies the voltage drop across the resistor by 10. So, if one amp is flowing through the resistor, the voltage drop would be 0.1 volts. The amplifier would then output one volt. So, there is a 1 to 1 correlation between the measured voltage and current. Then the measured voltage is sent to another op-amp’s non-inverting input. The inverting input is connected to the user’s desired current setting.
The current setting is achieved by selecting a voltage from 0 to 1.25 volts. This works by creating a stable 1.25 volts from a LM385, which acts as a zener diode. I also placed another LM334 to get a stable current flowing through the zener to keep the voltage stable. A potentiometer is then placed in parallel to act as an adjustable voltage divider. Back to the op-amp, the output is then connected to an NPN transistor which will pull the LM317’s adjust pin down when the current limit is exceeded. The whole thing is kept stable since the new output current acts as the feedback back into the current sense resistor.
That about does it for features, but I added a few things for safety and circuit protection. I added those protection diodes that the datasheet recommends. I also added a fuse on the primary of the transformer in case of a serious short or failure in the circuit. I finally added the slow turn-on feature as shown in an example in the LM317 datasheet.
Anyways, now that the schematic and PCB are complete, let’s get to testing. For the final project, I decided to use these cool looking analog meters for voltage and current. I did get a voltage meter that has too broad a reading unfortunately, but it will still work just fine. On my first test, I already ran into my first problem, which was that the voltage would be stuck at 0 volts. I quickly discovered that it was the current limiting by probing with my multimeter. The reason why it was blocking operation was that it did not have any negative rail capacity, so it would drive the output as low as it could, which was 0 volts. This 0 volts was still enough to activate the NPN transistor though.
So, I did a quick fix and changed op-amp’s power supply to reach down to our –1.25 volt reference. After this point, everything seemed to be working until it didn’t work anymore. At first I thought that it was the negative charge pump and LM337, so I replaced and upgraded those components, but the problem persisted. But then I remember that the LM337 also has a minimum load requirement, so I added a 330 ohm resistor to solve that problem. So, the –1.25 volts returned, but the regulator still did not work.
I finally figured that I somehow fried the LM317 during the previous process, so I replaced it and added a 100nF capacitor in very close proximity. This capacitor should stop any fatal oscillations on the LM317. At this point, the circuit was finally working. So, let’s run some tests. As you can see, I can adjust the voltage by twisting the potentiometer. I attached this electronic load to stress our supply and test its limits. Using 5 volts, I started with a simple 100mA. It handled this just fine, so I went up to 500mA, and it worked fine. I finally pushed it up to 1 amp and I was satisfied that the power delivery worked well. I then decided to test the current limiting functionality. So, I moved the current limiting potentiometer and increased the current on the load until it surpassed the threshold. At this point, the voltage dropped to accommodate and the load ended the test because of that.
To get a more comprehensive test, I used this power resistor which was rated for 10 ohms at 10 watts. Since this is awfully close to a dead short, I was able to change the current limit freely. The results of this test were successful as well.
The final electrical addition I made was these two fans. I got them from noctua so that they would be quiet, and they did not disappoint. Anyways, all that is needed to drive them is a 12 volt power source. So I just put together another lm317 circuit quickly and it worked like a charm.
The only thing left to do is to put everything in this nice looking case. I got this cool looking blue case from aliexpress. The first thing I needed to do was mount the PCB, the transformer, and the transistor to the bottom of the case. For the PCB, I had already placed drill holes back in the design process. So, I placed it down and marked the mounting holes. Then I took my drill and drilled them out. I drilled out the size for these m2.5 standoffs so that the bottom doesn’t touch the case.
For the heatsink and the transformer, I again marked the holes and drilled them out. This time I aimed for an m4 sized bolt and nut. Make sure to really tighten these down because they are heavy and will slip if you don’t. Another thing I would like to mention: since we are drilling into the case, we will expose the metal inside. This means that all of the screws will be electrically connected. So just make sure that you don’t accidently create any shorts.
With the internals sorted out, let’s work on the front and back panels. Starting with the back, I decided to place the plug, the power switch, and the fan driver. The power inlet was the hardest piece on this panel because of its irregular shape in the middle. So, what I did was I drilled the two outside screws like normal, then I used this large drill bit to create a hole right in the middle of where the inlet would be. Then I used this handy nibbling tool to cut out the rest of the hole that I needed. Then I simply drilled the other holes for the switch and fan driver and the back panel is complete.
For the front panel, I followed a very similar process. I drilled out the mounting holes and then a large hole in the middle for the volt and ammeter. Then I used the nibbling tool to finish the job. After that I made holes for the banana jacks and the potentiometers to fit. Use extra caution to ensure that the two banana jacks do not touch the exposed metal, since that will short your output together. I then soldered the remaining connections to the panels and put them back on the case.
All that was left to do was attach the fans. So, I marked on the top panel where the fans would go, and drilled those holes out. These noctua fans came with this weird mounting things, so I put them in the hole instead of screws. Make sure to use some scissors to remove the excess afterwards. And well, that is the new power supply complete. Make sure to look out for it in my future videos!
Well, there you have it. A fully functional linear bench power supply. This isn’t the most beginner friendly, so I have attached a schematic and the PCB gerbers in the description if you would like to follow along. Anyways, if you have enjoyed this video and learned something new, I’d like to encourage you to visit my ‘buymeacoffee’ page. These video take a considerable amount of time and effort to make and with your support I can keep making more. Thanks for watching, have a good one!