Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need Simple Voltage Polarity Converter

Not open for further replies.


New Member
Sorry for the wordiness, but I figured it is easier to describe all of it rather than just bits and pieces.

Have a Oil Temp sender (automotive) that outputs resistance as function of temperature. As temp increases, resistance decreases. This is to be used as the input to an LED display using LM3914s.
I can easily convert the resistance output of the sender to voltage using a voltage divider. However the "other" dividing resistor has to be between the sender and the voltage supply i.e. I can not connect the "other" resistor between the sender ground and the actual ground.
This obviously leaves the voltage output decreasing as temp increases.

The LM3914 lights the corresponding LEDs in an ascending manner as the signal voltage is increasing but the sender output actually goes the opposite way - hence the need for a voltage polarity converter ciruit.
Output voltage from the sender varies from 5V (0 resistance) to 0.78V.
I do not need any gain from the sender - just need an exact polarity reversal for any of possible sender voltages.

Once I have the inverted voltages, then I can sum them with the 5V supply (using LM741) to get my increasing voltage as temperature increases.

Is this the best way to handle this scenario in general?
Is there a simple circuit that would do the polarity inversion? I've looked at several designs elsewhere on the web but most need at least 1.5V min input.

Thanks for any help.
A 741 will not work for your application unless you can obtain a negative voltage to connect to it's neg supply pin. When used as an inverting amplifier with its neg supply pin grounded, its inputs cannot go below ~1.5V, and neither can its output pin, meaning that you will have trouble because your input is less than 1.5V.

A much better alternative for your application is an LM358 or a modern opamp like a TL072, or a TLV2272.

You might get some ideas for your project by reading this thread.
I was wondering how I was going to get a neg supply voltage and I've seen the limitation with the 1.5V min - ugh!

I checked out the thread you posted - thanks.

I have already generated the voltages/resistance for various temps so I'm all set there. I also have the board with the LM3914 and associated circuitry - just have to take care of inverting the input voltage.
Last edited:
Remember that when you invert a positive voltage, it will want to go negative (below ground) which is not allowed for a single supply amp. Thus you need to add some positive offset at the positive input so that the maximum negative going signal (for the maximum positive signal to the inverting input) is still positive.
I made a schematic of the circuit:
**broken link removed**

R2 & R3 are equal so Gain of 1 for the inverter.
Positive Supply of +5VDC from an LM317 - do I need a higher supply so the opamp doesn't saturate at 4VDC?

Not sure of the voltage adder resistances...found it in a book online.
What do you think?
Give me a two-point fit of the function that you want; i.e. A Vin=X Vout and B Vin=Y Vout, and I will generate a single-supply opamp circuit.
I have tried to post the schematic I came up with but because I'm a newbie, it has to be reviewed first...or maybe I didn't reply correctly.
In any case, the link has a schematic - will this work?
Thanks again.**broken link removed**
Last edited:
Your circuit will not work because the opamps are inverting and not biased properly for a positive input voltage.
Your first opamp is inverting so if its input is +5V then its output tries to be -5V. But without a negative supply its output stops at close to 0V.
Another question: what biases the sender so that it puts out 5V hot, and 0.78V cold? Is it a resistor tied from the sender input to +5V, or is it tied to the vehicle's battery? What is the resistor value?
Vin +5.0 : Vout 0
Vin 0 : Vout +5.0

That's trivial. A single LM358 configured as an inverting amplifier (R1=R2) with 2.500V at its non-inverting input will do that. I'm inferring from the schematic that you linked to that there is a 5V regulator, so just put a voltage divider (with two equal resistors) across the 5V, and tie the tap to the amplifier's non-inverting input.

Note that the LM358 will not pull quite all the way to 0.000V, but it will get within 10mV, or so. So that the LM358 can pull it's output all the way to +5V, you will have to power it from the unregulated vehicle's voltage(12 to 14.5V), presumably from where you are powering the 7805. Remember that even a crummy opamp like an LM358 has a Power Supply Rejection Ratio (PSRR) of ~95db, so some noise on the vehicle's electrical bus will not introduce any disturbance to the LM358's output.


  • TempGauge.gif
    48.5 KB · Views: 395
The sender is a resistance device - as temp rises, resistance falls.
At room temp, it's resistance is approx 1.2K. At 300 F, it is 20 ohms.
Because the LM3914s expect VDC signals, I mounted the sender in a voltage divider where the other resistor is 100 ohms. I can't switch the placement of the sender and the 100 ohm resistor since the resistor body is ground and there is no physical way to connect a resistor between it and ground. (That would have made this whole discussion moot.)

Here's the actual values:
Temp (F) Volts
75.95805885 4.411105697
99.38811075 4.178817414
103.4905373 4.131298914
108.6509062 4.06847612
113.1891353 4.010380743
116.7294946 3.963193856
121.446127 3.897779991
129.8503198 3.774030566
148.0312684 3.47587523
152.5678207 3.395428119
165.6902423 3.150974375
172.5294622 3.017662463
173.1341782 3.00571271
184.352917 2.780216073
195.0464098 2.560833184
199.367952 2.471714595
208.3383018 2.287215993
215.6816466 2.137809847
217.988014 2.091373056
226.5830976 1.921094391
234.3402248 1.772093932
241.9148636 1.631845558
253.7005746 1.425688655
255.7584758 1.391336252
265.1715596 1.240856925
278.1551202 1.051915642
294.0334575 0.850717827
300 0.783454764

I can send you the Excel sheet with the complete setup if you'd like.
The sender is a resistance device - as temp rises, resistance falls....

Ok, 100Ω is tied to an 7805 regulator?
Voltage variation as function of temperature

I see I'm not the only one that uses EXcel for things like this... Looks linear enough. You seem to have found the sweet point where the pull-up resistor value gives optimum linearity. I derived that equation once...

Now go find the LTSpice schematic and sim I posted...
Last edited:
Not sure what you mean by tied (I'm not an EE) but the sender is one resistance of a voltage divider where the other resistance is 100 ohms. A 5VDC regulated supply is used (it is a 7805)
R2 is the sender.


  • VoltageDividerWithVoltage.gif
    1.6 KB · Views: 207
I see I'm not the only one that uses EXcel for things like this

I just messed with R1 until I got a decent linear fit.

Got the schematic - looks simpler than the mess I had - I'll try breadboarding it just to double check.

Thanks for all your help.
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips