Arduino controlled bench PSU,digital control, with pictures

Hello builders!
I've seen a lot of arduino based bench psu-s, so i wanted to build one. The main part of this project that is is almost free of charge, with main components I already have.

I plan to post pictures and a summary of the project, as well as asking some questions at the beginning. This project might be interesting for those who aren't involved to serious electrics, and can't build their own super-duper switching supply.

I began heavy planning and building some days ago, but I ran into problems.

My plans are as follows: If you have better ideas, don't hesitate to tell.

-it is based on two 65w notebook power supplies wired in series: exactly 38V (works so far)
-Use an ATX psu as enclosure
-achieve full voltage and current limit adjust with a buck converter, or more buck converter boards in parralel for bigger current.
-Include an arduino pro mini with a 1602 lcd for extended functionality for the future.

Here comes the harder, and the really hard point:
-drive and set the parameters using an arduino

  • include an encoder with few switches to set CC/CV

The software isn't a problem imho, but with the hardware part i have issues

These modules use potentiometers (resistor dividers) to set the desired voltage and current limit.

1st concern:

Current:

Using a 20A ACS712 ebay module it shouldn' be a problem, i have ordered it already. It has 2.5V nullpoint, with 100mV/A feedback. At 10Amperes it is 3.5V, perfect :slight_smile:
The arduino has 10 bit ADC, which translates to roughly 0.005V resolution. A minimum of 0.05A can be measured, not the most precise, but with this part it is more than acceptable.

Voltage:

The input for arduino is maximum 5V, 10bit. If I want to measure the full 35Vscale, i'd need about 6.5:1 resistor divider as a safety margin. 0.1Volt output change will be shown as 0.013V at ADC in, 0.035V output change is measureable.
With precision resistors, it can be done fairly precisely.

My problem: Setting those values!
Many-Many problems. Maybe here is the death of the whole project.

  • From the factory, it is done by small multi-turn trimpots.
    I have a smaller cc-cv buck module, it uses 1kOhm and 10kOhm pots, but i think only the divider is important, the actual resistance isn't.
  1. There are digital potentiometers exist, they are not cheap, but exist.
    The ebay budget one MCP410xx series have a resolution of 256 steps.
    -Theoretically, I have to control 0-35Volts, maybe a little less, but for simplicity it is. 35V/255=0.13V
    This is not the most precise.I t will be a "lab" psu it could be better.
    -A maximum rating of 10A with this 256 steps is 0.04A, that is what we speak about! 1/20th Amps is some kind of precision.
    -The 10bit digital potmeters are quite expensive, and available only in surface mount micro packages.

  2. The digital pots also have a rated current. I heard somewhere that is is about 5mA.
    I looked at the datasheet, and the potmeter is wired parralel to the Voutintthe module. At 35V/10kOhm, the flowing current is 3.5mA, close to the maximum.

So, that is my project goal, I'd e interested what are your thoughts.

siletto:
Hello builders!
I've seen a lot of arduino based bench psu-s, so i wanted to build one. The main part of this project that is is almost free of charge, with main components I already have.

I've been pounding my head against the wall for over a year trying to come up with a good Arduino controlled digital power supply design.

My specs are pretty tough (3 or so volts to 20 volts at 10 amps).

I first tried a pass transistors + LM-317 + ginormous heat sinks design with a digitally controlled pot to set the voltage. This didn't work because the digipot only worked up to 5 volts, which translates into 6.25 volts output (not to mention that the heat sinks contributed substantially to planetary warming trends).

