Searching \ for 'Best way to read a switch on the end of a long wir' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=best+way+read+switch
Search entire site for: 'Best way to read a switch on the end of a long wir'.

Truncated match.
PICList Thread
'Best way to read a switch on the end of a long wir'
1999\04\16@222658 by Jim Ruxton

flavicon
face
Hi ,
I was wondering what people use on the PIC input to read a switch at
the end of a long wire. Presently I am using a 100k resistor in series
with the input pin and a .1uF cap to ground at the end of the resistor
which connects to the wire. I need 12 switches connected through 12 10
ft wires to 12 inputs. 12 .1uF caps take a lot of space. Any other
suggestions.
Jim

1999\04\16@231053 by Wagner Lipnharski

picon face
What about instead to run 12 wires 10 ft long, using 2 parallel serial
chips, for example the 74HCT165, installed close to the switches, so you
would only need to run wires for:

1)  +5V (to power the chips)
2)  Ground (and cable shielding)
3)  Shift/Load
4)  Clock Out
5)  Serial In.

By this way you can read 16 switches, and reduced quantity of filtering
capacitors.

If you really wants to use 12 wires, just use a PC printer shielded
cable. It has plenty of wires for that, and if I am not mistaken there
are 12 ft cables.  A pull-up resistor for each switch (close to the
switches), switches to common ground, probably it would not need any
filtering capacitors if you use some software debounce routine.


Jim Ruxton wrote:
>
> Hi ,
>  I was wondering what people use on the PIC input to read a switch at
> the end of a long wire. Presently I am using a 100k resistor in series
> with the input pin and a .1uF cap to ground at the end of the resistor
> which connects to the wire. I need 12 switches connected through 12 10
> ft wires to 12 inputs. 12 .1uF caps take a lot of space. Any other
> suggestions.
> Jim

1999\04\17@182748 by Jim Ruxton

flavicon
face
Hi
Thanks for the suggestion. I should have been clearer. The 12 switches
are each off in different directions at the end of a pair of wires. Your
suggestion is a great idea if they were all on the same panel ,
unfortunately they are not. Does anyone else have a suggestion how to
read a switch at the end of a 10 foot cable ? Right now it works with an
RC filter on the input. (100k in series .1 uF cap to ground)
Jim
>What about instead to run 12 wires 10 ft long, using 2 parallel serial
>chips, for example the 74HCT165, installed close to the switches, so
you
{Quote hidden}

1999\04\19@045408 by Stefan Sczekalla-Waldschmidt

flavicon
face
Hi,

if you can specifiy the things to use, I would recommend a
low resistance design:

use normal closed, open when actuated buttons. use a 1k2 or less
resistor to pull up at the pcb-(pic-input) side. protect the pic
input with 10K or so.

                 +5V

               |    |
               R    |
         1k2   R    |
               R    +
               R    A
               |    |
PIC ---RRRRR----*----*------ Long Line ----- |
       10K+         |                       |
                    +                  Switch normal closed
                    A                       |
                    |                       |
GND -----------------*--------Long Line -----|

Benefit, assuming the switch is normaly not acctuated, the input
to the pic is shorted to ground, prventing misreadings due to
noise.

Additional filtering could still be done - but here a debouncing
would be sufficient imho.

The Diodes ar for protecting the PIC against high e.g. static
voltages.

Kind regards,

       Stefan

1999\04\19@052318 by Michael Rigby-Jones

flavicon
face
Stefan wrote:

<snip>

{Quote hidden}

<snip>

With one side of the switch grounded, any induced current in the lines could
present a false state to the pic.  Hopefully the 2 wires to the switch will
be in close proximity so the currents in the lines will cancel.  However, a
more reliable way would be to drive one side of the switch with another pin
which could be toggled.  The input pin would read back the state of the
switch after toggling the state of the output pin.  If this is done several
times the effect of interference could be elliminated.  It would be a kind
of synchronous detection I guess.  Obviously another port pin would need to
be used, but it could drive many switches.

Regards

Mike Rigby-Jones

1999\04\19@060728 by Stefan Sczekalla-Waldschmidt

flavicon
face
Hi,

Michael Rigby-Jones wrote:
{Quote hidden}

I implied this without to mention it.
Right, optimum would be use of a twisted pair cable.

On the other hand, I expect inducted voltages as "high" impedance versus
resistance to gnd or 5V. Imho therefor this should not be problem.

> However, a
> more reliable way would be to drive one side of the switch with another pin
> which could be toggled.  The input pin would read back the state of the
> switch after toggling the state of the output pin.  If this is done several
> times the effect of interference could be elliminated.  It would be a kind
> of synchronous detection I guess.  Obviously another port pin would need to
> be used, but it could drive many switches.

Also a Interesting Idea.

>
> Regards
>
> Mike Rigby-Jones

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...