I'm using a controller that needs a 0 to +5V input to activate an actuator on the output side. Normally, a potentiometer of 10k is used to delver 0-5V on the input (left drawing).
For my application, I need to control it with a sensor that acts as a variable resistor and has a range of 1.3k - 2.3k (right drawing).
So I need a thing in the middle ("X") that will deliver as close as possible to 0-5V on the input depending the sensor's resistance. I tried to work out how a DC amplifier for this would look like, but without success. Your help would be appreciated.

- 13
- 4
2 Answers
If you want to do this with an analog circuit you need to look at the math involved.
You want to get a voltage from the variable resistor whose resistance varies from 1.3k to 2.5k. You can use a voltage divider to do this. If you make the other leg of the divider 2.5k using an input of 5V you get an output voltage range of:
$$ 5V \cdot\frac{1300\Omega}{1300\Omega+2500\Omega}= 1.7105V$$ to $$ 5V \cdot\frac{2500\Omega}{2500\Omega+2500\Omega}= 2.5V$$
Now you need to scale this to 0 V to 5 V. So start by subtracting the lower range voltage. $$ 1.7105 V - 1.7105V = 0 V $$ $$ 2.5 V - 1.7105V = 0.7895 V $$
This gets the lower limit of 0 V, now you need to get the upper limit so you need to multiply by some factor. $$ \frac{5 V}{0.7895 V} = 6.333 $$
Now you need a circuit to do the math, you can do this with opamps. You'll need a 1.7105 V reference to be subtracted from your sensor output, this can be had with a divider using the high and low values of your sensor resistance, 2.5k and 1.3k. Then you need a summing amplifier with gain of 6.333.
Here's a circuit I threw together in LTspice as an example. R2 is the sensor.
The time scale at the bottom is the resistance of the sensor in kilohms.
This is just a basic example to demonstrate the idea and could probably be improved upon.
You need to use single supply rail-to-rail opamps if you only have the 5 V supply available, and since your output is going to be right up to the rails it's going to suffer a bit at the extremes. A higher supply voltage, and preferably a dual polarity supply would help with this.
A digital alternative to this might be to use a micro with an ADC and DAC to read the voltage from the divider, use software to scale it, and output the result through the DAC.

- 17,628
- 1
- 16
- 45
-
Hi! Thanks for this. This simulation looks great. The LT1677 is a bit of an odd beast and is not supported in CircuitLab, so I can't get it verified. LTspice is way over my head. Any alternatives for the LT1677? – MarcC Oct 20 '22 at 10:04
-
@MarcC See if circuitlab has any single supply rail to rail opamps. I just picked one ltspice had. Like I said, if you can get better supply voltages the opamp choice becomes less critical. – GodJihyo Oct 20 '22 at 11:11
-
Works perfectly. – MarcC Nov 02 '22 at 08:16
-
@MarcC In CircuitLab or did you actually build it? And in either case what opamp did you end up using? – GodJihyo Nov 02 '22 at 13:40
-
I actually built it using the specified components. It produces close to 0.1 to 4.8V on the output. Now it works I know what to look for and could try to build it using other (cheaper) components. Thanks again. – MarcC Nov 04 '22 at 08:13
You can use a digital potentiometer and/or programmable ATTINY13A-SUR to control precise output voltage. For example, if input voltage == 3V, then output 3.5V. Depends on drop voltage and needed output.

- 3
- 2
-
Thanks very much! You're thinking along the same line as I was: I asked the vendor of the controller if I could introduce this kind of logic on the in-port of the box. As an alternative, I was looking at some discrete components, but never thought of adding a processor outside of the box to do it. – MarcC Oct 20 '22 at 10:05