Voltage and Current sensing

I am working on a programmable power supply project that has a 15V 30A switch supply and the output voltage would be regulated with a series pass mosfet. I've got some problems figuring out how to sense voltage and current. And I am using an Arduino for controlling everything.

For voltage sense I was thinking to use three voltage dividers (for three ranges: 0-5, 0-10 and 0-15) and switch them with mosfets. Then I would use a 16 Bit ADC rather than the 10 Bit ADC built in the Arduino... Is that an accurate way to sense voltage and what tolerances would the resistors need to have?

For the current sense on the other hand I've got more trouble. I was thinking a current shunt but then I don't know how to amplify that voltage over the shunt. Are there any ICs pre-built for this application? And what resistance should the shunt have?

• For current sensing, consider using one of the ACS parts. For example ACS712 or ACS711. These provide adequate isolation from the high-side voltage and use Hall effect plus sophisticated internal circuitry to provide an output voltage proportional to current. There is a whole family of parts available. Oct 2, 2016 at 16:38

High side current shunt IC's exist. Otherwise DIY current shunts drop only 50mV at full current to limit Pd in the shunt and require high gain. This could be done on either ground or supply side as the drop is negligible.

The biggest problem is using a series pass regulator for a 450W supply will dump half of this in the series pass at half Vmax out at max current.

Thus a Buck regulator is the only efficient solution, which is well documented everywhere.

I was thinking to use three voltage dividers (for three ranges: 0-5, 0-10 and 0-15) and switch them with mosfets. Then I would use a 16 Bit ADC rather than the 10 Bit ADC built in the Arduino...

Switching between dividers is probably not necessary, given you are using a 16-bit ADC. Switching from a 0-5 range to a 0-15 range only gives you the equivalent of about 1.6 more bits of resolution. And it will also degrade the accuracy of the measurement somewhat due to the on-resistance of the switch.

A 16-bit ADC with 15 V full-scale range (after pre-scaling) gives 0.2 mV resolution. Do you really need better than that?

Is that an accurate way to sense voltage and what tolerances would the resistors need to have?

This really depends what accuracy you want for the whole system. Since you chose a 16-bit ADC, I'll assume you want close to 16-bit accuracy.

To give 16-bit accuracy without calibration, you'd need resistor tolerance better than than $1/65,536$ or about 15 parts per million. (Actually you want about 2x better than this because of the way the errors for the two resistors add up in the voltage divider configuration---there's an app note from TI that goes into more detail)

With calibration, you're more interested in how the resistor values vary with temperature, and particularly how well the two resistors in the divider track each other (maintain the same ratio) over temperature.

You will find it requires quite careful design to achieve 16-bit accuracy. For example, you'll also need to account for leakage currents due to contaminants on the circuit board surface. Resistor value drift due to mechanical stress, resistor value drift due to applied voltage, etc.