DIY OpenDPS Power Supply

Years ago I heard about the OpenDPS project to give open source firmware to cheap and available chinese power supplies. These aren’t strictly whole power supplies, they are configurable CC and CV buck converters. That means that it needs a stable DC source to back it to be used as a bench power supply. Perhaps you may not want to do this if you intend to use the DPS as a battery charger run from a solar supply or something, but most people I see want to use them for bench supplies so that requires an existing DC supply. Today I finally finished mine.

I chose to start with the DPS3215 meaning it’s capable of 32v output at 15a max. The sheet that came with it said to give it 36-40v as an input so I got myself a 36v 11a switching power supply for about $25. I cranked the fine tuning pot all the way up and now it’s a 38.something supply, but I’m regulating it later so who cares. Now that power supply had a 12v fan inside hooked up to some sort of thermal or load dependent fan speed controller. Since I’m putting this whole thing in a bigger enclosure I took the opportunity to remove the fan from this aluminum box, chop the connector off it, attach a slightly bigger fan, and bolt it to the inside of my new power supply enclosure. I also punched a big open hole in the side of the power supply so we can get some more airflow, no need to protect from fingers now.

one input hole, one exhaust (no fan)

I happen to have a couple greenlee punches, tools for cutting a really nice crisp circular hole. The trouble is they only go up to 2″, and my fans need a lot more than that to get decent airflow. The method I used here was to lay the fan grill on the enclosure and use a scribe to trace one of the circular lines (although I didn’t use the largest one). Then I step drilled out a big enough hole and followed up with the good old jigsaw with a metal cutting blade. It’s not a super pretty cut, but it works very well. Cutting rectangular and trapezoidal holes for the front panel and power jack were also pretty easy using that method, and the rest are just drilled out to size. The power supply had tapped holes in it to bolt through and the banana jacks/binding posts are all EXACTLY 0.75″ center to center. I added an earth ground and couldn’t decide where it should go relative to the other two so I made it an equilateral triangle.

I had a solder bridge under the plastic standoff

Flashing this power supply gave me some trouble, it’s not explicitly called out as compatible so I did some tracing and after clearing all solder bridges I determined that from left to right V = Vdd (power), <no marking> = no connect, S = VSS (gnd), C = Clock, D = Data for the st-link programmer. That worked great. The other header for serial is labeled correctly with tx, gnd, and rx.

Some notes about flashing/building the firmware for the DPS3215 specifically:

The script is specifically python3, it doesn’t seem to be called out anywhere as that so I changed the first line to force it to use python3.

This power supply is subject to the this issue and needs a different chip select defines when compiling, so treat it like a DPS5015.

I had an issue with currents over 9.99A (the number of digits was fixed, it rolled around to zero). That’s apparently a variable that can be set at compile time but the functions for CC mode, CV mode, and CL mode needed to be tweaked to accept those values and not just be stuck at 2 digits and 2 decimals. You can see in this header file you’re supposed to be able to set all these things dynamically, but the functions above in this revision of code don’t use them. You will also see the max current, I set mine to 10A, it could probably go higher but that seemed enough.

Calibration Report:

A_ADC_K = 4.377185344696045

A_ADC_C = -260.4835205078125

A_DAC_K = 0.25430262088775635

A_DAC_C = 263.3804931640625

V_ADC_K = 8.133505821228027

V_ADC_C = -109.9773178100586

V_DAC_K = 0.1118573322892189

V_DAC_C = 8.37867546081543

VIN_ADC_K = 16.66666603088379

VIN_ADC_C = 118.33333587646484

VIN_ADC = 2305





calibration report for my unit, you may want to do your own

Unfortunately the calibration report put out by the python script cannot be fed back into the python script as it outputs with spaces around the equals sign and the script only accepts parameters with no spaces around the equals sign.

That’s it, I now have a working power supply neatly packaged. I wouldn’t say it’s the easiest thing in the world to flash and there seem to be some things that have been identified but need cleanup in the master branch on github (but at least they acknowledge them in the issues section so you can find them yourself. I never actually found out how you’re supposed to specify model and the compiler will pick based on options you set, I just hacked up the code so they were all what I wanted for my supply. Not ideal, could use some cleanup, but I made it work.

2 Responses to “DIY OpenDPS Power Supply”

  1. DIY OpenDPS power supply – gStore Says:

    […] Evan’s DIY OpenDPS power supply: […]

  2. Tercio Gaudencio Filho Says:

    Where did you buy your DPS3215? Thanks!

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: