Power supply project - part 2

It still contains two power supplies, one is 0-17V, the other one 7-25V. Unfortunately the input voltage is limited to 19V, which means the maximum output is lower than that. I would probably dump the transformer and put a 24V/2A HP printer power supply instead.

The additions are two sets of binding posts and a power switch, better noise handling (star ground) and a new firmware.

The top LCD display shows the voltage and current for the first power supply, with a nice 'clock' graph for the voltage and a thick horizontal bar graph for the current.
This is duplicated for the second supply.
The microcontroller also has a graph mode that can display any value over time, auto-scaled. Since the button to access that is on the back of the board I don't use it very often.

I would not tackle this project again without a real circuit board as the mess of wires makes it really hard to keep track of everything. Because of the continuously changing requirements I kept adding features that were not part of the initial plan:

Luckily I have had no loose connections, but did get into noise issues. Also, the thin wires meant that a lot of voltage is dropped when there are consumption peaks.

All the high-current paths are done with moderately gauged wires.

In the photo above everything is loose but now everything has been tied and grouped together, some wires were also twisted to reduce common noise.

Current sensing

I ditched the 0.36 ohm resistors for sensing current (two of them in parallel) as they required a lot of calibration, modified their values over time, had little precision and low precision.
Instead, I purchased two ACS712 modules over ebay for around 3$ each. These output a value centered over 2.5V which changes with 185mV/A. This means that their output value can increase when current flows one way and decreases when it goes the other way.
Since the Stellaris is limited to 3.3V, I chose to measure current supplied the 'wrong' way around, otherwise I would have been limited to (3.3-2.5)/0.185 = 4.324A. With this reversal I now get a measuring range of -4.32A to +17.83A.

Even with these modules I got a lot of noise, 200mV translates to 1.08A variance in reading:

These were ultimately traced to several ground loops that I inadvertently introduced while working without a clear block diagram.

One last picture of the mess, the blue module on the left is the ACS712, the red one on the right is the Stellaris Launchpad. Just behind the black binding post is the LM2596 supply.

Code

This is not production code. I would have moved some buttons to the front to allow calibration, made the backlight adjustable and move the microUSB connector outside the case to allow for easier programming. However it does the job and I don't intend adding more features.

Features that I wanted to have but dropped them:

Current and voltage protection modes

Have the uC disable the PSU which goes over a set threshold. Both supplies have disable pins which are really easy to use. Unfortunately I have to spend a lot of time adding either some potentiometers to set a value or rotary encoders. Also the screen layout needs to be changed to accommodate the new features.
Even then, the protection would only work when the uC has time to handle the task, which can mean from microseconds to milliseconds of delay.
Easier to do with a few comparators.

Remote control and readout

I've managed to get the nRF24L01 modules to work really well with the Launchpad and send/receive that to/from a Raspberry PI. However the real issue is writing the server-side code - mainly the design and coding part.

Source

This is not meant to be reused, but you might find some useful tricks:

Conclusion

I believe in modules that do one thing and one thing well. This supply already has a lot of extra features built-in and even then it's not how I would have liked it to work.
I would probably start with a different setup, design a circuit board with known parts. It should have one display for each module with it's own separate controller and LCD.
The modules I'm thinking of:
- digitally-controlled PSU with CC and CV modes plus protection. 0-30V/0-5A
- electronic load - 0-5A
- signal generator
- multiplexer - is able to switch input/outputs from the above modules via a relay. For example charge a battery from the PSU and discharge it from the load, using the same set of terminals.

That being said, I've had some moderate fun building this as I've ran into all possible issues.