Electronic – Reading and writing analog voltages to two outputs of a lab bench supply from one microcontroller

current measurementisolationmicrocontrollerpower supplyvoltage measurement

I am planning on building my own lab bench power supply which should be software controlled and have two outputs. I am considering using the ATMega2560 due to its large amount of I/O pins, but I don't know how to read/write analog voltages to/from the two outputs. I think that they need to be isolated if I wan't to hook them up in parallel for more current which means that I can't just connect them both directly to the microcontroller.

Am I right or can the two outputs share the negative ground rail and just have the positive rails regulated?

If they need to be isolated, how would I go about reading and writing analog voltages to them (setting and measuring output voltage/current)?

Best Answer

I would recommend that you isolate the digital control input from the logic in your power supply. This way you will be able to series or parallel connect the PSUs. It will add some complexity but prevent any surprises on your controller or laptop USB port should it be connected.

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. A pair of opto-isolators allows complete separation of all circuit grounds.

Just watch your PWM frequency and how the opto-isolators will respond at that frequency. Some will have a slower turn-off time than turn on so the pulse widths may be wider on the receiver than on your transmitter. Check the datasheets.