4
\$\begingroup\$

I want to measure -30Vdc up to 0Vdc using a microcontroller. I'm basically measuring a voltage source with an output current of upto 2A. I need to bring the voltage up onto a scale of 0V to 5V so that I can use the ADC of my microcontroller. I found two types of solutions to do this.

One with a simple resistive adder as shown below:

schematic

simulate this circuit – Schematic created using CircuitLab

and another with a non inverting summing amplifier:

schematic

simulate this circuit

What I need help with is that I don't understand the specifications for this offset voltage source? Can I use a resistive divider circuit on my 5V power rail to provide this voltage? How do I calculate the current to be provided from this offset voltage source so as to create the divider?

Please help.

\$\endgroup\$
1
\$\begingroup\$

This circuit

schematic

simulate this circuit – Schematic created using CircuitLab

is a resistive level shifter and divider with an output voltage range 2.5V (approximately, see below) to 0V for an input voltage range 0V to -30V respectively. You can solve this circuit using the superposition theorem, for instance. Simply put, it divides the potential between R1 and R2 by 13.

When Vin is -30V, Vout is 0V: the voltage difference between R1+R2 is then 32.5V, which if you divide it by thirteen (R1//R2 = 1 over 12+1) yields 2.5V. That voltage is measured over R2 and makes Vout equal to zero volt. However if Vin is 0V, Vout is slightly under 2.5V: 2.5V - (2.5V / 13) ~= 2.5V - 192mV or 2.31V actually.

If you need a voltage swing up to 5V you need to replace the 2.5V reference with a 5V reference.

When it comes to analogue-to-digital conversion, note that you don't necessarily need to shift voltage levels, for at least two reasons:

  1. Many ADCs have differential inputs, which convert a differential voltage between two inputs, plus and minus Vref. This of course makes sense when measuring negative and positive voltages. It also implies a negative supply voltage to your ADC.

  2. Depending on how you power your ADC, you may very well use the negative line of your voltage input as the ground line for your ADC (or micro-controller) and its power supply. It is possible if the power supply of the A-D converter can float, i.e. if the voltage to be measured has no galvanic connection with the power supply of your ADC.

The latter greatly simplifies the circuitry and keeps the number of input components to a minimum. It also avoids level shifting by performing a relative conversion: just divide the input signal by 6 to have a 0-5V voltage range for your ADC.

You will find relevant responses to a similar question, as pointed to by SunnyBoyNY.

\$\endgroup\$
2
\$\begingroup\$

This is an interesting approach. Not one I've seen used, but I suppose it doesn't come up super-often.

You should divide the high voltage down, then use the Thevenin equivalent resistances to make sure your summing resistances are equal (or understand the conversion factor).

schematic

simulate this circuit – Schematic created using CircuitLab

This takes your -30V signal and divides it by 6. Then you calculate R3 to have an equal impedance to the resistor divider (Just R1 parallel R2) which makes this a 1:1 summing node.

I think this will work. You might want to prototype it though! Oh, and use a rail-to-rail op amp. Otherwise you'll lose some values at the top and bottom.

\$\endgroup\$
1
\$\begingroup\$

the resisive divider (or adder if you want to look at it from a signals perspective) is the simplest solution, and if your're not exceeding both both supply rails there's no need to use a centred reference. you can just use the furthest rail (positive in this case) eg:

This setup will give 4.41V out with 0V in and 0.88V out with -35V in, you can feed that direct to the DAC. (5V out with +5V in, and 0V out with -37.5V in)

schematic

simulate this circuit – Schematic created using CircuitLab

the schottky diode is there to prevent bad stuff from happening if the -35V is connected while the microcontroller is unpowered ans also offers some excess-voltage protection, the type is not critcal I just picked the first one circuitlab offered.

\$\endgroup\$
  • \$\begingroup\$ I'm going to test this one out on a breadboard using a test input of -12Vdc. \$\endgroup\$ – MavenMerkel Dec 23 '15 at 10:47
  • 1
    \$\begingroup\$ Be careful, if R1 falls out, or has a bad connection, you could burn up the microcontroller, \$\endgroup\$ – Jasen Dec 23 '15 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.