I'm trying to design and build an external ATX power supply adapter, much like this one. I want to use it as a benchtop power supply. I wanted my adapter to have one more feature: I wanted it to have a voltmeter and an ammeter at each positive rail (+12V and +5V). I'm planning on having an ATmega328P do the voltage readings and display them in a common 16x2 LCD.
Here's where my problems begin. I'm having trouble designing the ammeters. My first attempt at it was the schematics below.
The idea behind the schematics is that I'll read voltages in ports
A2 to determine voltages of
+5V rails, respectively, using ATmega328P ADC. There I would have my voltmeters, no problem. The voltage dividers in each circuit are there to bring voltages to the ADC's 5V limit.
To determine currents for the
+5V rails, I would calculate the differences
A1 - A0 and
A3 - A2, assuming I'll be using 0R1 (0.1 ohm) 5W shunt resistors.
The shunts I'm planning to use yield 100mV/A. I plan on making readings well below 7A to respect the 5W spec on the resistors.
The problem is that I'm not comfortable having to make two readings to get the currents. I would much rather have the shunt connected to ground and then make a single voltage reading at its other end using the ATmega's 1.1V internal analog reference. That would give me the accuracy I want, all the way to about 6A. But then I don't know how to design such circuit so that all current that goes to each rail gets measured.
So, my question is: Is this design going to work? I'm afraid I won't have enough accuracy, especially because I'm depending on two readings to calculate current. Will the stacked up errors be too much?
Another related question: is there a better way to measure the current of each rail?