I cannot seem to wrap my head around this. I have read about using an instrumentation amplifier, however even then I am not sure how to use this in this scenario. Could someone explain to me how to:

  • Map a voltage range of 0.40-1.87(V) to 0-5V

  • Map a voltage range of X-Y(V) to 0-5V, where X is non-zero

  • 1
    \$\begingroup\$ You need to provide a bit more detail. What is your expectation ? (accuracy,...) \$\endgroup\$
    – Long Pham
    Jul 11, 2018 at 8:28
  • \$\begingroup\$ @LongPham preferably as accurate as possible, I am scaling a potentiometer reading. \$\endgroup\$
    – nyxaria
    Jul 11, 2018 at 9:07
  • 1
    \$\begingroup\$ @nyxaria What's possible partly depends on your constraints, including the monetary ones. ;) \$\endgroup\$ Jul 11, 2018 at 9:16
  • 1
    \$\begingroup\$ "An instrumentation amplifier" Post a schematic with the tool, it looks like you put minimal effort into your question, provide maximum information so we can give you good answers instead of speculation. Thanks \$\endgroup\$
    – Voltage Spike
    Jul 11, 2018 at 16:01

1 Answer 1


The gist of it is basically this:

Let's call the input range (X, Y), the output range (J, K).

Then the 'mapping function' is as follows:

$$ V_{\mathrm{out}} = {V_{\mathrm{in}} - X\over Y-X} \times (K-J)+J $$

You can easily derive it - what the division by the endpoints of one range does is it maps the input to some 0 to 1 range. Then you can 'stretch' it to cover the other range. Then just adjust for the offsets.

The hardware implementation usually follows that pretty well.

First, you get the difference of the input against the reference (\$X\$). Then you amplify it (by the \$K-J \over Y-X\$) and apply the offset \$J\$ if required.

In your case, the \$X\$ and \$Y\$ are 0.40 V and 1.87 V respectively, \$J\$ is 0 V (no output offset relative to ground), and \$K\$ is 5V.

So you just need to implement a thing that does:

$$ V_{\mathrm{out}} = {V_{\mathrm{in}} - 0.40 \mathrm{V} \over 1.87\mathrm{V} - 0.4\mathrm{V}} \times 5\mathrm{V} $$


$$ V_{\mathrm{out}} = (V_{\mathrm{in}} - 0.40 \mathrm{V}) \times {5\mathrm{V} \over 1.87\mathrm{V} - 0.4\mathrm{V}} = (V_{\mathrm{in}} - 0.40 \mathrm{V}) \times 3.4 $$

So. You just need to make a differential amplifier that measures against a 0.4V 'reference', and amplifies stuff by 3.4!

  • \$\begingroup\$ Could you give me an insight as to how I might actually go about doing this on a circuit? :) \$\endgroup\$
    – nyxaria
    Jul 11, 2018 at 9:06
  • \$\begingroup\$ There's this handy calculator for a typical 4-resistor, one-opamp differential amplifier: masteringelectronicsdesign.com/… I've plugged in the numbers you wanted to get, and it should work. However, there is a few things you need to be wary of - be sure the potentiometer's resistance you're measuring is 'small' compared to the input R of the amplifier (so it doesn't skew the results). Getting the 0.4V ref. could be done just with a divider. Since you want an 0 to 5V output, you may need a rail-to-rail output opamp that can work in that range. \$\endgroup\$ Jul 11, 2018 at 9:24
  • 1
    \$\begingroup\$ Good answer. If it had an example schematic showing the voltages, then it would be a perfect reference the many questions like this that show up. \$\endgroup\$
    – JRE
    Jul 11, 2018 at 10:06
  • \$\begingroup\$ @JRE Thanks for the feedback! I'll modify the answer later today to add those things. :) \$\endgroup\$ Jul 11, 2018 at 10:11

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