PSU Design Notes

Need design best practice: microcontroller controlled, variable, DC voltage source [closed]

Ask QuestionAsked 2 days agoActive todayViewed 108 times1Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 10 hours ago.Improve this question

I need guidance on designing a Variable DC power supply with the following characteristics:

  • Microcontroller controlled
  • DC output ~ 1V – 30V
  • Current handling: ~5 amperes
  • Power handling: ~50 watts

I am an electrical engineer but I don’t really design power supplies.

I plan to commercialize a product however I am currently just breadboarding and getting a feel for what works.

Can anyone point me to how get started quickly?

I’ve tried working out a concept already: microcontroller –> potentiometer –> Switching voltage regulator (the voltage regulator receives voltage from a bench top power supply. I don’t really know how to design things that tap directly off mains power yet)microcontrollerpower-supplyvoltage-regulatordesignvoltage-sourceShareCiteEditFollowFlagedited 2 days agoJRE47.9k88 gold badges7474 silver badges129129 bronze badgesasked 2 days agoNorberto_M71122 bronze badges New contributor

  • 4Have you watched the series of videos that Dave from the EEVBlog made: youtube.com/watch?v=CIGjActDeoM&list=PLBF35875F73B5C9B5 ? That should introduce you to (lab) power supply design. I don’t really design power supplies. and Can anyone point me to how get started quickly? if you want to do this “quickly” then you might want to simplify things, a rushed/ quick design is rarely a good design. Especially your I plan to commercialize a product means you have to get it right. Or are you aiming to dissapointed your customers? – Bimpelrekkie 2 days ago 
  • @Bimpelrekkie, your youtube recommendation is very good. As usual I gave Dave 5 stars.Me ok booomer built a 2N3055 NPN BJT based serial PSU when studying my rusty EE diploma last century. I still remember vividly the great joy when I completed the project and showed it around to my friends. – tlfong01 yesterday   
  • But I am too lazy to DIY any PSU now. As Dave used to say, many electronics hobbyists are now shifting to system integration, instead of components integration*. So I am ordering an assembled PSU (the shop also sells DIY kit for hackers, though). If you wish to know more details (PSU with USB and WiFi control!) Please see my comments to @bobflux below. – tlfong01 yesterday   
  • @Norberto_M7, In case you would like to startup fast to commercialize a product, you might like to watch how Hongkong and Shenzen guys are doing. Here is an example from MIT who always says “Talk is cheap, Just learn by doing it“. So did it 5 years ago, sending students to ShenZhen, but seems not making much progress so far: (1) MIT Innovation Node Hong Kong – Rob Matheson, MIT 2015nov09: news.mit.edu/2015/innovation-node-hong-kong-1109, (2) MIT Innovation Node Hong Kong – MIT: hkinnovationnode.mit.edu. And of course you know that 99% of the startup guys failed! 🙂 – tlfong01 18 hours ago    
  • Why are you re-inventing the wheel? What does this product offer that existing supplies on the market don’t? What about displays? Which countries do you plan to sell it in? How will you fund prototyping and EMC testing? And so on… – Lundin 10 hours ago

Add a comment

3 Answers


If you want a cheap power supply that will do that, get a Korad KD3005P.

If you want to design it, first you need to decide on specs like:

  • Voltage, current, power (that’s done)
  • Output ripple voltage in voltage mode, and current ripple in current limit mode

This is important if you use a switching converter, you’ll want to know how much switching noise remains in the output.

  • Accuracy of voltage setting, also readback if it supports it, and same for current if it supports it.
  • What kind of load impedance it should be stable with (capacitance, ESR, etc)
  • If it is like a bench power supply with settable current limit, speed of switching from voltage to current mode and back.

This one is tricky. If you set the voltage to 30V and the current to 20mA, then connect a 5mm LED on the output, the output capacitors will be charged to 30V. If the capacitors are large, the LED will blow before the current limit circuit even notices. So the capacitors have to be tiny. But the current limit circuit also has to be fast enough.

microcontroller –> potentiometer –> Switching voltage regulator

It would be cheaper and more efficient to control the output voltage of a mains-powered switching supply. But this then becomes a SMPS design problem.

If you use a constant voltage SMPS and a switching converter, then you nee a switcher that will support the whole voltage range. Make sure to check the maximum ON-time of the FETs, because it’s never 100% for a design that uses NMOS, so if you want 30V on the output you’ll need a few extra volts on the input.

If you replace the feedback divider with a digital potentiometer, loop gain will change depending on potentiometer setting. So you’ll need to have an AC feedback path through a series RC that doesn’t go through the pot, and a DC path that goes through the pot. Also output voltage won’t go below the internal voltage reference. And, if the digipot is a 5V device, then it won’t work with more than 5V signals, which could severely limit your output voltage range.

Another option is to inject a DC offset into the feedback node, for example by connecting the “GND” end of the feedback divider to the output of a DAC. Say the switcher has an internal 1V2 reference, and you set the feedback divider so you get 30V on the output. If you shift the “GND” end of the feedback divider to +1.2V, then you get 0V output, so with a 3.3V or 5V DAC and a resistor divider, you can set your output voltage easily. It can also go below the internal reference voltage.

Note that there already are tons of cheap products that do this.ShareCiteEditFollowFlaganswered 2 days agobobflux43.7k33 gold badges5656 silver badges130130 bronze badges

  • I am glad to read your last line on cheap digital control PSU. Me poor electronics hobbyist has be using LM2596 based PSU modules all these years. So the time has come for me to upgrade to all digital PSU. Thanks again for opening my ok-boomer eyes. – tlfong01 yesterday    
  • Your AliEx catalog is a long list of gems in the AliBaba cave’s PSU corner. Now I have too much money left over from my abandoned overseas holiday trips, but nothing to do for another coming boringly long lock down week. So I have already ordered a new PSU toy to kill time. My new toy is a digitally controlled (USB and WiFi) adjustable PSU (R…W), for only US$50, affordable for poor hobbyist like me. I am hoping the toy by SfEx to arrive in 2 days, as usual. In the meaning time I will watch EEvblog Dave’s video in PSU design :). Many thanks again for you great tip. Cheers. – tlfong01 yesterday    
  • 1I really recommend Korad KD3005P, it’s a linear power supply so it doesn’t have switching noise in the output, which is nice for analog work. It’s cheap.And it has an isolated USB port which is basically a USB-serial chip, so you can control it with the PC, read back the current, etc. – bobflux yesterday
  • KD3005P sounds interesting. I also need a no-switching-noise PSU for my MOSFET/Tunnel Diode I-V curve plotting project: (1) MOSFET I-V Curve Plotting: electronics.stackexchange.com/questions/552237/…, By the way, I am now reading a TaoBao shop’s catalog on PSU: Koprad KD3005D/P Adjustable and Programmable DC Regulating Power Supply – TaoBao: item.taobao.com/…, Do you have any general comments on their whole range of PSU? (Click the thumb images for details) – tlfong01 yesterday    
  • 1I only own 3005P so no comment on the others. I got two single channel supplies because it was same total price as the bigger 2 channel power supply, but if one breaks down, at least I still have one working lol. The PC interface works well, if you buy one, ask me for the python code. You can update voltage or current about 10 times per second, so you could use it as a (slow) curve tracer. But your MOSFET will heat up faster than that, so measurement would be wrong. – bobflux yesterday
  • Ha, I never owned any bench top PSU, so I always thought they were all single channel Anyway, I browsed the catalog and found that Korad has two series, (1) KA without remote control, (2) KD is smart and has remote (USB, UART) control and programming with storage. So I think me smart guy should own the smart KA series. Furthermore, the other option/variations are (a) 1/ 2/3 channels, (b) 30V/50V, (c) 3A/5A. (d) 90W/ 150W. For my Micky mouse projects using only low voltage, low current, I think your model KA3005P seems optimum for me. / to continue, … – tlfong01 yesterday    
  • /Cont’d, Anyway, I will first evaluate my new toy RD6006-W and only later consider KA3005P. BTW, I found this video EEVblog #315​ – Korad KA3005P Review/FAIL 2002: youtube.com/watch?v=Fya-4mjV4N4, and would watch it later. When the time comes, I would definitely ask for your help on python programming the PSU. Many thanks again. Cheers. – tlfong01 yesterday   
  • Your Youtube video on how to set current limit is very. I watch it now have more confidence to carry on my microstepping exmperiments. I have also watch EEVblog vido on a newer module Rdien RD6006. Now I know that the SMPS’s noise can be as high as 500mVpp. I will be reading EEVblog’s follow up video on how to reduce noise, by using “Capacitance Multiplier” (1) Setting the Current Limit on Pololu Stepper Motor Driver Carriers – Pololu 2015apr14, 282,979 views youtube.com/watch?v=89BHS9hfSUk / to continue, … – tlfong01 17 hours ago    
  • / cont’d, (2) Riden RD6006 CVS/CCS EEVblog #1265​ – $53 360W Lab Bench PSU! – EEVblog, 2019nov, 442,115 views youtube.com/watch?v=0qjLx_HsKUQ (3) EEVBlog #1116​ – How to Remove Power Supply Ripple – 2018aug28, 384,334 views youtube.com/watch?v=wopmEyZKnYo – tlfong01 17 hours ago   
  • So, without further ado, I went to the TaoBao shop to order Korad KD3005P. But then there is big problem. The KD, KA models are not for “foreign” customers including my city. I guess the reason is that domestic TaoBao price is much lower than overseas AliEx, and they don’t want all overseas customers ask their friends to go to where price is low and order for them. Of course I can ask my friend over the border to order for me, but I think that is no fair or ethical. Then I tried UNI-T who have the same remote control digital linear PSU. But then I found UNI-T has same policy. So I gave up. 😦 – tlfong01 15 hours ago   
  • Anyway, watch EEVblog’s video on using “capacitor multiplier” to reduce noise. I found that not impressive or useful for my application, for the following reasons: (1) I have ample space to use big decoupling/bypassing cap, as big as 20,000uF to reduce noise, so no cap multiplier is a must, (2) For my tunnel diode projects, I am using MCP4725 DAC with opAmp + transistor voltage follower as digital control voltage source, and max4172 current sensor with ADC as current value reader. In short, my old solution might be as good or better. – tlfong01 15 hours ago   
  • Anyway, I just tracked my new toy and found that it should cross the border this evening and should arrive the place for me to collect tomorrow. So I would start reading my RD6006-W manual as a preparation to do user acceptance and product evaluation tomorrow. Cheers. – tlfong01 15 hours ago   
  • @tlfong01: Once again, this is not a blog or a forum. Comments are for seeking specific clarification on the question (or answer, as the case may be). If you want to chat then open a chat room. Please stop abusing the site. – Transistor 8 hours ago

Add a comment1

Some steps that you will need to do: Set micro-controller PWM (arduino) to 62500Hz frequency and learn how to change the duty cycle of that PWM wave, connect output of PWM to low pass filter so you get almost DC out and feed that voltage/current into MOSFET or BJT (NPN), you will also need two buttons to control the PWM duty cycle.

You will need an transformer of about 34-36V to get 30V, i do not know any easy available voltage sources with more that 24V (laptop chargers etc), and you better start learning with 12V for start, you will burn a lot of your stuff with higher voltages or even harm your self.

So start with 12V and use BJT transistors then when you get it working you can scale it up latter if needed.ShareCiteEditFollowFlagedited yesterdayVoltage Spike53.7k2727 gold badges5656 silver badges151151 bronze badgesanswered yesterdayjosip11144 bronze badges New contributorAdd a comment-2


How to get started quickly to commercialize a product as specified below?

  1. PSU
  2. Voltage output: 1V ~ 30V
  3. Current: ~ 5A
  4. Power: ~ 50W
  5. MCU controlled


  1. For startup newbies wishing to manufacture products in “The World’s Factory”, I would recommend to start with MIT Innovation Node Hong Kong.
  2. For practice, I would recommend to start with Riden RD6006-W or Korad KD3005P. You can google for other similar models to suit your particular user requirement.
  3. Warning: 90% of new startups fail.


(1) MIT Innovation Node Hong Kong (News 2015)

(2) MIT Innovation Node Hong Kong (Home page 2021)

(3) What Percentage of Startups Fail? (67+ Stats for 2020) – Review 42, 2021feb25

/ to continue, …ShareCiteEditDeleteFlagedited 10 hours agoanswered 11 hours agotlfong011,77611 gold badge66 silver badges1313 bronze badgesAdd a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.