Variable voltage shift

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
Hi, I've read through a bunch of threads here, and either I am failing in my search, or this is a weird one. I'm very green on this stuff, apologies up front if this is super simple, or if I completely miss something.

I have a 5V sensor circuit(analog DC), and I am looking to vary the signal from it to the computer monitoring it. I want to be able to take the voltage coming out of it, and shift it an amount, +/- 0.5V or so. The sensor itself changes it's output based on a mechanical change, and the shift needs to be the same without regard to the signal voltage.

I spent some time looking into op amps, because I think this is easily done, and think I can come up with a way to raise the output a varying amount by altering the Rf value on a simple non-inverting amplifier circuit, just enough to have a slight gain. But, I don't see how I could use that to drop the signal voltage. Can that be setup to have a positive gain less than 1? Or am I looking at needing something completely different.

Application: Manipulate signal input of height sensors on a vehicle, 4 in total, if possible a quad op amp would be ideal. Each signal is separate and has a positive slope of position to voltage(higher mechanical height, higher voltage output) Sensors read in neighborhood of 0.5-4.5V, and signal varies during operation. The 'new' signal, needs to maintain the voltage profile during operation, however with a variable shift to either raise or lower voltage by around +/- 0.5V. In operation this would perform the task of allowing for minor ride height changes on the fly based on voltage shift of the signals, so that a voltage increase of 0.2V shows the computer it is sitting high and lowers it accordingly. I have the means to do this, both mechanical changes to the sensors and altering the calibrated values, but neither can be done on the fly, where as a shift in the signal would result in an immediate compensation by the system.

Thanks for any insight on this,

Dave
 

Audioguru again

Joined Oct 21, 2019
2,847
What is the acceptable maximum allowed load current on the sensor produced by an opamp input?
Some opamps (LM741C) use ordinary input transistors with 0.5uA of input bias current and other opamps (Cmos type) with inputs that have extremely low input bias current.
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
I don't have documentation on that spec, but I wouldn't expect a high of 0.5uA to be an issue. In my experience, many automotive components are built to deal with decently high variance with stuff like this, and if I'm wrong, killing a relatively inexpensive sensor is an acceptable loss.

If it is critical, I can toss a clamp on a signal wire and see what it reads during motion.
 

AnalogKid

Joined Aug 1, 2013
9,040
What you are after is called a summing amplifier. The classic form is a variation of an opamp inverting amplifier. The circuit can have multiple inputs, and the output is the algebraic sum - if one input is +5 V and the other input is -4 V, the output is -1 V. That example assumes the circuit is configured for a gain of -1, but other gains are possible. Also, the gains for each input can vary from the others.

Often, the overall inverting nature of the circuit is an issue. A common approach is to use a dual opamp; 1/2 for the summer and 1/2 for a following unity-gain inverter to restore the priginal signal polarity.

ak
1614633850166.png
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
AK, thank you. Admittedly, I know next to nothing with this stuff, but what I was seeing with summing amplifiers is that both inputs would need to vary together in order to create a stable shift in voltage dependent on just the sensor signal. I played with this in my head for a minute, and got to a point where having the source split to both inputs, one with a slight voltage drop on it, would work. But I didn't get to a point where the output could be lower than source.

My understanding of summing amps is that in order to shift the voltage from the sensor a certain amount, I would need to vary the second input as well, correct? The goal is to be able to change the signal from the sensor in a way that while it reads say 2.5V, the output is 2.7V, but in a linear way that when it reads 3.5V, output is 3.7V.

What I want to be able to vary is that 0.2V shift above, in a way that would allow for a single change in circuit (through a pot or switched circuit) to also be able to output a -0.2V shift.
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
Another automobile fiddler?
Are you trying to fool the pollution controls so that your car is a rocket with a smoke trail?
Definitely a fiddler, but no, nothing smokey here.

My truck has variable air suspension. These sensors feedback the position of each wheel to chassis. I am looking for a way to have a little manual control over it. I can change the calibration and subsequently ride height easily, and I can change the linkage to the sensors to trick the reading, but neither option allows for actual control of the system, just alters it's base '0' position.

It has multiple positions by design, lower for garages, offroad for more clearance, but these modes are speed limited. My main goal with control of this would be to be able to exceed the 35mph limit when I'm offroad, without the truck lowering itself.

When I started thinking about this, I figured I'd be able to find a little box of electronic magic that was designed to take one voltage in, and output a slightly modified one, I've had no such luck.
 

MrChips

Joined Oct 2, 2009
23,069
You can do two things to a linear signal and still keep it linear.
You can change the gain and you can add an offset.

If you want to add an offset you can use a summing amplifier.
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
I looked more into the summing amplifier, which in function looks right. I don't know what software you guys use for schematics, but going with the diagram above from ak, and assuming I can have V1 and V2 as the same supply, and a pot near the range of R1 for R2, and R4 being half of R1, this would give me what I'm looking for.

Say V1 and V2 at 2.5V, R1 at 10kohm, and R4 at 5kohm, a pot set to 8kohm would give me a -2.81Vout, or set at 12kohm for -2.29Vout. Which is perfect aside from that pesky minus sign before the Vout.

Now my concern is power supply for it. I have 12V and 5V available, with ground as 0V. Would this output anything but 0V without a negative voltage supply? Will a unity inverter work to flip polarity before the 0V comes into play?

I'm a car guy, the only time I see negative voltage is when I hook my meter up backwards.
 

AnalogKid

Joined Aug 1, 2013
9,040
That circuit was a grab off the innergoogle. The original image almost certainly is from an old National Semiconductor app note (it's their drafting style). As shown it is intended for dual symmetrical power supplies, such as +/-12 V. Of course there is a way to modify the circuit for single-supply operation.

Critical questions:

1. What is the expected voltage range that the downstream whatever expects? Particularly, if it expects something like 0 V to 5 V, how close to 0.00 V does the signal have to be able to go?

2. What is the input impedance of the circuit or device? This affects how much current the summing circuit has to supply.

ak
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
The ecu seeing the signals will recognize a fault with a signal under 0.17V or above 4.83V, however mechanical limitations restrain a non-modified signal to around 0.5V to 4.5V. A 0.5V change in signal is around a 40mm swing in height, and in practice this should work in a way that when Vout is set to be higher than V1, V1 should be on the lower end of the scale (that is input to ecu increased, forcing ecu to lower suspension)

As to impedance, I will need to verify that on a sensor itself, I have conflicting documentation from the factory. I'm guessing this plays a role in the chosen resistor values?
 

AnalogKid

Joined Aug 1, 2013
9,040
As to impedance, I will need to verify that on a sensor itself, I have conflicting documentation from the factory. I'm guessing this plays a role in the chosen resistor values?
More like device selection.

My question was not clear. The vehicle sensor drives the summer circuit, and the summer circuit drives something. ECU? Whatever, some kind of electronic circuit downstream. That thing's input impedance determines how much current the summer circuit output has to source.

As it is now, the sensor drives the ECU directly, so someone has designed things such that the sensor output and ECU input have compatible voltage and current ranges, partly determined by the sensor output impedance and ECU input impedance. Now we are breaking that hard-wire connection, and inserting an electronic circuit. So, ideally, our circuit's input impedance looks exactly like the ECU to the sensor, and our circuit's output impedance looks exactly like the sensor to the ECU.

ak
 

LowQCab

Joined Nov 6, 2012
271
Hi, I've read through a bunch of threads here, and either I am failing in my search, or this is a weird one. I'm very green on this stuff, apologies up front if this is super simple, or if I completely miss something.

Dave
The Schematic that follows is what you are looking for.

The only trick to this is the fact that your Sensors do not go "all-the-way" to zero-Volts,
and they don't go "all-the-way" to 5-Volts either.

So I'm giving you 2-options ........

Option-1 will ADD or SUBTRACT, 2.5 Volts, from what ever each individual Sensor is putting out.

Option-2 will ADD or SUBTRACT, 5-Volts, from what ever each individual Sensor is putting out.

Now of course the Sensor Voltage Output will never actually go below zero, or above 5-V.

It is a fairly simple procedure to change from one option to the other,
it involves changing the values of 8 Resistors,
but these resistors can be baked into your original build,
to make it a 10-minute job to change values.

All of the Resistors in this project are 1000-Ohms, or "1K".
If you put 2 of these Resistors in parallel, you will get 500-Ohms, or "500R",
which happens to be the value needed for the Second Option,
at the location named "Gain Reduction Resistor".

The other Resistor that needs to be changed is named "Feed-Back-Resistor",
but in this case, you will be putting the 2 Resistors in series, (end-to-end),
which will give you 2000-Ohms, or "2K".

This Second-Option may make the Adjustment-Knob overly sensitive,
but it's guaranteed to "Lay-Frame" or put it all the way in the Air.

But, depending upon the Ride-Height that you normally run at,
the First-Option may give you more accurate control.

If you normally run with a different Ride-Height Front-to-Rear,
this bias will not be affected by this Circuit.
All Corners will Rise and Fall evenly, keeping the same Rake-Angle, if you have one.

The normal Height-Feed-Back that may vary with each corner will not be affected by this Circuit.
.
.
.Ride Height Control Flat .png
 
Last edited:

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
LowQCab, wow, thank you! Now I just need to try and figure out how you got there so I can skip a few questions next time. With the 5V supply, does it need to be the same supply for the sensors as it is for the circuit? The ECU provides 5V to the sensors on a monitored circuit, I'm sure that can be easily tricked to make it think it's still connected, but would it change anything to have the circuit you designed and the sensors on separate 5V supplies?

AK, that makes sense. I've really always thought of it as just an ecu sensing the voltage, not it's 'sensing circuit' is being driven, but that really helps. I'll have to test to know the values on this application, but generally testing a harness for a short to ground on an input circuit will show several thousand ohms to ground on a good circuit.

If impedance is a concern, could the resistor values in LowQ's circuit be scaled up or down to match? Or is it more of an as long as it doesn't blow up, it's good situation?
 

LowQCab

Joined Nov 6, 2012
271
The 5-Volt Regulator that I specified is because "we" really don't know
how much Current the built-in 5-V Power-Supply can provide,
and it could create some very frustrating problems if
that 5-V Supply "sags" under the additional Load,
so it's "good-practice" to include a separate Regulator.
Just don't connect the two 5-V Rails together,
or there could be some "unpredictable" results.

Everything is referenced to GROUND,
it doesn't matter where the Power comes from,
as long as the Voltage is very close to the same, (~5-V above Ground).

The Resistor Values in this Circuit have no effect on the
Output-Current available from each of the 4- Output-Op-Amps.

With a 5-Volt Supply, the specified Op-Amps can drive
a Controller Sensor-Input-Resistance-to-Ground of
around ~143 Ohms, each, continuously.

There should be no reason for the Controller Inputs to have
an Impedance lower than about ~1000 Ohms,
and they are probably closer to ~10,000 Ohms.
These inputs have to be "DC-Coupled" to Ground to work,
so you can check their Impedance to Ground with an ordinary, cheap, Digital-Multi-Meter.

And,
the 5-V Regulator can supply a "way-overkill" 2-Amps of Current @ 5-V,
but the Sensors and the Adjustment Circuit together
will probably only use much less than 1/4 of that Capacity.

If the Regulator has more than a 2-Amp Demand placed on it,
( from a Short-Circuit or a mis-wiring problem ),
or it gets too hot for any reason,
it will automatically shut-down.
It is intended to be mounted to a Heat-Sink for cooling,
but it will probably only get slightly warm, even without a Heat-Sink.
BTW, it's supplied in a "Full-Pak" Transistor-Package, which is completely insulated,
so, fewer worries with Shorting-Out to other Wires.

Do NOT install this Circuit under your Hood,
none of the Parts are rated for the 200-plus degrees,
and they may get pissed-off about it.
.
.
.
 

crutschow

Joined Mar 14, 2008
26,735
The 1k resistors can all be changed to 10k (or even higher) to give a higher input impedance, if needed for the sensor.
That should have no significant effect on circuit operation.
 

LowQCab

Joined Nov 6, 2012
271
These are very "fast" Op-Amps, the lower Impedances mean less likelihood of Oscillation
without having to resort to Feed-Back-Capacitors to limit Band-Width,
which keeps the parts count and build-complexity down.
Also, at 10K, all of the Inputs would have to have
"Noise-Capacitors", (as well as the Feed-Back Capacitors ).

The Chips were chosen based on,
Rail-to-Rail Inputs and Outputs,
a power-Supply Range of 2.7-V to 38-V,
and stout Output-Current-Capabilities of greater than 35ma. @ 5-V.

Having ALL Resistors at ~1K virtually guarantees Circuit-Stability and
Noise-Immunity, with no surprises.

Any Sensor designed for Automotive use is going to be "ruggedized",
and should easily drive a 1K Resistor with no trouble,
especially if they are of the simple "Linear-Pot" variety, with no internal Electronics.

Of course there is the possibility that, if they are "Linear-Pot" based,
and relatively high Output-Impedance at the same time,
1K Resistors could possibly affect their Output-Linearity to some degree,
but they are probably fairly Low-Impedance to eliminate, or reduce,
Electrical-Noise problems in a very noisy Automotive-Environment.

( This is one reason many Late-Model Cars are going over to Active-Digital-Sensors,
instead of the Old-Skool Variable-Resistance-Sensors,
because they provide almost total "Noise-Immunity" ).

The ultimate answer to this is to have RoverGuy actually measure the existing Resistance-Values.
Controller-Inputs,
and Height -Sensor 5-V-In, to Ground Resistance,
and then report back here.
.
.
.
 
Last edited:

crutschow

Joined Mar 14, 2008
26,735
I don't think 10k resistor will have a significant effect on circuit noise or stability.
But I just suggested it in case the sensor does have a high output impedance.
 

Thread Starter

RoverGuy7

Joined Mar 1, 2021
11
Thank you guys very much! Time for me to order up some parts and get to work.

I think I can follow the logic in this circuit pretty well, each sensor's op-amp has a sort of 2 summing circuits; so that when voltage off the pot equals the set 2.5V, the op-amp output equals the sensor's signal voltage to match. With the pot turned up (higher resistance/lower output voltage, not sure if that's what up means here) the op-amp needs to output a proportionally higher voltage to 'balance' it's inputs, and the other way around when turned down.

This is exactly what I was looking for. I tend to agree with the 'rugged' nature of on car electronics, they live a pretty harsh life.

Would complicating this circuit with the addition of a multipole switch mess anything up? Just thinking with that harsh live for automotive components, having a safety to throw it back to stock when one of my solder joints fail, might be a good idea. Does removing the voltage rails from an op-amp kill it's function, or would breaking it's output circuit be better to keep it from affecting the circuit?
 
Top