To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 1879
1878  |  1880
Subject: 
Re: sensor input mux calculations
Newsgroups: 
lugnet.robotics
Date: 
Tue, 29 Dec 1998 19:10:47 GMT
Original-From: 
John A. Tamplin <jat@traveller%NoMoreSpam%.com>
Viewed: 
1418 times
  
On Tue, 29 Dec 1998 MwalimuB@aol.com wrote:

No.  The 10k resistor that pulls up the input line and a resister that is put
across the connection form a voltage divider.  The formula given calculates
the fraction of the voltage that will be at the junction of the two resisters.
That voltage is represented by the value returned by the port.  Two 10k
resistors return one half ( 10000/20000= 1/2) of whatever you're reading, so
you see 512 for raw values or 50 if it's percent.

Here is my understanding of the circuit:

                                  AVcc
   |
  Rp 10k
   |
  A/D input -----------------------+--------------------
      |                                 |    |    |    |
      |                                S0   S1   S2   S3
      Rc |    |    |    |
      |        R0   R1   R2   R3
      | |    |    |    |
     GND                                +----+----+----+---- GND

Where Rp is the pullup resistor and Rc is the impedence of the converter
itself.  I couldn't find any spec on it, but I assume it is very large
(10M or higher) to avoid affecting the input signal.  What is measured is
the voltage drop across Rc.  This is a voltage divider circuit and the
voltage drop across R (the combined parallel circuit of Rc, R0, ... R3)
is AVcc*R/(R+Rp).  I ignored Rc for the calculation below, treating it
as effectively infinite.

R is just the resistance of a parallel circuit, and the effective
resistance of a series of parallel resistors is 1/sum(1/Ri).  If a switch
is open, that resistor is not part of the circuit and if no switches are
closed you get infinite resistance (1/0).

Combining all of this gets what I posted before.  I'm not sure why you said
I was wrong, since it is essentially the same as what you did with a bit
more generalization and devising a way to analytically determine which
switches were pressed.  Please explain where I have gone wrong if you
still think I have.

I don't know about the other details, but I have built a prototype sensor and
it works with the values I predicted (with some allowance for varying
resistance due to defects, temperature, ect.).

What kind of variance do you get?

John A. Tamplin Traveller Information Services
jat@Traveller.COM 2104 West Ferry Way
256/705-7007 - FAX 256/705-7100 Huntsville, AL 35801



--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message is in Reply To:
  Re: (no subject)
 
No. The 10k resistor that pulls up the input line and a resister that is put across the connection form a voltage divider. The formula given calculates the fraction of the voltage that will be at the junction of the two resisters. That voltage is (...) (26 years ago, 29-Dec-98, to lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR