Go Down

### Topic: Measure positive and negative voltage with common ground (Read 1 time)previous topic - next topic

#### amongstmyselves

##### Oct 27, 2013, 03:18 am
Howdy all,

I'm trying to do as the subject says - measure positive and negative voltages with a common ground but I need to know if the voltage changes between positive and ground and negative and ground and NOT between the positive and negative. Based on this I will need to use two analog input via resistor networks but the problem as I see it is the common ground which I can't get around and hence the need to measure a negative voltage.

The only way I can see around this is to use an opamp to invert the negative voltage to positive.

What I am building is a battery switcher which has two inputs. Each input  has three connectors terminals which are +12v / ground / -12v. Via some software I will switch between the two inputs when the voltage on either rail go below a define voltage. Hope that is clear enough.

So I what I am asking is if anyone can think of a way around using an opamp and do the job with just resistors. Any suggestions will be greatly appreciated.

#### CrossRoads

#1
##### Oct 27, 2013, 03:28 am
Can you do this:
Use -12 as Gnd, use Gnd as +12, and +12 as +24V?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### MarkT

#2
##### Oct 27, 2013, 11:08 pm
I'm not sure I fully understand the battery circuit.  Maybe a diagram would be clearer?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### dc42

#3
##### Oct 27, 2013, 11:22 pm
Yes you can do it with just resistors, but with resolution reduced by 25% for the negative supply reading. I assume that you will connect the Arduino ground to the ground of the input.

To measure the +ve supply, you just need a voltage divider - say 20K from +12V to the analog input and 10K from the input to ground. Then you can measure from 0V to +15V on that input, and the voltage present is (analog_reading * 15.0)/1024.0.

To measure the -ve supply, connect 30K between it and the analog input, and 10K between the analog input and +5V. Then as the -ve supply varies from 0V to -15V, the voltage at the analog input will vary from +3.75V to 0V. The voltage of the negative supply is ((analog_reading - 768) * 15.0)/768.0.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### amongstmyselves

#4
##### Oct 28, 2013, 01:46 am
Thanks dc42 that makes sense. Here's the Tinycad circuit just to confirm I've understood but I will also breadboard it before putting it into the final circuit.

Go Up

Please enter a valid email to subscribe

### Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy