PIC Input Vs Cable Length


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240

    Smile PIC Input Vs Cable Length

    Hi;

    Please if possible give me your advice regarding the attached circuit.

    It the schematic i have 1 type of circuit connected to one input of the PIC and another type of circuit connected to other input.
    The final schematic is to make an alarm system.

    My concern is how I should do to make the system more reliable in the inputs of the micro controller, because I can have PIR detectors at about 200 meters away and cable can be close to the electrical house system, which can cause all types of interferences.
    As you can see, in the first input i only have a Pull-Up resistor and capacitor, in the second input, I also include a TVS and more caps and resistors?

    What is the opinion of you guys regarding the type of circuit that I should put on the input of the PIC? Or, what you usually do in cases like this?

    (Opto here is not an option, because i can just have a simple switch instead of a PIR )
    Attached Images Attached Images  
    Thanks and Regards;
    Gadelhas

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: PIC Input Vs Cable Length

    Good, I have the same requirement for my alarm project. My garage is 2 stories, 40ft long, so max might be 2x50ft, so 100ft round trip for switch on far window.

    Robert

  3. #3
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: PIC Input Vs Cable Length

    Quote Originally Posted by Demon View Post
    Good, I have the same requirement for my alarm project. My garage is 2 stories, 40ft long, so max might be 2x50ft, so 100ft round trip for switch on far window.

    Robert
    I probably should go to my second design ( Circuit connected to RC3 ), however i would like to know some opinions about the designs that guys are doing regarding this matter!

    Let's see if someone tell us something Robert!
    Thanks and Regards;
    Gadelhas

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: PIC Input Vs Cable Length

    I'm not sure how to draw a picture for you, but here's my opinion in text. There are three basic considerations.

    1) Will the circuit work? The wire has a resistance you can look up based on it's size. You need to make sure the voltage divider created with the pull up resistor and the wire resistance is such that the PIC can detect a low, in your configuration. No issue with either approach, but since there is more margin between what the PIC will see as a high and VDD than there is between what the PIC will see as a low and GND, you may wish to use the switch to pull up a normally low line, than to pull down a normally high one. Not a huge difference, but if you are getting into really long runs, eventually it might.

    2) Will the circuit falsely trigger? Long runs will pick up noise. The key to fighting this is low values in the pullup resistor, and high values in the decoupling cap. The tradeoff is the speed of operation of the switch. I think slower is better until you start to get into the seconds range, when it comes to alarm systems. The pull up resistor value is about right, but I'd be tempted to make the cap a bit bigger. Just stay with low ESR / ESL technologies, like ceramic caps.

    3) What happen with transients, like nearby lightning, or big motors starting, and so on? The TVS in your circuit isn't going to do much. You will find it's tolerance and speed is such that you will not be able to guarantee the pin is protected. You would do better with a dual diode right on the pin, arranged so that if the pin tries to go over VDD the current will go into the positive supply, and if the pin tries to go under 0 V the current will flow into GND. Then add a series resistor as you did, although I'd make it smaller in value. Too big can contribute to noise, too small limits the elasticity. The extra cap likely isn't necessary, although it will help slow things down and improve noise immunity. Slowing down transients also gives the protection diodes more time to start to do their job.

    To summarize: I'd recommend the second configuration, but with protection steering diodes right on the pin, slight value changes, and removal of the TVS.

  5. #5
    Join Date
    Apr 2011
    Posts
    53


    Did you find this post helpful? Yes | No

    Default Re: PIC Input Vs Cable Length

    Use twisted pair cable. Capacitive filters and (possibly) inductors - you can get three-terminal C-L-C filter components - would be acceptable. False triggering could be catered for in programming (similar to keyboard debounce).

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,598


    Did you find this post helpful? Yes | No

    Default Re: PIC Input Vs Cable Length

    Wouldn't an opto-coupler like MCT6 protect the pins?

    Robert
    Last edited by Demon; - 9th July 2013 at 15:42.

Similar Threads

  1. LCD cable length?
    By Art in forum General
    Replies: 27
    Last Post: - 14th February 2012, 15:35
  2. Max cable length?
    By Fredrick in forum Serial
    Replies: 8
    Last Post: - 2nd July 2010, 20:37
  3. Maximun Cable Length for PIC to LCD
    By wildbilly in forum mel PIC BASIC Pro
    Replies: 52
    Last Post: - 1st January 2008, 19:00
  4. Measure cable length with a PIC?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th July 2007, 18:45
  5. Cable Length Between Micros
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st June 2006, 14:29

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts