Digitally-Controlled Linear Power Supply Based on STM32 – Classic Design - Page 1
Forum section: electronics / projects

author: iskel
author_rank: Newbie
timestamp: June 14, 2025, 04:46:13 pm
content: Hi all,I’d like to share with you a project I recently completed – a digitally-controlled linear power supply built around the STM32F030CCT6 microcontroller.The power stage uses a classic analog linear regulator topology, known for its simplicity, reliability, and low output noise. To bring it into the modern age, I’ve added:🔹 Digital control and monitoring using STM32F030CCT6🔹 LCD display with rotary encoder for local control🔹 Remote control via I²C interface🔹 Possibility to link and control multiple units in coordination🔹 Fully open source – schematics, firmware, and documentation availableThis is a well-working and stable design, ideal for home-built lab power supplies. It’s intended for electronics hobbyists who want a practical, reproducible, and expandable project that combines classic analog performance with basic digital control features.🔗 Project page:https://www.stm32dds.tk/stm32-psu- A link to Telegram is provided at the bottom of the page.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 15, 2025, 08:07:06 pm
content: As it happened, I found your website about a week ago and I really liked this article. Both the idea of reusing the existing (and extremely cheap) kit, mentioning of the magazine with the original projecthttps://worldradiohistory.com/UK/Practical-Electronics/70s/Practical-Electronics-1978-10.pdfand the thorough writeup and sharing the sourcecode on a git site.I'm still struggling with getting STM32 to work on a real project (I've done some blinking LED projects) and this is a project I may build at some time in the future, just to get some more experience with a real STM32 project. (I'll put it in a "Black Pill a.k.a. STM32F411CEU).I am also curious about your Lattice DDS project. <url>https://www.stm32dds.tk/stm32-ddslatt</url> Have you looked at what others have already done? There are several DDS projects with ICE40 on github.https://html.duckduckgo.com/html?q=site%3Agithub.com+ice40+dds

author: iskel
author_rank: Newbie
timestamp: June 16, 2025, 03:50:45 pm
content: Hello, thank you for your interest in my site, and also for the useful information you provide me (in connection with my future project). Yes, I am aware that there are many implementations of this platform - STM32 + FPGA. My idea is not to rediscover "hot water", but simply to pack it in a suitable package and "sell" it to you for free :-)

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 31, 2025, 03:53:54 pm
content: On you website you write:Code:These days I was reading a rather interesting article on the issue of carbon resistors,which by painting them blue, the Chinese comrades are pushing us to consider metal-filmresistors - this is not relevant for our project, but anyone who is interested in how to recognizethem (I suggest - by their temperature coefficient) can search and read on the internetBut I don't agree with this. You are using 10-bit R-2R networks for your DAC, and these need quite accurate resistors, and the carbon resistors normally have a 5% tolerance (some are indeed sold as 1%, but out of spec and indeed also a bad TCR) For 10 bit, you need approximately 0.1% tolerance (or hand sorted) resistors, and you do need quite accurate (metal film) resistors.I also find your choice of using THT for everything except the uC curious. Personally I find SMT resistors and capacitors (down to 0603 size) easier to use then THT. You don't have to bend and cut wires, you don't have to turn the PCB around all the time. And on the PCB, there are no drilled holes and you have the back side available for either a good GND plane or for routing some tracks. Especially when you go to 4 or more layers, the extra PCB space becomes significant. (Also, for 100+ PCB's, the price difference between 2 or 4 layer PCB's becomes quite small, even though 4-layer prototypes are still relatively expensive).Still curious about your DDS interests...I just found the AD9102. It's a dedicated DDS IC with 4k*14bit RAM and built in DAC. and costs USD 24 (10+).A nice DAC alone costs over USD 12 (12 bit <35ns settling time).R-2R based DAC is possible, and also used in function generators such as the JDS6600 but they need pretty good quality resistors for some decent accuracy. For 10 bit accuracy, your resistors need <0.1% accuracy and stability. (Or at least a few of the most significant bits). For DIY, manual sorting is a good option.An interesting idea is to use an R-2.01R network, as presented in the thread below.https://www.eevblog.com/forum/metrology/digital-null-meter-design/This would also require individual calibration, and then re-compilation of the FPGA code for each device.When considering cost (I.e, a commercial design) FPGA + DAC is already getting close to the cost of the AD9102 (maybe there are similar but less powerful and cheaper DDS IC's).

author: iskel
author_rank: Newbie
timestamp: August 05, 2025, 09:55:18 am
content: Hello Doctorandus_P, thank you for the quality comments and sorry for the late reply. I don't follow this forum regularly. The answers in short:1. The accuracy of the resistors in R-2R: they are not part of the set I buy from Aliexpress. They are metal-film, with a tolerance of 1% and I buy them from a local store (comet.bg) with a proven reputation. This accuracy, as you mention, is on the limit for a 10-digit resistor ladder, but this will be valid if we always want to output an exact value - for example, if we type it from a keyboard and develop an ultra-precise device. In our case, the inaccuracy of the resistors affects specific values - understand the unevenness in the height of the steps in the output signal. There is an oscillogram published on the site where you can see this. And yes, if I were to generate audio or video or any other form-precise signal - I wouldn't use such a solution2. THT? - is it convenient for you, and for all the others who are taking their first steps in this field, is it so? (well, they often don't have anything else besides a soldering iron and a multimeter from the nearby supermarket - that's why I suggested they take the processor to be soldered to the nearby GSM service)3. AD9102? - 180MSPS - not bad, but with 16 bits from the FPGA chip I'm hoping for 250. Plus, to tickle my old ego with VHDL programming

author: iskel
author_rank: Newbie
timestamp: August 06, 2025, 10:10:46 am
content: To be honest, this is the first time I've heard of R-2.01R (no wonder, I've never done any nanovolt measurements). I read everything in the discussion, drew my own conclusions, and to be absolutely sure, I asked the AI:......and which circuit is better if we want to generate a signal via DDS?And the answer was:Quote

author: iskel
author_rank: Newbie
timestamp: August 25, 2025, 03:31:44 pm
content: A few days ago I officially finished working on the project and started the next one:https://www.stm32dds.tk/stm32-ddslattMeanwhile, as part of the preliminary preparation for it, I made a resistor selection form with the help of artificial intelligence:Why?: Very often in experimental prototyping it is necessary to assemble R-2R DACs with separate individual resistors.Problem?: Assembling a 9-bit DAC usually does not cause a problem with the provision of components, since resistors with an accuracy of 0.1% are sufficient for it, and what if we want more digits? With more digits, resistors with a much higher accuracy are needed. Their prices and delivery times are sometimes unacceptable. A possible solution is the manual selection of each pair of connected resistors. In other words, the condition R=2R does not need to be fulfilled for the entire ladder, but for each specific pair forming the voltage for the corresponding bit.Solution: First, we need to know the required accuracy of the resistors for each bit. Then we need a table in which, by filling in a specific measured value R, we can obtain the possible range for 2R for the specific bit for which we are selecting the pair - or vice versa from 2R to obtain for R. We want this in a single HTML file - so that there is no need for installation, it is easily portable, and it can be run offline in a browser. We explain all this to the artificial intelligence and get the solution....The result:https://stm32dds.tk/data/files/dac_resistor_matching_form.htmlNote 1: For those of you who want to use the tool offline, after opening the table in the browser they should find something like "Download page" or "Save as file" or something similar and a file named "dac_resistor_matching_form.html" will appear somewhere on their device (according to the specific system settings)Note 2: While writing these lines I had not even thought that this would work on every device and operating system :-)