Continue to Site

# Differential amp to measure 0-30V DC in power supply

Status
Not open for further replies.

#### aramosfet

##### Junior Member level 2
Hi
I need to measure DC voltage 0-30V on a microcontroller and display the same. Since we need to measure a large voltage I made a differential amplifier to measure input voltage and added a NFET switched voltage divider at input to measure higher voltages. the switch will be off at lower voltage to get better resolution.

However , the problem with above circuit is the effective impedance at non-inverting input of opamp when the FET switch is off is 200K, Hence the differential amp does not work properly.

So I tried to isolate V+ input by inserting an unity gain opamp that takes Vdiv and feeds the differential amplifier. Here, if the input voltage can exceed opamp supply voltage (4.096V) if the switch is off. To protect opamp input I added a Schottky diode (1N5818) from Vdiv to VCC, But the the problem with this was, the reverse leakage from diode increases the voltage at Vdiv point.

What is the best way to design a differential amplifier wot measure inputs greater than supply range?

Thanks

Hi,

O the bottom left there is a 0.47R shunt. Your voltage measurement refers to the right side of the resistor.
Must this be the reference point of your voltage measurement? Is it possible to reference to GND, or does this introduce to high error?

You have two input ranges. Please specify them (min, max).
What accuracy do you expect?

Why 4.096V? This rather is a Reference voltage than a supply voltage. Please don't mix them if you want good precision.
What is the ADC input voltage range, and it's supply voltage?
***
The opamp output will not go down to 0V.

Klaus

Things are essentailly simple. If you want a differential amplifier with selectable attenuation, you'll use a symmetrical voltage divider, involving either a floating switch (relay, optomos) or two ground referred analog switches.

Hi,

O the bottom left there is a 0.47R shunt. Your voltage measurement refers to the right side of the resistor.
Must this be the reference point of your voltage measurement? Is it possible to reference to GND, or does this introduce to high error?

You have two input ranges. Please specify them (min, max).
What accuracy do you expect?

Why 4.096V? This rather is a Reference voltage than a supply voltage. Please don't mix them if you want good precision.
What is the ADC input voltage range, and it's supply voltage?
***
The opamp output will not go down to 0V.

Klaus

Yes, The error can be large if the current is high upto 2A. This will have an error of ~1V due to shunt resistor. There's also a current sense amp not shown here. If the ground reference is moved to V-, current sense voltage will be negative, and I only have a single positive supply.

The V+/V- differential can vary from 0-28V.

The ADC is the 10bit ADC on AVR microcontroller. I have used 4.096 (set by LM317 regulator) as supply voltage so that it can also be used as Vref for ADC. I'm ok with the output of the opamp only swinging to ~2.5V (Not an issue for current sense opamp 0-2A). I can use the voltage divider switch to measure above 2.5V for V+/V- differential voltage.

I'm able to achieve an accuracy of +/- 10mv which is fine since my display is 3 digits. So 10mV for 0-2.5V and 100mV above 2.5V.
Thanks,

When the Mosfet is off, the non-inverting input ratio becomes unbalanced, you have to re-establish the ratio on the other input as well.

Also....Why use an opamp which is not rail to rail? You already mentioned that you don't care about voltages above 2.5v, but this opamp will not swing to zero volts either. Use a proper RR opamp.

Hi,

Most AVRs have multiple ADC inputs, so e with gain stage, some even with differential measurement.
So are you sure you need external amplifier at all?

If no differential conversion is possible, then you could do the math in software.

****
I'm no friends of using V C as reference, it often is not that stable with respect to load current, temperature and time..
Using a standard 5V supply and a true 4.096 ( or any other ) reference is more precise and reliable.

As soon as you use a multiply function in software there is no need for a special "4.096V" reference.
Multiplying with any other factor takes the same processing time and involves the same error.
****

If you want to measure really down to zero, I recommend to add some mV offset on the analog side, best if generated from ADC Vref.
Then in software you can subtract the same value digitally. This ensures that the Opamp never saturates at the lower level.
****
Using only 2.5V with the 4.096V Ref leaves about 40% of the ADC range unused. Another argument to use 5V supply and 4V input range.

Klaus

Status
Not open for further replies.