Pages: 1 [2]   Go Down
Author Topic: How to read a negative voltage  (Read 7522 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I understand the concept here, but would anyone want to explain to me what is actually happening with this divider on an elementury level? I like to understand the "why" instead of just "because".

Thanks, and thanks for both youe help.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Voltage divider is simple :
Let have two voltages : Vminus and Vplus, if I understand you have them as -5V and +5V. Mark resistors as Ra and Rb.
A current through divider is I = (Vplus - Vminus) / (Ra + Rb)
It creates a voltage drop on Ra resistor : Vdrop = I * Ra
So you have on analog input pin : Vminus + I * Ra
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Practical example, with your values -5V and +5V and let say both 10 kOhm resistors :
I = (5 - - 5) / (10 + 10) = 10 / 20 = 0.5mA
Voltage on resistor V = 0.5mA * 10 kOhm = 5V
Added to -5V you have  -5 + 5 = 0 V
-----------
Let your input voltage is 0V :
I = (5 - 0) / (10 + 10) kOhm = 0.25mA
On resistor V = 0.25 mA * 10 kOhm = 2.5V
Added to OV : 0 + 2.5 = 2.5V
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 75
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Practical remark : to have stable results, +5V supply must be stabilized nad 2.5V reference voltage (TL 431, LM336 ...) is recomended for full range conversion result.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Pepe34, single voltage dividers I know, but I couldn't get the math right with the neg voltage.
Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 415
MEGA_Stick_II is here
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After plugging that formula into Excel, this is what I get

V Ref      Ra      Vsig      Rb      Vin
5      10000      0      10000      -5
5      10000      2.5      10000      0
2.5      10000      -1.25      10000      -5
2.5      10000      1.25      10000      0
10      10000      2.5      10000      -5
10      10000      5      10000      0

So the 5v and the 10v ref voltage give me the same range. I played with the resitor values a bit and it looks like about the best I can get is a 2.5 volt range.
« Last Edit: October 06, 2009, 12:10:40 pm by Jassper » Logged

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

Hmmm, what about maybe doing something like this to get a full range, tell me if this concept is ok

What about measuring the positive voltage, and whenever the voltage hits the 0 which means it will be going to the negative, you use transistor to switch + with -, and then programaticly you just substract the 1023 value (because the reading will be positive again), and then you have the negative reading?
Logged

Pages: 1 [2]   Go Up
Jump to: