Variable Power Supply

boxedUpI’ve been focusing on power supplies and related equipment lately because I don’t have a lot of bench gear. On one hand, I would like to build equipment from scratch, but on the other, it would be crazy not to look at some of the building block modules available on eBay and other outlets. I could not beat these prices, even if I built just about entirely from scrap. Using modules rather than homebrewing down to the metal seems like cheating, but it not only saves time and money, but often yields better performance and miniaturization.

So, this project consists of building a bench top power supply from three modules: a switching power supply that puts out a constant voltage, a DC/DC converter, and a combined voltmeter/ammeter. The combination is based on a youtube video by GreatScott that made use of a cheap DC/DC converter based on the LTC3780 that is being sold by various vendors  at a bargain price on eBay. Some of the same vendors are also selling a red and blue volt/ammeter. There are a few variations of the meter, I selected one rated for 100V and 10A and which did not require an external shunt resistor for current measurement.

I ordered one converter board and one display from two different vendors. The body of the two meters was identical, but the wires were slightly different in gauge and color. The two DC/DC converter boards were apparently identical except for placement of the heatsinks and the shunt resistors, as noted below.

powerModuleFrontpowerModuleRear

The switcher power supply that I ordered was a commodity item, again available from many vendors on eBay. I went with 12V/5A. For this application, it doesn’t really matter whether the voltage is terribly accurate, but it is desirable that it not be noisy.

The DC/DC converter board is reviewed in detail on the beyondlogic wiki. That site provides some information from the chinese datasheet and reverse engineers some of the control features. The board is said to tolerate input voltage 5-32V, outputs 0.3-30V, and in continuous operation can handle current of 7A and total power of 70W.

There are three small potentiometers on the DC/DC converter board; with the input voltage on the left, they are at the bottom of the board, from left to right: low voltage cutoff, current limit, and voltage output. I adjusted the voltage current to the extreme of its range to get it out of the way.

The voltage output adjustment pot is about 500k ohm. Configured as a rheostat. On the high side, it is connected to output voltage, and the lower end is the upper half of a voltage divider. A 14k resistor serves as the lower half. The divider voltage is sampled by the Vo(sense) line of the LTC3780, which will adjust output to keep the Vo(sense) at 0.8V.

One important implication of that design is that adding a larger potentiometer could destroy the chip. The formula for output voltage is 0.8V * (1 + potentiometer/14k). With a pot much larger than 500k, the output voltage would be driven out of spec trying to compensate for the voltage at Vo(sense).

I had a 500k pot on hand, but found that it was difficult to make fine adjustments. One solution would be to replace it with a multi-turn pot, but the only ones I had on hand were 10k and 100k. I went with the 100k one, but to keep the voltage divider in the right range replaced the 14k SMD (0805) resistor with a 2k8 one. By calculation, this should yield a maximum output voltage of 29.3V, which turned out to be the case.

The one other feature that I wanted was current limiting. The middle 200k potentiometer sets the current limit such that if a load draws more, output voltage drops. This circuit is built around a shunt resistor and an LM358 configured as a non-inverting amplifier. Voltage above the shunt resistor is the positive input, and the potentiometer and other resistors in the feedback loop set gain. When the shunt voltage times the gain exceeds 0.8V plus a diode drop, that voltage is fed to Vo(sense), and the LTC3780 starts dropping its output voltage.

resistorBoardTo make practical use of the supply, I wanted to be able to set a known current limit without having to hook the supply to an electronic load each time. Two approaches came to mind: 1) replacing the potentiometer with a microprocessor-controlled one, working out calibration and implementing the control in firmware; and 2) selecting fixed resistances for a few useful current limits. The first approach would require a microprocessor, display, rotary encoder, and a digital potentiometer. That seemed like overkill. On the other hand, I had a multiposition switch in my junque box. It was originally double ganged and wired to switch four inputs between three positions, but it did not take a lot to take it apart, rewire, and polish up.

I made a spreadsheet to calculate the resistances needed to obtain various current limits assuming that I would switch in a resistance between the 1k resistor on the board and the 1M6 resistor at the LM358’s output. The junction between my added resistor and the 1M6 resistor went to the LM358 negative input.

I tried a few values, monitored the current on an electronic load and realized that the currents obtained were systematically off. I had measured the voltage drop across the diode between the op amp output and the Vo(sense), and the 0.8V value came from the datasheet, so the other possibility was the shunt resistor. On my board, the shunt resistor is labeled R008 (8 mOhm) versus the description by beyondlogic of 7 mOhm on their board. Working backwards, I calculated the total observed resistance as 9.3 mOhm, mostly the shunt resistor, but apparently also some contribution from solder, traces, wiring, etc.

blownUp

Working with a revised spreadsheet that takes the real world resistance into consideration, I worked out a table of values. To be spot on, I used trimmer pots to adjust the higher values. I did not have a trimmer for the lower values, so I used fixed resistances. I could later add trimmers, but the low-end currents are not that critical for my applications.

The meter used has two leads to power its board; these connected to the 12V input of the DC/DC converter. The heavy red wire from the meter went to the positive output jack. The negative output from the DC/DC converter went to the heavy black wire on the meter, and the blue wire from the meter to the negative output terminal. The meter does care about polarity for the current measurement. I found the meter well-calibrated from the factory, with no need to adjust. The meter’s integrated ~50 mOhm shunt is a negligible load.

halves

The supply was built in plastic case, with the AC input and switching power supply in the bottom half, and the DC/DC board, resistance board, and front panel on the bottom half. The only connection between the two halves is the 12V output from the switching power supply; the connection is made through powerpole connectors. In a pinch, the switching power supply can be bypassed, and any other DC source within a reasonable voltage range could be quickly plugged in via the powerpole connection.

Now the make the labels for the front panel…

