How to read a negative voltage?

Thread Starter

Jassper

Joined Sep 24, 2008
84
What would be the best way to reverse the polarity on a analog signal from -5volts to 0 to a positive voltage of 0 to +5v so it can be read by an ADC? The signal can source/sink 20ma.
 

kkazem

Joined Jul 23, 2009
160
Hey Jassper, this is an easy problem. You need an op-amp unity-gain inverter circuit. The only difficulty is that you'll need split power supplies for it, like + and - 12V, or at least +/- 8V for a 0 to 5V output. Use an LM324 op-amp with the VCC going to +12VDC and the VEE going to -12VDC. Connect a 20K, 1%, 1/8W resistor from the minus (inverting) input of one of the 4 op-amps in the LM324 to it's output and connect another 20K, 1%, 1/8W resistor from the minus input to your 0 to -5V input signal. Finally, connect a 10K, 1%, 1/8W resistor from the plus (non-inverting) input terminal to circuit ground. Note that the two split 12V power supplies must be connected together in the middle and that also goes to the ground connection. That's about all there is to it. Your -5V input will give you a +5V output and it will have a gain of -1 from -5 to +5, although you said you only need it to work from inputs of -5 to 0. You may need a small cap of about (100pF to 0.01uF) in parallel with the feedback resistor that goes from the minus input to the output to reduce noise and bandwidth. Also, as close as you can get them with as short a leads as possible, put 0.1uF caps from the VCC to ground and from the VEE to ground on the chip. You can use an LM358 instead, which is the dual version of the LM324 if I'm remembering correctly, or you can even use just a single op-amp. The LM324's are so popular that they are going to be very low cost, probably about 50 cents to a dollar. The gain accuracy will only be as good as the matching of the 20K resistors. The 10K resistor is for balancing out the input bias current so that it doesn't add to the problem of the input offset. 10K is the parallel combination of the two 20K resistors so that the input resistance of both the minus and plus inputs are the same.
 

Thread Starter

Jassper

Joined Sep 24, 2008
84
Wow, Thanks!!

I'll look up the Data sheet for the LM324.
And thanks for the part recomendations along with it.
 

MikeML

Joined Oct 2, 2009
5,444
Since the common mode input range of an LM324 includes the voltage that it's Vee (-supply pin) is connected to, you do not need to run in on split supplies; just ground the Vee and the non-inverting input pins.
 

Attachments

Last edited:

Thread Starter

Jassper

Joined Sep 24, 2008
84
On another forum I was told to do it this way,
With 2 resistors

+5V----[2K]----(analog_read_pin)-----[3K]-----(-5V to 0) Vss for testing

if Vss = 0V you should read 3V
if Vss = -5V you should read 1V

ratio for the value from 0 to -5v
Pros - Cons ? Obviously less components, but which is better, which would you use?
 

MikeML

Joined Oct 2, 2009
5,444
...

Pros - Cons ? Obviously less components, but which is better, which would you use?
How about a voltage divider of two equal resistors, top tied to +5V, bottom to (0 to -5V), tap to the A/D input. Range at tap will be 0 to 2.5V.
 
Top