Next I tried the PWM + Op-amp with a gain of 4 to drive the LM-317 (0-5v PWM * 4 gave me 0-20 volts to control the LM-317). This worked fairly well as a breadboard, but the need for a high voltage (at least 24 volt) SINGLE SUPPLY op-amp gave me no end of grief (in the form of smoke and the lids popping off the op-amp if I raised the VCC above 15.

NEXT... I tried a stepper motor coupled to a 10 turn pot inside a software loop so that the stepper would rotate wherever it had to in order to reach the setpoint.

This sorta worked OK also, but I was never able to get the loop to work right. Either it would hunt, or it wouldn't quite reach setpoint. I tried PID control, I tried driving the motor with "actual - setpoint" delta so that it would slow down as it reached setpoint (to avoid overshoot and hunting).

In the end, I abandoned that because of the absurdity of hearing "bzzzzzzzzz" every time I changed the voltage setting.

Next... tried the same thing with a dual H bridge and a DC gearmotor. This was 100 times worse than the stepper. The rotor inertia was so great that I needed a large deadband to avoid hunting, which of course meant it would never quite reach setpoint.

For a while, I said "hell with it" and didn't work on it anymore. Then I found the perfect solution...

The Mean Well SPV-300-24 switching power supply https://www.alliedelec.com/mean-well-usa-spv-300-24/70069620/

This is a switching power supply which has a PFC controller, a voltage adjust input (0-5 volts) and an enable/disable input.

It can crank out 12.5 amps at any voltage setting from around 3 volts up to 24 volts.

The input impedance of the 0-5 volt control input is high enough that you can connect it directly to an Arduino PWM pin with a simple R/C filter to make the PWM into DC (or use an op-amp like I did).

So now, with two connections from the Arduino to the power supply (voltage adjust and on/off) and two inputs (output voltage via a resistive divider and output current via a Pololu current sensor board) plus a vacuum florescent display (for menu and voltage/current/power/graph displays), and an optical encoder with pushbutton to access the menu, I finally have a nice working digital power supply.

Only thing it doesn't do is current limit. I could read the output current and shut off the output if it went above a setpoint, and the supply itself is short-circuit protected, but I can't setup the power supply as a "current source".

But, I have no need for a current course, so I really don't care.

Hope this helps you somewhat.......

P.S. Noticed you are working with an old PC power supply case. ROFLMAO!!! Way too small. You will need lots more room.

Isn't it possible to use a digital pot along with an op-amp to produce the feedback voltage?
I am no expert, may talk with one soon, but in my understanding the buck controller IC needs a VOLTAGE on its feedback pin, from which it calculates how to adjust the output voltage.
The feedback voltage must be lower, or equal to the Vin. I could drive a digital pot with the arduino, then wire an op-amp to the potmeter which makes the 0-5.5v higher.

This is purely speculation, but from what i understand about this could work.

siletto:
Isn't it possible to use a digital pot along with an op-amp to produce the feedback voltage?
I am no expert, may talk with one soon, but in my understanding the buck controller IC needs a VOLTAGE on its feedback pin, from which it calculates how to adjust the output voltage.
The feedback voltage must be lower, or equal to the Vin. I could drive a digital pot with the arduino, then wire an op-amp to the potmeter which makes the 0-5.5v higher.

This is purely speculation, but from what i understand about this could work.

I don't know what your buck controller board needs for voltage control. I would guess that it's a potentiometer inside a feedback loop. Also, you don't know where the adjustment pot is relative to ground... you may end up with bias or offset voltage problems.

If you simply want a digitally controlled voltage, why not use the Arduino PWM, a suitable low pass filter and the op-amp? No digipot needed for that.

Krupski:
I don't know what your buck controller board needs for voltage control. I would guess that it's a potentiometer inside a feedback loop. Also, you don't know where the adjustment pot is relative to ground... you may end up with bias or offset voltage problems.

If you simply want a digitally controlled voltage, why not use the Arduino PWM, a suitable low pass filter and the op-amp? No digipot needed for that.

The board i wll use is on the way, but i have an LM2596 board with i experiment, and i can tell you it is WORKING ;D ;D

It uses 10kOhm trimpot to set the output voltage. The wiper and an output is wired togetger, so it is simply a variable resistor. The multimeter showed ~1.25V difference between the voltage drop on the pot and output. Instead of the pot i tried a 3.5V li-ion battery, and a 12.7V lead :smiley: battery, and all works fine. +1.25V output, as long as it is some volts under the Vin.

Idk if it is a huge invention, or everyone else have known this, but as i see, I can control the output voltage of the buck module simply with a voltage source. As you said, a pwm output and a low pass filter+op-amp might do the trick, or a digital pot+op-amp.

The reason i try to use these buck modules that they are cheap, quite stable and reliable, and the main part is you don't have to mess with resistors, transistors and other small parts which needs quite a knowledge to use them correctly.

Well, The op-amp method didn't work. It IS possible to make it, but not easy.
The problem is , it is working great from a voltage source, as long as you dont load it. With a load on it, it fails to keep up with it, as the feedback is independent from the actual Vout. A circuit with a comparator, capacitors and maybe more digital pieces would do the trick, but I will stay with multi-turn pot and arduino measuring for now, maybe upgrade later.
Some new pics:


Well, there isn't much room, but it is enough :smiley: