Arduino Controlled Variable Power Supply

Thread Starter

Jackpot17

Joined Jan 29, 2017
8
Specification:
- Arduino Controlled
- LCD to display: voltage, current limit and current draw
- 2 rotary encoders
- Up to 12V or so

I'm interested in building a variable bench power supply for powering my small electronics projects.
I understand there is a lot of content about this subject there isn't much detail on Arduino controlled PSUs.
I need help with the circuit design, how to set voltage and limit current.
I know the LM317 is a very popular chip for this use.
Would it be possible to control 2 of these chips using the analogue write pins of an Arduino and a low pass filter for each.

I'm thinking I could use this:
http://www.ebay.co.uk/itm/191733870857?_trksid=p2055119.m1438.l2649&var=490754623751&ssPageName=STRK:MEBIDX:IT

Or maybe I could buy a transformer some diodes and a capacitor. Which would be easier/cheaper?

I know I could just use potentiometers or buy a dedicated board or just buy a power supply, but I want a relatively simple project that involves some electronics and programming.
 

MrAl

Joined Jun 17, 2014
11,496
Specification:
- Arduino Controlled
- LCD to display: voltage, current limit and current draw
- 2 rotary encoders
- Up to 12V or so

I'm interested in building a variable bench power supply for powering my small electronics projects.
I understand there is a lot of content about this subject there isn't much detail on Arduino controlled PSUs.
I need help with the circuit design, how to set voltage and limit current.
I know the LM317 is a very popular chip for this use.
Would it be possible to control 2 of these chips using the analogue write pins of an Arduino and a low pass filter for each.

I'm thinking I could use this:
http://www.ebay.co.uk/itm/191733870857?_trksid=p2055119.m1438.l2649&var=490754623751&ssPageName=STRK:MEBIDX:IT

Or maybe I could buy a transformer some diodes and a capacitor. Which would be easier/cheaper?

I know I could just use potentiometers or buy a dedicated board or just buy a power supply, but I want a relatively simple project that involves some electronics and programming.
Hi,

If you are using a low pass filter to filter the digital output you may find it too slow for a good power supply. A power supply has to be able to respond fast to changes in load and line. It may work to some degree but you should test it for speed of response. If it is not fast enough you could end up blowing out some things you connect to it to test with it.
For example, even an LM358 used as the main control error amp may not be fast enough for some power supplies and that's with no microcontroller or anything. A part 10 times faster than that would be much better for example.
 

crutschow

Joined Mar 14, 2008
34,470
You can filter the PWM output from the Arduino with an RC filter and apply that voltage to the ADJ pin of an LM317.
The regulated output will be about 1.25V higher than the ADJ pin (the lowest output voltage of the LM317 is 1.25V).

If you want to go to 0V, you could use an LT3080, whose output follows the voltage at the set input without significant offset.
It also has a lower dropout voltage than the LM317.

You could control the current from the Arduino using another filtered PWM output to a circuit like this, in front of the regulator:
upload_2017-2-13_9-9-48.png
 
Last edited:

crutschow

Joined Mar 14, 2008
34,470
Here's an LTspice simulation of a 5V PWM signal to an LT3080 regulator.
The LT3080 output goes from 0V to about 14V as the PWM signal goes from 0% to 100% duty-cycle, with a 15V supply.
The PWM signal can be generated by an Arduino.

upload_2017-2-13_22-50-29.png

U3 is a 3-pole Bessel filter with a 12Hz corner and a 60ms settling time, to average and smooth the PWM pulses, giving a 0 to 5Vdc output.
This is amplified by the non-inverting amp U4 with a gain of 3 to give the (nearly) 15V output.

The filter rolloff frequency and the amp gain are determined by the PWM frequency and the input to output voltage gain required.
(The simulation used a 550Hz PWM frequency, in the ballpark of Arduino PWM outputs).

This also works with a LM317 regulator except the minimum output would be 1.25V instead of 0V, and the maximum output would be about 1V less.
Simulation below:
upload_2017-2-13_23-4-59.png
 

Attachments

Last edited:

MrAl

Joined Jun 17, 2014
11,496
Hello,

That LT3080 looks pretty nice, too bad it is something like 4 dollars USD for one while the LM317 can be had for under a dollar.
 

Thread Starter

Jackpot17

Joined Jan 29, 2017
8
Hi,

If you are using a low pass filter to filter the digital output you may find it too slow for a good power supply. A power supply has to be able to respond fast to changes in load and line. It may work to some degree but you should test it for speed of response. If it is not fast enough you could end up blowing out some things you connect to it to test with it.
For example, even an LM358 used as the main control error amp may not be fast enough for some power supplies and that's with no microcontroller or anything. A part 10 times faster than that would be much better for example.
What about the use of a chip like this?
http://www.ebay.co.uk/itm/201793510042?_trksid=p2055119.m1438.l2649&ssPageName=STRK:MEBIDX:IT
 

crutschow

Joined Mar 14, 2008
34,470
If you are using a low pass filter to filter the digital output you may find it too slow for a good power supply. A power supply has to be able to respond fast to changes in load and line.
The scheme I proposed uses the regulator to take care of the line and load regulation.
All the PWM signal does is set the regulator output voltage, the same as if you used a pot.
 

MrAl

Joined Jun 17, 2014
11,496
The scheme I proposed uses the regulator to take care of the line and load regulation.
All the PWM signal does is set the regulator output voltage, the same as if you used a pot.

Hi,

Yes and that's good, but the design i was talking about used the "Arduino" not the "Arduino plus another separate regulator".
If you use the Arduino to control a circuit that is already regulating, that's a different circuit than just using the Arduino and say a raw transistor. I say this because that's the way people want to do it sometimes to avoid adding parts. I myself may not have a problem with adding a separate regulator however. The LM317's are nice and cheap too so it does not add to the cost that much. Unfortunately the LT parts are always a price above the rest for some reason. Even in quantities of 1000 they might be over 2 dollars USD each which is still four times more than a LM317. Heck, i've used an 8 amp device like this that was only $1.80 USD which is the same as the LM317 only handles much more current (with the proper heat sink when required of course).

For another example of when we add parts to the Arduino and dont use the Arduino for the regulation itself, I could also see using a pass transistor with an op amp to create a self contained regulator and control it with the Arduino. That would also give us some more flexibility.

The lower dropout of the LT part is nice though, too bad it was not more competitively priced.
 
Top