Works on this device
Sensor Voltage Scaling Calculator
A sensor often puts out a voltage range that does not fit the input range of the analog-to-digital converter (ADC) that reads it. This calculator finds the gain and offset that map one range onto the other, a resistor divider that brings a voltage down, and the resistors of an op-amp stage that raises it.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what you want: the gain and offset, a voltage divider, or an amplifier.
- For the gain and offset, enter the sensor output range and the converter input range, for example 0.5 to 4.5 V into 0 to 3.3 V. You can also convert one voltage.
- For a divider, enter the highest sensor voltage, the converter limit and the bottom resistor. For an amplifier, enter the gain and the resistor to ground. Choose a series of standard values.
- Choose Calculate.
The formulas
- Gain = (converter top − converter bottom) ÷ (sensor top − sensor bottom).
- Offset = converter bottom − gain × sensor bottom. Then Vout = gain × Vin + offset, and Vin = (Vout − offset) ÷ gain.
- Divider: Vout = Vin × R2 ÷ (R1 + R2), so R1 = R2 × (Vin max ÷ Vout max − 1). The standard R1 at or above this keeps the output at or below the limit.
- Non-inverting amplifier: gain = 1 + Rf ÷ Rg, so Rf = Rg × (gain − 1). The standard Rf at or below this keeps the gain at or below the one you want.
- Standard values follow the E series of IEC 60063 (E6 to E192).
Worked examples
A 0.5 to 4.5 V sensor into a 0 to 3.3 V converter: gain = 3.3 ÷ 4 = 0.825 and offset = 0 − 0.825 × 0.5 = −0.4125 V. A sensor voltage of 2.5 V becomes 0.825 × 2.5 − 0.4125 = 1.65 V. A plain divider cannot do this, because it needs an offset.
A 0 to 5 V signal into a 3.3 V input with R2 = 10 kΩ: R1 = 10 kΩ × (5 ÷ 3.3 − 1) = 5.15 kΩ. The E24 value 5.1 kΩ would give 3.311 V, a little above the limit, so use 5.6 kΩ, which gives 3.205 V. The converter then sees 3.59 kΩ and the divider draws 0.32 mA.
A 0 to 1 V sensor raised to 3.3 V with Rg = 10 kΩ: Rf = 10 kΩ × 2.3 = 23 kΩ. The E24 value 22 kΩ gives a gain of 3.2 and a top output of 3.2 V.
Limits you should know
- The circuits are ideal: the converter draws no current, the op-amp is perfect, and the resistors are exact. Real parts have a tolerance, so keep a margin below the converter limit.
- A divider only lowers a voltage and adds no offset. A range that must be shifted needs an amplifier with a reference voltage or a second stage.
- Protect a converter input from voltages above its limit; the data sheet gives the absolute maximum ratings.
- This is arithmetic for a design. It is not professional engineering advice.
- To see the resolution that results, use the Sensor Resolution Calculator. For a 4-20 mA signal, use the 4 to 20 Ma Calculator.