Re: 1 AIO for 3 buttons ( need to know combinatoin key )



rickman wrote:

CBFalconer wrote:
Geoff Field wrote:
bokiteam@xxxxxxxxxxxxxx wrote:

I have only 1 AIO, and I have to control 3 buttons.
I need to know the combination pressing event.

Could you please adviec do I need what external ciruit ? or just
resistor is enough?

Resistor-encoded switches are a very common means of doing
this job. Make sure you have sufficient gap between the voltages,
and allow a small band for error detection as well.

You can run the switches in series (with parallel resistors) or in
parallel (with series resistors), or in parallel so the resistors can
be shorted. Either way works. Serial connection allows you to read
combinations of switches easily, while parallel connection gives
you an easy way of prioritising the switches, particularly if you
wire them so that the higher priority ones completely mask out
the lower priority ones. This also makes the calculations easier.

Assuming AIO means analog input, the simplest method would be a
R/2R network. After calibration the binary voltage read will be a
complete description of the state of all the switches. This is
only limited by the precision of the resistors and the resolution
of the A/D converter. If the reference voltages at the encoder and
decoder are the same (another wire) then the calibration is
obviated. The switches would need to be SPDT. 1% resistors will
normally suffice for 6 or 7 switches (bits).

+----- R -----+----- R -----+------ R -----+-------> A/D
|
2R
|
o more 2R and switches in here
/ which I won't even try to draw.
o o Terminate network ends in 2R
| |
gnd |
+-----------+------------+---------------+------< VREF

Each node ('+' in top line) sees 2R impedance looking each way, in
parallel with an injection impedence of 2R. So injected voltage is
attenuated by two for each stage in the ladder. You can buy these
networks already nicely matched.

Now if you really want to do my homework for me, show me a circuit that
only requires SPST switches. Just kidding about the homework... <g>

Replace the switch with a complementary CMOS pair, to switch
between VREF and GND. Use a resistor pair in series from Vcc to
the gate, and a SPST to gnd at the resistor junction.
Piece-a-cake. Now you need to make sure that the value of R allows
for the gate impedances.

You can also invert the whole thing and inject currents, feeding
the output to a virtual ground at an op-amp input. Then the input
switches only need to shunt off the input current. Don't the
schools teach anything about A-D-A conversion these days?

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>


.