This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] Voltage scaling for almost any application (single ended)

The technical article “Three ways to scale an analog input” only covered options for non-inverting and attenuating voltage scaling. Is there a voltage scaling solution for any single ended input range to a desired output range?

  • The technical article “Three ways to scale an analog input” is a whimsical solution that addresses basic skills and steps for a specific case of a non-inverting and attenuating circuit.  An op amp was helpful but was not required.

    2112.Voltage Scaler Calculator(1.02).xlsx

    This Excel calculator can find a solution for most voltage scaling needs. The calculator requires an input voltage range, desired output voltage range and a reference voltage. For non-inverting scaling, the op amp common mode range is also required. The FAQ and calculator have separate paragraphs and tabs for inverting and non-inverting scaling. The Excel calculator allows typing over any cell.  So always start with the original file. The yellow cells are prefilled with constants that can be overwritten to match the scaling requirements. The light blue cells are prefilled with calculated results that can be overwritten with standard resistor values; this will remove the pre-existing formula. Standard value tables are located in the final tab in the calculator spreadsheet. I suggest printing this sheet for easy reference. The summary result values update with any changes to the summary parameter values.

    Note that negative resistance values mean the circuit is currently not viable. However ##### or ##### (in red) means a resistor is open or ‘do not populate’.

    Inverting scaling for most VIN and VOUT ranges

    Inverting circuits will have the lowest (least positive) output voltage when the highest (most positive) input voltage is present. Inverting circuits directly convert the input voltage range to an output voltage range mirrored through the fixed input common mode voltage (VCM). This mirror occurs when the op amp is powered and the output voltage is within the output range of the op amp, VOL to VOH. When the op amp is powered off or when the input signal exceeds its expected range, the inverting input’s voltage may exceed the input voltage range specification. This can create phase inversion in some op amps.

    Figure 1 has all the components needed for most linear, inverting voltage-scaling tasks. The schematic is a super set of the two cookbook inverting amplifier circuits: the Inverting op amp with inverting positive reference voltage circuit and the Inverting op amp with non-inverting positive reference voltage circuit

    Figure 1, Full inverting scalar circuit.

    The “Inverting Calculator” tab in the ‘Voltage Scaling Calculator’ spreadsheet has formulas to find solutions for different inverting voltage scaling needs. Enter your input and desired output voltage range. Enter the voltage of an available and accurate voltage reference (VREF). If a reference voltage is not available, then use the op amp’s power supply voltage.

    Now move from the “User Inputs” section to the “Circuit Configuration” section.  In most cases a valid solution will be instantly ready in the “Summary for circuit values” table. The suggested solution chooses the VCM voltage that makes VREF and resistor ‘RH’ unnecessary. If this VCM is incompatible with the op amp’s input common mode range, then manually enter a compatible VCM value. If RH is ###### (red or black), then RH is ‘do not populate’ and VREF is not used. If any resistors are negative, then VREF voltage or VCM must be changed. The ‘User input errors’ table is helpful for catching common errors.

    If VCM needs to be generated from a higher voltage of the same polarity, it is recommended to use Analog Engineer's Calculator’s ‘Passive: Find Voltage Divider’ tool to find the best pair of standard resistor values for components A and B.  However, the excel calculator will pick an exact value for resistor B based on user input for resistor A. Set resistor A and B to a final standard values before changing RH or RI to a standard values. If RH is a very high positive or negative resistance value, replace it with 1e15 to make it do not populate.  Verify the nominal VOUT summary result is acceptable.

    Non-Inverting scaling for almost any VIN and VOUT range

    Non-inverting circuits will have the highest (most positive) output voltage when the highest (most positive) input voltage is present. All non-inverting solutions are calculated in in two steps. First, the input range must be attenuated to a valid op amp common mode voltage range, VCM. Then the op amp amplifies the VCM range to the output voltage range, which must be within the output voltage range of the op amp (VOL to VOH).

    Figure 2 has all the components needed for most linear non-inverting scaling tasks. In many cases this circuit can be simplified to use fewer passive components. The schematic is a super set of the two cookbook inverting amplifier circuits, the Non-inverting op Amp with inverting positive reference voltage circuit & the Non-inverting op amp with non-inverting positive reference voltage  circuit.


    Figure 2, Flexible non-inverting scalar circuit.

    The scaling amplifier circuit has two independent stages which provide a lot of control, leading to one or multiple viable solutions. Generally, the lowest resistor count is preferred. Having a lower gain for the amplifier stage is better for accuracy. However, the input common mode range must not exceed the op amp’s limits.

    The “Non-inverting Calculator” tab in the ‘Voltage Scaling Calculator’ spreadsheet has six sets of formulas to find one or multiple solutions for different non-inverting voltage scaling needs. In the “User Inputs” section, enter your input voltage range and desired output voltage range. Enter the minimum and maximum valid VCM for the op amp that will be used.  Note that this range should correspond to the “Input Common Mode Range” specification in the op amp’s data sheet.  Enter the voltage of an available and accurate voltage reference for the “Reference Voltage” entry. If a reference voltage is not available, then use the op amp’s power supply voltage.

    The ‘Quick Result’ table gives a summary of which circuits have a valid solution for the given inputs. The ‘Op Gain’ value is the op amp gain. If there are multiple working solutions, the lowest number is preferred. Scroll down to a working circuit. The pre-work section’s yellow and blues cells can be changed as desired. Similarly, the summary table’s blue cells can be changed to standard resistor table values. The ‘summary result’ section updates VCM and VOUT cells based on the changes. Verify that the VOUT range matches the desired results. 

  • More details about calculation and solutions

    Just under the ‘User Inputs’ section there is the gain and offset calculation, “G” & “Z”, based on the input and output ranges. These terms form the linear equation for VOUT based on VIN. Clearly, the polarity of the gain must be negative for inverting solutions and positive for non-inverting solutions.

    The summary tables have a grey work value called (k), which is the feedback gain of the op amp. Be sure to check that (k) or (k+1) is relatively close to the absolute value of the total gain (G). Solutions where k >> |G| will be less accurate because there is too much signal attenuation on the input, therefore the op amp will amplify more to compensate.

    The excel calculator generates exact values. The values can be rounded to the closest real standard value. As an alternative, the Analog Engineer’s Calculator “Passive Find Combo” tool can pick the two standard resistor values that can be combined to more closely match the exact value calculated.

    The calculator only provides a nominal DC linear solution. It neither considers AC performance nor does it evaluate resistor tolerance and op amp input offset voltage. Non-inverting circuit 1 does not require resistor A. However the resistor helps to protect the input when it is connected to a low impedance node or an external connector.

    Non-inverting circuits 3, 4, and 5 have flexible ratios for first and second stages. Therefore, one ratio is firmly set with standard resistor values in the pre-work (blue section) before the other stage is calculated and later changed to standard resistor values in the summary sections (green sections). This two-step process is good for accuracy as just one resistor value needs to be rounded. Circuit 6 is the same schematic as circuit 5, but the method used in circuit 6 is different.

    The ‘3 Resistor Calculator’ tab is a stand-alone passive solution that is useful for non-inverting and attenuating scaling. This is used for circuit 3 and the “Three ways to scale an analog input” article.

    The ‘Reverse Thevenin’ tab is a stand-alone passive solution to find the exact resistors needed to reduce a reference voltage to a specific voltage of specific impedance.