Variable power supply with Arduino...? - Page 1
Forum section: electronics / beginners

author: skillz21
author_rank: Frequent Contributor
timestamp: January 15, 2017, 04:12:54 am
content: I remember hearing about something like this... is it possible to make a small variable power supply, by sending constant pulses to a capacitor from an Arduino, with the Arduino monitoring the voltage at the capacitor, and making constant adjustments to the pulse? I know that there are probably way more effective ways of doing this, but I'm curious...Thanks!

author: Brumby
author_rank: Unknown
timestamp: January 15, 2017, 04:16:37 am
content: Don't see why not.If the energy is coming directly from the MPU pin, you aren't going to get much power - but you could buffer it in any number of ways to get some serious volts and/or amps.

author: skillz21
author_rank: Frequent Contributor
timestamp: January 15, 2017, 04:23:54 am
content: has this kind of thing been built before? if so, what are the keywords i could use to search it up on google? and does anyone know a link to a project like this?

author: Rick Law
author_rank: Super Contributor
timestamp: January 15, 2017, 04:25:34 am
content: Quote from: skillz21 on January 15, 2017, 04:12:54 amAdd a resistor (between the PWM pin to the capacitor+) and you just described a very simpleDAC - Digital to Analog converter.Quote from: skillz21 on January 15, 2017, 04:23:54 amThat DAC output is too small to run much of anything. You can use that Analog voltage to control buck converter. Look for "digital control buck" and you will find much.For example, right in this forum:https://www.eevblog.com/forum/beginners/(how-to)-arduino-digitally-controlled-step-down-buck-dc-converter/

author: Brumby
author_rank: Unknown
timestamp: January 15, 2017, 04:28:57 am
content: For the simple, (very) low power option:Quote from: Rick Law on January 15, 2017, 04:25:34 amVoltage monitoring would be by taking the +ve of the capacitor back to an analog input pin via appropriate circuitry.For something more serious, maybe search for "digitally controlled power supply"

author: skillz21
author_rank: Frequent Contributor
timestamp: January 15, 2017, 05:02:35 am
content: Quote from: Rick Law on January 15, 2017, 04:25:34 amI thought i might use something like a 9v battery to run the thing, that way i can use a Transistor or mosfet to charge the capacitor

author: Brumby
author_rank: Unknown
timestamp: January 15, 2017, 05:35:43 am
content: The other thing that might help direct your efforts is if you give us an idea of what you want to do with this power supply....

author: skillz21
author_rank: Frequent Contributor
timestamp: January 15, 2017, 05:50:43 am
content: Quote from: Brumby on January 15, 2017, 05:35:43 amJust general prototyping, LED's, maybe motors... stuff like that

author: Brumby
author_rank: Unknown
timestamp: January 15, 2017, 05:59:30 am
content: Have you watched this?....

author: Marinated
author_rank: Contributor
timestamp: January 15, 2017, 06:26:02 am
content: While you can use something like an Arduino to provide reference voltages to a power supply, it sounds like you're thinking of using an Arduino program as the power supply's control loop. If so, this is not a good idea as it will be far too slow. A software control loop can make sense if it is lower level (faster) than Arduino library code and controls a discrete switching power supply with PWM. On the other hand if you plan to use a linear topology then it is a nonstarter and you are better with an analog design with continuous response.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 15, 2017, 02:00:04 pm
content: It does not make much sense to control a linear output stage from the µC. There are a few examples of using the µC to control a switched mode supply - which is by nature giving it's energy in pulses and the PWM output of an µC looks like is control it. It kind of works but is still rather slow / low performance with a simple µC likes the AVR based Arduino. So usually dedicated chips are much better. This alone starts with the resolution of the ADC.

author: Brutte
author_rank: Frequent Contributor
timestamp: January 15, 2017, 02:36:04 pm
content: As mentioned, a PWM that is passed by low pass filter (simple RC is fine) is ok. That gives the output that has a DC component proportional to pulse width. Plus some AC components (aka ripple). But that is adequate for uA loads with attinies.So if you feed that to a voltage follower, you would get a voltage controlled voltage source. Opamp + one resistor would do but that is for 10mA loads or so. To get some serious currents, you need to use a power stage that can be controlled with 10mA from follower.

author: ziplock9000
author_rank: Regular Contributor
timestamp: January 16, 2017, 08:09:11 pm
content: Quote from: skillz21 on January 15, 2017, 05:50:43 amRealistically you'll need more than the Arduino can provide then. I recommend buying your first bench PSU before making one of your own however. You can pick up a good old Farnell analogue bench PSU for £30-£40 here in the UK and they are still solids supplies to get you started.

author: Rick Law
author_rank: Super Contributor
timestamp: January 17, 2017, 06:49:29 am
content: Quote from: ziplock9000 on January 16, 2017, 08:09:11 pmHaving experimented with using Arduino to provide control voltage to LM317 as experimental digital power supply, I must agree that implementing a PSU with Arduino/ATMEGA is a lot more complex than it seems. While each little problem is solvable, there are so many little problems and some are not that little. Particularly, one also need to make sure if something fails, Vout goes zero instead of max. Good that I was not looking to getting a day-to-day used PSU out of it. Polishing it up (better user interface for both hardware and software, more testing, etc.) would have cost quite a bit of money and time.For normal "bench PSU", I use the low cost Chinese made B3603 digital power supply. You may find that a good choice as well. I did a mini-review here:https://www.eevblog.com/forum/reviews/b3603-dcdc-buck-converter-mini-review-and-how-the-set-key-could-be-fatal/Note that I am just a hobbyist and not and expert. I am still riding with my training wheels on. The quality of the review reflected that.In that thread, you will find others who replaced the B3603's stock software with their own, and another replaced stock MCU daughter card with their own Arduino based controller. I experimented with my own Arduino based controller for the B3603 as well, but did not find the added complexity worth the extra feature I added.

author: skillz21
author_rank: Frequent Contributor
timestamp: January 17, 2017, 08:26:39 am
content: I'm not going to use this as a 'proper' lab power supply, just.... wondering if something like this can actually be built...

author: Brumby
author_rank: Unknown
timestamp: January 17, 2017, 11:52:47 am
content: There is no doubt that it can be built - but there will be performance limitations. Just remember that these limitations may introduce additional problems in projects you hook up to it.

author: adrx
author_rank: Newbie
timestamp: January 18, 2017, 10:53:52 am
content: Hi !You can found some smps and linear board on ebay that you can hook-up to adjust output voltage by replacing feedback circuitry by your own.I have found some board with ltc1083, probably lower noise, 1,5A lt3081 can fit on it with some tweek.Lt3081 is interesting because it provide current and die temperature monitoring, useful to monitor thermal load and that could help in dissipator sizing.Also many smps board seems based on mc34063 or mc34166 and equivalent .Remember lt1083/85 are ldo, you better use them with low Vdrop to limit power dissipation.For I out 5A and fixed Vdrop of 2V(can be 1,5V) Pd=10W (7,5W).But now let's take Vdrop=10V because you got a 15V input and you need 5V to power a MCU.We take the same power as we know the device can dissipate it:=> I = PD/Vdrop=> I=10/10=> I=1AYou could see as you increase Vdrop, the device as to dissipate more power, thus limiting the maximum output currentStart with the idea that your OA buffering filtered pwm will include the regulator in his feedback.Transistor in the next link could be your smps or linear voltage regulator:http://www.allaboutcircuits.com/technical-articles/how-to-buffer-an-op-amp-output-for-higher-current-part-1/You should get a look to AN2 from linear technology,especially figure 12 where you can replace the zener circuit with your Vref.Also figure 5 is a mixed smps/linear topology.To get lower noise and better efficiency, a linear reg follow a spms, but you got to keep the smps output near Linear regulator optimum Vdrop thus limiting power dissipation in the linea regulator.It need to control both smps and linear architectures, providing good u-power load regulation.

author: james_s
author_rank: Super Contributor
timestamp: January 25, 2017, 06:22:51 am
content: Those little regulator boards from ebay are great. I've made several small bench power supplies with them, using an old laptop charger style power brick as the source. I desoldered the small pot from the regulator board and wired it to a panel mount pot.