To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2196
2195  |  2197
Subject: 
Re: Multiplexing 4 touch sensors on an RCX input port
Newsgroups: 
lugnet.robotics.rcx
Date: 
Wed, 10 Sep 2003 01:28:20 GMT
Viewed: 
3758 times
  
I have done work in this area.

I chose to solve the problem to permit 4 touch sensors to be pressed in any
arbitrary combination with high probability of getting the answer right :)

A simple R, 2R, 4R, 8R scheme will do.

I chose R = 40.2K. This is high enough that the contact resistance in the
sensors is negligable.

I used 40.2K, 80.6K, 160K and 320K. These resistors all have to be 1%.

First of all, note that 40k is eight 320Ks in parallel. 80K is four, and 160K is
two. Since the RCX's pullup resistor is 10K, you can easily compute the
resistance of the "load" (resistance of none - all of the switch es closed) by
processing the reading (0 - 1023 in passive raw mode).

The load resistance can then be converted to a "number of 320K resistors in
parallel" which must yield a number on the range 0 - 15. This number when
expressed as a binary value 0000 - 1111 then actually respresents which switches
are open and which closed.

The key routine is the conversion from raw reading (0 - 1023) to number of
320Ks. My approach was to round up by "half a unit value", ie; the effect of a
single 320K resistor before doing the final integer division which produces the
0 - 15 "answer".

I would suggest anyone trying to repeat this should take a close look at ohms
law - its pretty simple. To optimise the final quantization, a quick look at a
famous work done centuries ago - Newton's Kissing Sphere's would help. (This
theory is often used in defining signal encoding separation in modems.) The
advantage it has in this application is in only needs to be applied in one
dimension, as opposed to the modem applications which may require 4 or more
dimensions.

We actually sold these simple multiplexors back when but since we had largish
quantities of the four resistor values required, a laborious process of creating
calibrated sets was put in place to get the value matching to better than 0.3%
to increase the liklehood that the processing would guarantee the correct
answer.

JB



Message is in Reply To:
  Re: Multiplexing 4 touch sensors on an RCX input port
 
(...) Good analysis. Series can work quite well as long as you know that the touch sensors are touched mutually exclusively, but you are right parallel doesn't work well. I remember trying to come up with good resistance values to do parallel, and (...) (21 years ago, 9-Sep-03, to lugnet.robotics.rcx)

13 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