15 thoughts on “Variable Power Supply”

  1. Hello Jack, I must say it’s a very nice project and you did a great job documenting the process. Especially I like the idea of using a rotary switch instead of a potentiometer for precise current limiting… unfortunately, I may be a little dense and I can not understand how to calculate the required resistances for certain limits. The fact that the link to spreadsheet appears to be down, doesn’t help either I suppose 🙂

    I would like to implement this in a very similar project, would be nice if you could help me out a bit.
    Thank you.

  2. Hi Dalius – Sorry about the broken link – I must have moved the file on the cloud drive while doing some “house cleaning.” I have uploaded it again; please let me know if you still have difficulty getting it to download.

    The trick in getting the right resistance is to make your best guess using calculation, but then experimentally put in a high precision resistor and see what kind of voltage you get. From there, you can work backwards to refine your guess about the resistance of the shunt resistor plus connections in its path. For me, I had a 8 mOhm resistor, but calculations worked out if I assumed it was 9.3mOhm, for example. Ultimately, you could fine tune the fixed resistances empirically.

    One drawback to this design is that the switch resistance may contribute a bit or change over time, but I think it’s a small factor.

    Good luck,

    Jack

  3. The file downloads fine now, and it’s a big help. Thank you for taking the time to update the links.

  4. Thanks for publishing your project and have commenced a similar project with the intention of only using voltage control, however removing the 500k pot and reconnecting with a short length of cable for mounting causes the module to heat up and draw additional current once the output is higher than input of 12 volts with no load. This happens with both the new pot and original pot when connected by cable, replacing the pot back on the board restores all to normal. I tried shielding and twisting cable with no success.

    I was wondering whether you had this experience and how to overcome the problem.

  5. Hi Gordon, Sorry for the slow reply on this one – I’ve been traveling for the last few weeks. I agree, this is puzzling. I just ran about 10cm of straight wire to the pot that I used. I doubt the problem is with the pot, as you’ve used the original and a replacement. One other experiment you could try – replace the pot with a 270k resistor. If you have a 14k SMT resistor on the board to form the voltage sense divider, you should measure 16.2V at the output. You could try it on the board versus using a wire connector; if this works, it would be somewhat reassuring.

    You could also try testing using a small load and see if you observe the same behavior. I think it works without a load, but in my set up I have the digital display attached to it, so I suppose that would constitute a very tiny load, but a small load might help with stability. Try putting a small resistor and LED across the output.

    I think it’s more likely that the length of wire has something to do with it, perhaps picking up some nearby signal and throwing one of the op amps into oscillation. You might be able to sniff out such oscillation with an oscilloscope. Perhaps you could prevent it by looping the end of the pot cable nearest the board through a ferrite a few times.

    If you find a solution, I’d be curious to hear what you think the problem was.

    Cheers,

    Jack

  6. Hi Jack, thanks for your response. I had tried your suggestion of using a load on the board and the ferrite bead without success. In the end the solution that worked for me was to use a shielded cable earthed to negative on the board and to the pot case which stabilised the the board current draw and output voltage. So I am guessing that the cable is is affected by some capacitance or inductance.

    Another observation is the connection of the meter negative for the display. On the module supplied to me the display negative and the ammeter negative are connected. This gives a parallel path for any load currents back to the 12 volt supply which at higher currents could exceed the current rating of the thinner display wire. I am thinking that I will leave it disconnected so there is only one current path back to the supply.

    Regards,
    Gordon

  7. I’m little confused, the 14k smd resistor code is 143. Why you mention in the parenthesis 0805? Sorry for dump question 😛

  8. No problem – The “0805” refers to the size of the resistor. It comes from the size in imperial units, 0.08 inches by 0.05 inches. It is equivalent to metric size of “2012”, but for some reason, the older nomenclature seems more common.

    Cheers,
    Jack

  9. Thanks for you answer Jack. Please let me ask you one more question, where is this resistor located on the pcb? I’m looking some high-res photos of this board (since my parcel has not arrived yet) but i can’t find the 14K SMD resistor.

    Also, do you think using a 1? 50W resistor for testing the load & adjust the current limit rather than a multi-position switch is a safe choice?

    Regards

  10. Hi,

    In this case, the resistor is marked “1402” instead of “143” — just a matter of specifying the resistance with three significant figures. I’ve enlarged one of the photos above and have put a box around it.

    14k SMD resistor

    In one of the photos of the completed project towards the bottom of the blog post, you can see a bit of red tape under my bodged modification of this resistor. – Jack

  11. I have a 200k and a 20k ohm 1/2w potentiometers connected in series used to coarse and fine voltage control over ltc3780 boost converter. If i put a 0805 6.2k ohm resistor replacing the 14k resistor used in the ltc3780 boost converter the voltage divider would be in the right range??

  12. Hello Jack, I have to say NICE article!

    I have two questions.
    1. Can I instead the 200k ohm potentiometer (i.e., potentiometer for current limiter) use 20 kohm potentiometer ?
    2. Is it possible to connect a LED that would indicate that current limiter is active (i.e., current limiter limits the output current)?

    Thank you, Oliver.

  13. Hi Oliver – Sorry for the slow reply!

    1. Sure, that would be fine. With 200k, you would be able to set a larger range of currents; with 20k, the maximum current will probably be around 1.5 amps, which is still a decent amount for many projects.

    2. Yes, that would be possible. Take a look at the bottom schematic on the beyondlogic post. You could add another comparator, using the same inputs at the ones driving pins 2 and 3 of the LM358: the set point from your current-limiting potentiometer, and the voltage above the current sense resistor. When the current sense resistor voltage exceeds the set point, the comparator output will go high. Depending on what part you choose, you could probably drive an LED directly from the comparator output or use the comparator output to control an LED via an N-channel mosfet. If you had another LM358 on hand, for example, you could take the inputs to pins 2 and just like in the diagram, borrow some 5V rail power from the board to power pin 8, and put pin 4 to ground. Then, take pin 1 directly to the positive side of the LED, and connect the LED’s negative end to ground through an (about) 330-1k ohm resistor. The LM358 can output 20mA, and you probably need only about 10mA or less for most LEDs, so choose your current limiting resistor accordingly. If you had a comparator that could not source as much current, you could take its output to the gate of a 2n7000 or similar mosfet. That gate should be pulled to ground through an about 10k resistor. Then, put an LED and a small resistor as above between the 5V rail and the drain of the 2n7000. The 2n7000’s source would connect to ground to complete the circuit. This makes sense in my head — hopefully I’ve got it all right :-). Good luck on your project – Jack

Leave a Reply

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