WAY off topic...but PIC related

Started by swinginguitar, July 12, 2012, 09:33:42 AM

Previous topic - Next topic

swinginguitar

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....

...in order to amplify a bunch of them, would you use a Darlington array IC, or Hex buffer, or ....??

Seljer

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

swinginguitar

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)

Processaurus

#3
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?