Pages: [1]   Go Down
Author Topic: Explaination of voltage dividers  (Read 591 times)
0 Members and 1 Guest are viewing this topic.
South East England
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
                  +5V
                   |
                   <
                   >     10K
                   <   Resistor
                   <
                   >
                   |
 Analog Pin 5------|
                   |
                   -----------| To weather vane
                              | (mystery resistance)
                   -----------|
                   |
                   |
                 -----
                  ---
                   -

the above is a circuit diagram from a bit of example code for SparkFuns weather meters that I have just ordered and hoping to have some fun with.

I am aware they make a arduino board especially for the equipment, but wheres the fun it that?

Basically what I want to know is, how is it that the signal going to pin 5 changes? surely it will remain contant and the read needs to be taken after the weather vane?

parts havn't arrived yet so cant play (got shipped today)
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
Nokia 6100 LCD Library
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

knowing the term "voltage divider", shouldn't Google search be a first step ?

http://en.m.wikipedia.org/wiki/Voltage_divider

http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Resist/Resist3.html
Logged

Ardgrafix6100 - A fast, full-featured Arduino graphics driver for Nokia 6100 LCDs http://code.google.com/p/ardgrafix6100/

South East England
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes i saw those, but, they go straight over my head in all honesty, so in laymans terms...
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 51
Posts: 3438
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
how is it that the signal going to pin 5 changes?

Look at the sparkfun datasheet, the resistance on the vane varies with the angle it's at. The voltage read by the arduino pin varies depending on the proportions of the two resistors in the divider. if the vane resistance is 10K, you'll get 2.5V. If the vane resistance is 0, you'll read 0V. If the vane resistance is huge, it'll be almost 5V. Similarly, other vane resistances will give results in between which the voltage divider pages above should tell you how to calculate.
Logged

South East England
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ah ha
now i understand, thank you!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
Nokia 6100 LCD Library
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Or if you want the math treatment (since i'll feeling  patient smiley ) -

VOltage across the two resistances = 5V = Voltage drop across Resistance 1 (V1) + Voltage drop across Resistance 2 (V2). V2 is the voltage you'll see on Arduino pin.

Ohm's Law: Voltage (V) = Current (I) * Resistance (R)

Resistance R1 = 10kOhm, Resistance R2 = your weather gizmo.

However, current flowing through the wire from 5V to Ground (neglecting the very very minor amount that will flow through Arduino pin) is the same, ie = I

Therefore, V = V1 + V2 =  I*R1 + I*R2 = I*(R1+R2)

ie. "equivalent resistance" of 2 resistors connected in series = R1 + R2

or re-arranging, I = V/(R1 + R2)

Therefore the voltage you'll see at Arduino Pin = V2 = I * R2 = V/(R1 + R2) * R2 = V*R2/(R1 + R2)

And so you see how the voltage you see on Arduino pin is affected by R2
« Last Edit: April 26, 2012, 08:23:44 am by srinathdevelopment » Logged

Ardgrafix6100 - A fast, full-featured Arduino graphics driver for Nokia 6100 LCDs http://code.google.com/p/ardgrafix6100/

South East England
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i think i understood that, thank you both

now all i need is Mr FedEx to drop the bits of and dig out a resistor and a new protoboard and play (maybe a new arduino if i think it works well enough)
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 37
Posts: 1150
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go check out the Falstad circuit simulator (Google it, it's easy to find).  Build a circuit with a voltage source, gnd, a resistor, a piece of wire (that you can add to a virtual scope) and a potentiometer.  Build your vane circuit with those pieces, then change the pot value to see how it changes the voltage in the wire between the two resistors.  It's a great visual aid to the math.
Logged

Pages: [1]   Go Up
Jump to: