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 / 1897
1896  |  1898
Subject: 
Squeezing 4 inputs out of 1
Newsgroups: 
lugnet.robotics
Date: 
Wed, 30 Dec 1998 05:17:53 GMT
Original-From: 
(mwalimub@aol.)AntiSpam(com)
Viewed: 
1216 times
  
I've constructed a circuit that will read four switches from one input port.

Theory-

The input port is an A/D circuit.  It reads voltage as opposed to state.  The
A/D line is wired to a 10K ohm resistor that is in turn wired 5 volts.  Thus
if it is connected, it always reads 1023 - which is the 12 bit result of the
A/D converter reading 5 volts.
If a resistor is placed across the two connectors on an RCX input port, one
goes to ground and one goes to the A/D line.  The result is a voltage divider.
Depending on the resistance, voltage will be lowered by the following formula:
R/(R+10000), where R is the resistance across the input port.
By varying the resistance, you can vary the reading at the input port.

The Circuit:

            A             B              C              D
         | sw |        | sw |         | sw |        | sw |
         |      |        |      |         |      |        |      |
    +--+ 1K+------+2.2K+------+4.7k+------+10k+---+
     |                                                                |
input port                                                  input port

Switches A, B, C, and D are normally open.  The resistors are wired in
series.  When a switch is close, the circuit bypasses the resistor wired
across it, lowering the total resistance on the circuit.  There are 16
possible combinations.  Below are the associated RAW values:

All Open - 656 A closed - 643 B closed - 625 C closed - 582

D closed - 451 AB closed - 609 AC closed - 562 AD closed - 418

BC closed - 536 BD closed - 371 CD closed - 248 ABC closed - 512

ACD closed - 184 ABD closed - 327 BCD closed - 93 All closed - 0

I found that these values fluctuate one or two points either way.  I suppose
that depending on wire length, temperature, resistor quality, and other
factors, this is to be expected.

If you want to try different values for the resistors, you can calculate the
resistance by adding the values of the resisters remaining on the circuit.  To
figure the RAW value, use the formula above and multiply the result by 1023.
I tried several different combinations of resistors.  I found it difficult to
make combinations where the values were not too close.
More or less switches can be added, but every addition doubles the amount of
combinations of switch closures.  This makes it harder to find workable
combinations and would slow down the processing of the information.


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



Message has 1 Reply:
  Mindstorms FAQ
 
I would love to start working with people on creating a MindStorms FAQ for new users. There is a definite need for a good one somewhere. -Kerry -- Did you check the web site first?: (URL) (25 years ago, 1-Jan-99, to lugnet.robotics)

22 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