Pages: [1]   Go Down
Author Topic: Measure positive and negative voltage with common ground  (Read 799 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27144
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you do this:
Use -12 as Gnd, use Gnd as +12, and +12 as +24V?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12200
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure I fully understand the battery circuit.  Maybe a diagram would be clearer?
Logged

[ I won't respond to messages, use the forum please ]

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6619
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* voltage divider pos and neg common ground.png (11.52 KB, 795x540 - viewed 73 times.)
Logged

Pages: [1]   Go Up
Jump to: