Author Topic: WAY off topic...but PIC related  (Read 2349 times)


WAY off topic...but PIC related
« on: July 12, 2012, 09:33:42 AM »
Asking this here because there are so many knowledgable people here -

when connecting a sensor or switch to a PIC over long distance (say 50' give or take), is it safe to assume you need to amplify the signal? BJT current amplifier perhaps.... order to amplify a bunch of them, would you use a Darlington array IC, or Hex buffer, or ....??


Re: WAY off topic...but PIC related
« Reply #1 on: July 12, 2012, 10:57:54 AM »
A switch: probably not

A sensor. maybe, depends on what you're measuring with what type of sensor.

In industrial enviroments, for very long cables to sensors current loops are used


Re: WAY off topic...but PIC related
« Reply #2 on: July 12, 2012, 12:02:20 PM »
OK...more info:

reading one of those magnetic switches like they use for window/door alarms...not sure if it's NO or NC yet (still theorizing), but i presume you tie one wire to PIC pin, and the other to +5v or ground and listen for hi/lo (depending)


Re: WAY off topic...but PIC related
« Reply #3 on: July 13, 2012, 07:58:43 AM »
You have a resistor from the PIC I/O pin being read to Vcc or ground, depending on what the switch connects to.  Example: There is a 100K pulldown resistor to ground from the I/O pin, and the switch connects the pin directly to Vcc.  You can't leave the pin floating when the switch is off, because the CMOS inputs are very high impedance, and can read ambient noise with several volts swing, and chatter back and forth between 1 and 0.

For your long line, you can just use a stiffer pulldown/pullup resistor, and it will lower the noise seen when the switch is disconnected.  5K might be a good starting point?
« Last Edit: July 13, 2012, 08:00:26 AM by Processaurus »