How to design and build your own hobby power supply using an LM317.
BUILD TIME: 2 Hours DIFFICULTY RATING: Intermediate
Going back through issues of DIYODE, it’s easy to see that we have a passion for power supplies. Many in-depth Classroom articles on linear and switchmode supplies, to several power projects based around ATX PC power supplies, etc. This fascination with power supplies comes from the fact that a power supply is a very important tool for anyone delving into electronics.
This is self-evident in the fact that our staff writer, Johann, has nine different ways to provide power to an electronics project. This includes a variable autotransformer (variac), fixed AC transformers, lab bench supplies, and homemade adjustable power supplies. This is largely due to the vast range of projects he designs and tests.
For this project, we are going to look at some basic textbook circuits based around the LM317 linear voltage regulator, and show you how we can modify them to make a variable voltage supply, suitable for hobbyist use.
By the end of this article you will be able to make your own short-form linear power supply with adjustable voltage ranges. In part 2, we will expand on the design with added functionality and provide a 3D printed case.
THE BROAD OVERVIEW
Before we start with our power supply design, we need to set ourselves some realistic goals and criteria to be used as the metric for a successful project.
COMMON VOLTAGE OUTPUTS
Our power supply must output all of the most common voltages we are likely to use while making basic electronics projects. i.e. 3.3V, 5V, 9V, and 12V. For the most part, this is limited to the band between 3.3V used in some microcontrollers and electronic modules, and 12V common for automotive applications and solar projects.
ADEQUATE CURRENT OUTPUT
Naturally, we need to be sure our power supply can deliver sufficient current at the common voltage outputs. The average hobbyist/maker projects are usually based on microcontrollers, servos, stepper motors, LEDs and basic DC motors. As a rule, these devices generally draw low power, usually less than 500mA, except for DC motors, which can draw a high peak current at start-up and stall. For this reason, we need our supply to be able to produce up to 1.5A constant load, ensuring plenty of headroom.
STABLE POWER OUTPUT
Our design needs to have a consistent and reliable voltage and current output. The output should have minimal drift at varying temperatures and loads, and have as little ripple and noise as practical.
CURRENT LIMITING CAPABILITIES
Having the ability to control the amount of current delivered to a load is a worthwhile safety feature. If we accidentally connect a circuit incorrectly, the current limiting will protect the circuit from damage. This feature is a must when you are prototyping your electronic project designs.
WIDE RANGE POWER SOURCE
We need our supply to be versatile and work from an entire array of potential inputs. One of the easiest and arguably most common ways for makers and hobbyists to power their electronic projects is with an ATX power supply, salvaged from a scrapped computer. These supplies generally have several fixed voltage rails, ranging from 3.3V to 5V and 12V with some also having -5V and -12V rails.
Note: An ATX power supply has a maximum output voltage usually of 12V. If you do choose to power this circuit via 12V, your maximum adjustable output will be between 2.5V and 8V due to the LM317 having a 2-3V dropout voltage. It would still be useable of course but that limitation needs to be known.
Another common power supply is a laptop power brick, salvaged from an old laptop. These generally have a 19V 2A or higher output, and are perfect for use in projects like this. We have designed this project with this 19V specification in mind and all calculations are based on this expected input.
You could also use a 24VAC mains power adapter, or for suitably qualified individuals, use a mains stepdown transformer, which would mean including a full wave bridge rectifier and necessary AC protection features to meet regulations. We have left a suitable location on the PCB for a filter capacitor and FWBR if you wish to go this route, however, this method is beyond the scope of this article.
FAN WITH TEMPERATURE CONTROL
A cooling fan enables us to keep our power supply from overheating, but none of us like a noisy device on our workbench while we work. As such, we want our power supply fan to only activate when the temperature starts to climb higher than ideal. This will also reduce wasted power.
VOLTAGE AND CURRENT DISPLAY
A reliable voltage and current readout will let the user know the power supply parameters at a glance. These displays should be as accurate as practical as the user needs to be confident that the unit is producing the stated parameters.
SHORT CIRCUIT PROTECTION
The circuit must be able to withstand a sustained short circuit condition on the output, without damaging the circuit or requiring a fuse replacement. A short circuit on the output is a common mistake made by many electronics enthusiasts, so our circuit must be able to comfortably survive this condition.
Our power supply needs to be affordable to build for makers and students alike. Therefore, it needs to be cost effective whilst not reducing the functionality mentioned above. Where possible, our supply will use commonly available components that are easy to obtain and as inexpensive as possible. We will also attempt to design it in a way that specialised tools are not required.
HOW IT WORKS
The first step in building our power supply is to test the capabilities of the LM317 by itself. To do this, we construct a basic circuit for the LM317 based on the application hints section of the datasheet as shown here.
The LM317 adjusts its output voltage in relation to the voltage seen at the ADJ pin, by attempting to keep a constant voltage drop across R1 (between Vout and ADJ) at 1.25V.
The output voltage can be calculated using:
VOUT = VREF (1 + R2/R1) + IADJ × R2
In our setup:
VIN = 19.2V
VOUT = 3.32V
R1 = 1KΩ
VR1, in our case, is made from a 5KΩ and 1kΩ potentiometer. Together, they form a coarse and fine adjustment of the voltage.
We added a 47μF capacitor from Vout to GND for output stability and a 0.1μF capacitor from Vin to GND for input noise reduction.
Our initial testing setup was done on a breadboard with a small TO220 heatsink on the LM317 to help dissipate a little heat and to allow us to attach a thermocouple from our Unit-t UT804 Bench multimeter. We placed a fan in front of this heatsink to assist with cooling and had it powered at its full power. We used a Digitech QM1571 multimeter to monitor the output voltage across the 47μF output capacitor. The load was provided by a ZKE tech EBD-A20H electronic constant current load set to dissipate 1.5A.
We started with the output voltage at 12V with the load demanding 1.5A, and adjusted the potentiometer until the underload output voltage was at 3.32V. At this point, the LM317 was dissipating:
P = (VIN - VOUT) × IOUT = (19.2V - 3.32V) × 1.5A == 23.82W
However, after a very short amount of time of fewer than 60 seconds, the device output began to shut off-and-on, in rapid succession. This was presumably caused by the internal thermal protection built into the LM317 design.
To overcome this, we can increase the size of the heatsink to keep the thermal protection from triggering, however, we would need a very large sink. This will likely still result in the LM317 running substantially hot, which will significantly reduce the lifespan of the device.
We tested this by reducing the load current down to a 1A draw. At this current draw the LM317 was dissipating:
P = (VIN - VOUT) × IOUT = (19.2V - 3.32V) × 1A == 15.88W
At this reduced current capacity, the device was still well over 100°C and clearly wasn’t suitable for our project without needing either a huge heatsink or some accompanying circuitry.
To test if the LM317 was suitable for our minimal noise criteria, we attached an oscilloscope probe across the output capacitor pin and barrel method to measure the output noise. In this configuration, the LM317 was able to provide a fairly stable output, relatively low on noise (considering the conditions), as shown on the oscilloscope screenshot here.
This transient switching noise was a little confusing at first, as 200mV is quite a bit more than we were initially expecting. To remove the potential that other devices were causing the noise, we swapped the constant current load for a purely resistive load consisting of a 100W 4Ω resistor. With this as the load, the current demand on the system dropped to 830mA (3.32/4) and the noise was reduced from 180mV to around 100mV, as shown here.
This appeared to show that the system was indeed quite noisy at higher currents. This could be a result of the breadboard construction and insufficient filtering on the output. Further testing will be needed with a PCB and updated circuit.
During this test, with an output of 3.32V at 1A, the LM317 heatsink quickly exceeded temperatures we would be comfortable running the regulator at for prolonged periods. Whilst it wasn’t thermally shutting down with this load, it’s clearly not ideal for long term use. This means we needed a way to reduce the heat dissipation of the LM317. To do this, we chose to use a transistor in conjunction with the LM317 as a means to bypass the current so that the LM317 does not need to dissipate the full amount of power.
To test this, we designed two circuits; one using an NPN and one using a PNP bypass transistor. We then tested both circuits under various loads ranging from 100mA, 500mA, 1A and 1.5A and at various voltages ranging from 3.3V, 5V, 9V and 12V. In all situations, the input voltage was 19V.
To test the two different circuits, we used the Bantam Mill to whip up a PCB, which had both circuits on the same board. This allowed us to reliably measure the output noise, and to help decide which of the two designs is best.
We found that the PNP circuit, which used a TO3 MJ2955, had the best performance in efficiency, noise, voltage regulation, stability and heat. The NPN version didn’t perform very well.
In this PNP configuration, the current into the LM317 first travels through resistor Rb. At low currents, the voltage drop across Rb is quite small, and as such, insufficient to allow current to flow from the collector to emitter of the transistor. Thus, all of the current is supplied via the LM317. However, if we increase the current so that the voltage dropped across Rb exceeds 0.7V, the transistor will begin to allow current to flow through the collector - emitter, which bypasses the LM317. This increase in voltage is still measured via the ADJ pin of the LM317. If the voltage exceeds 1.25V across R2, the LM317 reduces the input current, thus reducing the voltage drop across Rb and turning the transistor off until the voltage across R2 drops below 1.25V, in which the cycle continues at a very rapid pace.
To test the circuit, we used our electronic load from Issue 22 to keep a constant current load on the circuit. We set the required output voltage and set the load to draw the maximum required current of 1.5A. During the test, we had the probes of our Hantek DSO5072P oscilloscope across the output of the power supply to measure the switching noise. After running the circuit at this load for 30 minutes, we recorded the temperatures of the PNP transistor and the LM317 using our UNI-T UT804 and Digitech QM1571 multimeters. Both devices were measured via a K-type thermocouple applied to the case of the device. After this, we raised the voltage to the next testing range and repeat the test. The LM317 had no heatsink attached while the MJ2955 had a small chipset heatsink resting on the top, held by the surface tension supplied by thermal paste. We also had a 40x40mm fan blowing over the MJ2955 and LM317 to aid with cooling.
When testing the design in this configuration and without heatsinks, the PNP transistor case reached a maximum of 101.5°C, while the LM317 reached a little over 46°C.
Note: The transient noise was measured across the electrolytic output filter capacitor on the PCB with ground spring attached, and whilst the device was under full load. The oscilloscope had 20MHz bandwidth limiting enabled, 10X scope probe and AC coupling. The recorded waveforms can be found on the resource section of our website for anyone interested in the output noise. In a future revision of this circuit, a 0.1uF ceramic capacitor will be added to the circuit to help reduce this noise.
These results were fairly promising. Whilst we clearly still need a heatsink for the device, the heatsink required is much smaller than using the LM317 alone. This, of course, comes at a cost to system noise and voltage regulation stability.
We did, however, discover a few design errors with this test circuit. The 100μF electrolytic capacitor C1 on the output could be increased to 470μF but also needs a 0.1μF ceramic capacitor in parallel for filtering. It may also be necessary to add a diode across the input and output of the LM317, with the cathode facing the input to protect the LM317 from this capacitor discharging into it if the input is shorted.
We also noticed that we neglected to ensure that sufficient current was flowing through the voltage divider R1, R2 to maintain the required 3.5–10mA draw on the LM317 for no load voltage stability. This parameter is called the “Minimum Load Current” in the datasheet and states a typical minimum current of 3.5mA and the maximum of 10mA. Without this load, the no load voltage can be several volts over the dialed in voltage at lower voltages. To rectify this, we changed the value of R2 to 270Ω and added an LED circuit on the output which consisted of a red LED with a forward voltage (Vf) of 1.8V and a 1KΩ current limiting resistor in series with it. This combination with a maximum output voltage of 17.4V, allow 15.6mA to flow through the LED, dissipating 244mW or around 1/4 of a Watt. This load in conjunction with the modified voltage divider gave us a no-load voltage from the power supply of 2.44V and a maximum of 17.4V.
Note: The brightness of this LED will fluctuate depending on the output voltage. In a later revision, once we know the exact maximum output voltage, we will modify the value of the current limiting resistor to reduce as much of the fluctuations as possible.
The next step in the project was to implement a way to limit the current to the output. As it stands, we could short circuit the output of this supply, which could easily damage the circuit itself or the unregulated power supply powering it. The datasheet for the LM317 had quite a few interesting example circuits in its typical application section. As such, we decided to start there for an idea of how to design this limiting section. After a bit of reading, we came across a typical application schematic for the precision current limiter shown here.
Of course, our celebration was short lived the moment we noticed that the circuit required the load current to pass through the potentiometer. Potentiometers that can handle high currents are not very common, significantly larger, and generally, have a significantly higher price tag. This circuit does, however, give us a very good idea how easy it is to use an LM317 as a current limiting device. We could essentially modify this circuit to use a fixed value resistor instead of the potentiometer, which would limit the total maximum current output.
Note: The LM317 has around a 3V dropout. With two of the regulators, we can expect a maximum output up to 6V less than the input. This is unavoidable using this style of linear regulator. If this is unacceptable you can replace the LM317 with a low drop out regulator. It’s possible that the LM1117 can be a drop-in replacement for the voltage regulating 317. It has a dropout voltage of 1.2V, comes in the same package and has the same pinout and required circuitry. However, we can’t guarantee 100% acceptability for the project due to the lower current capabilities of this IC. It would, of course, be possible to change the value of RB so that less current is needed to bias the MJ2955, however, this will need to be left to you to design.
The formula given for current out is simply ohms law. If we rearrange it to make R1 the subject, we get:
R1 = VREF / IMAX = 1.25/1.5 = 0.8333Ω
This means, if we were to replace the potentiometer R1 in this circuit with a fixed 0.8333Ω value resistor, the maximum current output of the circuit will be 1.5A. Thus, if we have a way to change this resistance value, we could change the maximum allowable current. If let’s say, we wanted a one-amp maximum load, we use that equation to calculate what resistance value is needed.
While we are there, we can also calculate the power dissipation of this resistor using the formula:
P = I2R
I is the maximum desired current and R is the resistance value we just calculated. This value will show us what power capabilities the chosen resistors must be to be suitable for this application.
Since using a high-power potentiometer isn’t an ideal option due to its higher cost and difficulty for hobbyist/maker to acquire, we consider using fixed value resistors that we can change using a switch. A 12 position rotary switch came to mind.
This rotary switch has an AC rating of 240V at 150mA with no specifications given for DC situations. These ratings derived from the switch’s ability to successfully open a connection. On the surface level, an open contact means no current can flow, however, when you consider frequency and voltage levels, you start to see some potential issues. If the switch does not open far enough, the voltage has the potential to arc over the airgap between contacts. With AC, this arc usually self-extinguishes pretty quick as the voltage passes the zero-crossing point many times a second. In DC, however, this DC arc over is constant as the voltage remains unchanged.
The manufacturer’s datasheet, unfortunately, does not state any DC specifications, and there isn’t a way to convert the AC ratings to a DC equivalent. This led us to conduct a couple of basic tests and calculations on the switch. Since the switch has a maximum contact resistance of 50mΩ, we can roughly calculate if 1.5A is likely to cause significant internal heating of the switch.
P = VI == I2R
P = 1.52 × 50 × 103 = 113mW
This means, the switch will dissipate 120mW at maximum, or less than an 1/8th of a Watt. After years of use, the switch contact resistance is likely to climb, however, even if the resistance was to double over the lifetime of the switch to 100mΩ, the power dissipation would still be less than ¼ of a Watt.
We suspect that the limitation here is not likely the current, as 1/4 of a watt is not sufficient to cause significant internal heating. Despite this, we decided to test the switch by applying a constant 3A maximum load through the switch which would create a power dissipation of about ½ a watt.
Even when doubling the maximum current, the switch did not heat up an any noticeable way and seemingly had no issue with the higher current.
This means the most likely potential issue using this switch will likely come from the DC arc over that can happen has a switch is opened. This could easily be solved by the use of a load switch to remove power to the switch when actuating it. For now though, we will continue with the design using this switch.
SHORT CIRCUIT PROTECTION
With the current limiting circuit designed, we now know that an absolute maximum current of 1.5A can be delivered into the load. However, we need to be sure that the chosen components of this circuitry can withstand a short circuit on the output.
The LM317 datasheet states that the device has its own short circuit and thermal protection, which will prevent the device from damage if it is unable to maintain the 1.25V drop across R1 or the device overheats. However, there is a potential issue with C1 and C3 on the output. These capacitors can discharge into the Vout of the regulator if Vin is lower than Vout, which can happen if Vin is shorted to ground. Whilst this is unlikely to happen with the circuit on a PCB, we have designed into the circuit a means to protect against this condition. Diode D5 will, in the advent of an input short circuit or a sudden drop in input voltage, allow the energy stored in C1 and C3 a path back through the LM317, protecting the device from destruction.
We also need to ensure that the MJ2955 can handle dissipating the entire short circuit power. With a 19V supply under short circuit, the MJ2955 will need to dissipate the 19V, excluding the voltage drops across the bridge rectifier, the current limiting LM317, the current set resistor, etc. as well as the drops across the voltage regulating LM317, the base resistor Rb, etc. Let’s just say, the MJ2955 needs to drop the entire 19V at 1.5A. That would mean the total power dissipation under an output short circuit would be P=VI = 28.5W.
We can calculate how hot the junction will get under this load using the following formula:
TJ = P(RӨJC + R1 + R2) + TA
Where: Tj = temperature at the junction
P = Power dissipated
RӨJC = The thermal resistance junction to case
R1 = Thermal resistance of the device to heatsink or air
R2 = Thermal resistance of junction to air
Ta = Ambient / operating temperature
The MJ2955 has a thermal resistance junction to case RӨJC of 1.52°C/W, as taken from the datasheet. So, let’s say, we go with the HH8570 heatsink from Jaycar, which claims a thermal spec of about 60°C/W. This would mean, with 30W of dissipation across the MJ2995, we can expect the temperature to rise to:
TJ = 30(1.52 + 2.5) + 25 = 145.6°C
The datasheet for the MJ2955 lists the absolute operating junction temperature Tj to be 200°C, which suggests that under a short circuit load the transistor should survive reaching temperatures exceeding 140°C. However, it will make sense in this situation for us to mount the LM317 to the same heatsink as the MJ2995. The thermal protection built into the LM317 will shut down the output of both the voltage regulator and the transistor if the temperature exceeds the maximum RӨjc of the LM317, which is 125°C. This will protect both devices in a short circuit condition.
Note: The LM317’s tab is attached to its Vout pin and the MJ2995’s case is attached to its collector. Since both of these are electronically connected in circuit, we do not need to worry about electrical isolation when mounting the two devices to the same heatsink.
Now that we understand how the LM317 component works, we can now build and test our power supply circuit.
Below, we will describe our power supply build, including a PCB design and construction.
Spoiler alert! Even though it works satisfactorily, we plan to design an enhanced power supply in next month's issue, which will overcome a few shortcomings with this build that we describe later in the article. Some extra inclusions to the design will be a voltage and current display and fan control circuitry.
With that in mind, if you are just looking for a basic power supply, without the bells and whistles, then this supply will be fine. As such, we present it as a short-form project. i.e. just the power supply itself without a case. You will be able to enclose it in your own 3D printed case or a case available from a local electronics retailer.
Adjustable Linear Power Supply
|Parts Required:||Jaycar||Altronics||Core Electronics|
|1 × MJ2955 PNP Transistor||ZT2235||-||-|
|2 × LM317 Voltage Regulators||ZV1615||Z0545||002-863-LM317TG|
|1 × 5mm Red LED||ZD0150||Z0800||FIT0242|
|4 × 3A Diode SMD Surface Mount*||ZR1025||-||-|
|1 × 1N4001 or 1N4004 Diode||ZR1004||Z0109||ADA755|
|1 × 2200µF 50V Electrolytic Capacitor||RE6241||R4906||-|
|1 × 220µF 25V Electrolytic Capacitor||RE6160||R5144||CE05149|
|2 × 0.1µF Ceramic Capacitor||RC5496||R2865||COM-08375|
|1 × 5KΩ Linear 16mm Potentiometer||RP7508||R2203†||-|
|1 × 1KΩ Linear 16mm Potentiometer||RP7504||R2202†||ADA1789|
|1 × 1KΩ 1/4W Resistor*||RR0572||R7046||PRT-14492|
|1 × 270Ω 1/4W Resistor*||RR0558||R7544||CE05092|
|1 × 0.82Ω 5W Resistor*||-||R0310||-|
|1 × 1Ω 5W Resistor*||-||R0311||-|
|1 × 1.2Ω 5W Resistor*||-||R0312||-|
|1 × 1.5Ω 1W Resistor*||-||R7203||-|
|1 × 2.7Ω 1W Resistor*||-||R7206||-|
|1 × 4.7Ω 1W Resistor*||-||R7209||-|
|1 × 8.2Ω 0.6W Resistor*||-||R7708||-|
|1 × 12Ω 0.6W Resistor*||-||R7512||-|
|1 × 24Ω 0.6W Resistor*||-||R7519||-|
|1 × 120Ω 0.6W Resistor*||-||R7536||-|
|1 × 12 Position 1 Pole Rotary Switch||SR1210||S3021||003-ROTP1P12†|
|1 × 55mm Fan Type Heatsink||HH8570||H0520||-|
|2 × Screw Terminals||HM3172||P2032B||PRT-08432|
* Quantity shown, may be sold in packs.
† Suitable for the design but will not mount into the PCB design.
Now that we know how we were going to implement the power delivery side of the circuit, it is time to start creating a preliminary PCB that we can use to test the performance of the completed design.
This PCB will only have the core components on it, to essentially find any design faults or limitations. A PCB with the thermal/fan control and display circuits will be presented in next month’s issue.
We used EagleCAD PCB design software, which is available for students and Makers free with limitations on board size and the number of layers. Our PCB was milled on our Bantam desktop mill, which simply required us to import the Eagle BRD files, without needing to create Gerber’s, which is a handy feature.
The PCB files are available from our website. As the pattern is single sided, those adventurous enough can download the PCB copper pattern and produce their own PCB by toner method or whatever you can manage. You can also use the files to export the Gerber files if you wish to have the board manufactured by a PCB supplier.
The PCB file can be downloaded from the resources section of our website for you to etch, mill or to order from a PCB manufacturer.
Start by soldering the low-profile components and working your way up to the larger ones. This will help to keep the board stable while soldering.
We used two female to female brass standoffs and four M3 screws to mount the MJ2955, which enabled us to test different types of heatsinks. You can simply screw the transistor to the PCB if you prefer. You just need to make sure there is a good electrical connection between the traces on the PCB and the case of the transistor. This is the only connection for the collector of the transistor and without it, the transistor will simply not work.
Follow the circuit diagram or PCB overlay to complete the build.
After we constructed the device we noticed we had some significant issues using the two potentiometers. We opted to use a 5K ohm and 1K ohm potentiometer in series in this circuit. The theory was that this would allow a coarse and fine adjustment. However, in reality, we found that the 1k potentiometer offered too little of an adjustment to be useful. A ten turn potentiometer would certainly be ideal in this situation, however, our local suppliers don't stock a panel mount version. In next month's build, we will consider just using a 5K ohm potentiometer.
All in all, we have been fairly impressed with the performance of the circuit, but note that improvements need to be made, which we will cover in next month’s issue.
As you saw in the testing, the two potentiometer adjustment system is not ideal, and makes the device a bit of a pain to use. Ideally, we will replace the two potentiometers with a single 10 turn 5K trimmer potentiometer. This will provide a nice simple voltage adjustment that is accurate, stable and not fiddly.
The board works as expected from a thermal perspective, with a moderate sized heatsink required on the current limiting LM317 and the MJ2955, while the voltage regulating LM317 will likely survive fine without any heatsinking at all.
There are a few small issues with the PCB design, which will need to be rectified. The 2200μF rectified AC input filter cap (optional for AC input) has an issue with its footprint, which resulted in the pin holes being too small.
The track width for the current limiting should be increased slightly to reduce the resistance in this section. We suspect this resistance may be causing our current limiting to be off as our maximum current output for this board was 1.3A compared to the 1.5A we calculated for. Also, the distance between the mounting holes for the 3W resistors is too small. All these fixes will be implemented and tested on milled boards from the Bantam mill before we have the PCBs manufactured.
To test the output ripple, we used the dummy load from Issue 22 to apply an increasing load at each of the regularly required output voltages. The device was powered by our bench power supply and minimal heatsinking was applied to the LM317’s and the MJ2955.
Our oscilloscope was used to measure the output ripple at the output terminals and the ground clip was used rather than the tip and barrel or gnd spring methods. This is likely to produce higher ripple results than the preferred method. This resulted in the graph you can see here.
Immediately we can see that the ripple becomes huge at lower voltages and higher currents. We perceived this to be simply unacceptable as 0.7V at 1A is very high. We suspected this high ripple was caused by our small 47μF capacitor on the output and opted to replace the output it with a much greater value. i.e 470uF. With the new cap in place, we repeated the test and produced the results shown below.
This resulted in, as expected, a significantly lower output ripple and we can assume that subsequent increases in output capacitance will further reduce this ripple. It does, however, become a bit of cost benefit debate. For the average hobbyist use, this 200mV maximum peak-to-peak output ripple may be acceptable.
None the less, we wanted to remove other potential sources of this ripple from the equation and swapped the Dummy Load for a 4.7Ω 100W resistor. This resulted in the ripple dropping to 13mV on the output with a 5V and 1.064A draw. This level of ripple is perfectly acceptable and highlights that a dummy load is still a dynamic load and can add some pretty significant noise to a circuit under test (significantly more than I expected). The final test on ripple was done with purely resistive loads at various output voltages and various 10W resistors, selecting the resistance value to keep the current as close to 1A as practical. We then increased the voltage in 1V increments from 3.3V to 12V and record the measured values using our oscilloscope. This demonstrates how the device performs with an ideal resistive load.
These results were significantly more encouraging than the previous tests using the dummy load. They appear too good to be true, however, we are unable to find any documented projects that include ripple measurements of an LM317 to compare it too. We were expecting 10’s of millivolts of output ripple due to the pass transistor, however, in this configuration, the absolute maximum ripple we encountered was 6.16mV at 7V 1.148A.
An overshoot analysis is the analysis of a power supply’s ability to regulate its output voltage with sudden and unexpected loads on the output, or sudden changes of voltage on the input. This can range from the moment a heavy load is attached to its output, or the instant power is applied to the input i.e. power up. A good supply will, at all times, make sure that it’s output voltage does not exceed the user defined/desired output, as this could easily lead to damaged components on the device you are wanting to power.
For this test, we will have our oscilloscope in trigger mode with DC coupling and attached to the output of the power supply. The power supply will be set to provide 5V, a 4Ω resistor placed across the output, and power applied.
This shows the output voltage as the device powers up, and will allow us to be sure that the power supply can maintain its voltage regulation with sudden changes on the input. We will repeat this test several times at different voltages to ensure the device works at all voltages.
With this test, the device worked well. Whilst it’s slow to turn on, taking about 14ms, there was no detectable overshoot on the output. This is an ideal situation as this means you can comfortably and confidently apply power to your PSU while your device is attached, knowing that you’re not likely to damage anything.
Now we will test for overshoot when a load is rapidly applied. We will leave the oscilloscope setup as previous, however, for this experiment, we will use our dummy load from issue 22. We will set the desired current to 1A and use the load switch to toggle the load. This shows what happens when we suddenly change the load on the output.
Note: For the next two tests, we will use the oscilloscope in AC coupling mode so that we can focus on the transients.
As we can see here, the moment the load was applied, the voltage dropped by 1V sharply before regaining regulation/control. Within 16μs, the system was able to return to 80% of its regulated voltage, which is fairly quick and beyond what we were expecting. The device does not return to its pre-load voltage though. This is because at 1A, the resistance of the leads to the load and the load itself is dropping voltage across them. We can roughly calculate this internal resistance by using ohms law with the measured voltage difference and the known current. In our case, the current is 1A and the voltage drop is about 30mV. Therefore, the internal resistance and resistance of the wires is R=V/I = 0.03 × 1 = 30mΩ.
The final overshoot test is to analyse the circuit output when a load is removed quickly. This test is nearly identical to the previous test but now we want to see what happens when we remove the load via the load switch.
Here we can see that the moment the load was removed the output voltage increased by nearly 1.4V, before returning to its under-load voltage 20ms later. This wouldn’t be ideal in very sensitive circuits but isn’t anything to be too concerned about for hobbyist purposes. Some of our purchased power supplies have similar behaviour, if not worse than this, so it’s fairly safe to call this par for the course.
WHERE TO FROM HERE?
With the power supply performing better than expected (short of a few small design niggles) we consider part one to be a huge success. In next month’s issue, we will improve and expand on the design. We will rectify the lower than expected maximum current and also perform some in circuit tests on the rotary switch to confirm its suitability for the task.
We will add voltage and current detection, and a display to provide constant feedback on the output conditions. We will also include a fan control circuit to measure the temperature of the heatsink and activate a fan if it exceeds a preset temperature. We will complete the design with a 3D printed enclosure.