+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 29
  1. #1
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Interfacing interlocks with pic controller

    Click image for larger version. 

Name:	sen_1.jpg 
Views:	3 
Size:	46.9 KB 
ID:	151354

    In my project i'm going to interface thermal overload interlock,compressor overload interlock with PIC18F4520 controller.
    Interlock having two terminals,when the actual value is greater than set value means two terminals will CLOSE and make an loop.

    An negative supply from the +5VDC is connected to one terminal of interlocks and another terminal is connected to PIC controller for sensing.When the interlock is closed means PIC have detect it.

    My doubt is,
    Is this correct way for input sensing or have to use optocouplers or some other methos have to follow

  2. #2
    Super Moderator
    Points: 255,029, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,441
    Helped
    13537 / 13537
    Points
    255,029
    Level
    100

    Re: Interfacing interlocks with pic controller

    Anything goes. Problems you need to be aware of are safe isolation of interlock wiring to power circuits, required noise immunity, possible safety related control requirements.

    Most interlock circuits are using normal closed rather than normally open contacts. They are connected in a loop so that any contact opening stops the machine.



    •   AltAdvertisment

        
       

  3. #3
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by FvM View Post
    Anything goes. Problems you need to be aware of are safe isolation of interlock wiring to power circuits, required noise immunity, possible safety related control requirements.

    Most interlock circuits are using normal closed rather than normally open contacts. They are connected in a loop so that any contact opening stops the machine.
    How to reduce noise in the circuit..?
    It is good when 0.1uF capacitor is added across the connector..?



  4. #4
    Super Moderator
    Points: 255,029, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,441
    Helped
    13537 / 13537
    Points
    255,029
    Level
    100

    Re: Interfacing interlocks with pic controller

    It is good when 0.1uF capacitor is added across the connector..?
    Sounds reasonable. Overvoltage protection/current limiting towards the uC would be a good idea, too.


    1 members found this post helpful.

  5. #5
    Super Moderator
    Points: 73,784, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,972
    Helped
    3411 / 3411
    Points
    73,784
    Level
    66

    Re: Interfacing interlocks with pic controller

    Hi,

    What is the interlock contact rating?
    If it is for small signals like 5V / 100mA then your solution is basically OK.

    If it is for high voltage, high current AC ....: then you should consider to use higher voltage combined with higher (swtiching current) maybe use an RC to cause a higher peak switching current. Maybe 24V switching voltage.
    The problem with high voltage high current contacts is, that they need this high voltage to keep the contacts free from an oxide at the surface.

    Noise:
    Not only noise, you also need to protect your microcontroller inputs against ESD. (high speed, high voltage pulses of low energy in both polarities)
    --> use proper RC filtering. --> not only a "C" but combined with an "R". With this you are able to get a calculable delay. The delay time should be bigger than the expected noise time constant - including contact bouncing.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

  6. #6
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by KlausST View Post
    Hi,

    What is the interlock contact rating?
    If it is for small signals like 5V / 100mA then your solution is basically OK.

    If it is for high voltage, high current AC ....: then you should consider to use higher voltage combined with higher (swtiching current) maybe use an RC to cause a higher peak switching current. Maybe 24V switching voltage.
    The problem with high voltage high current contacts is, that they need this high voltage to keep the contacts free from an oxide at the surface.

    Noise:
    Not only noise, you also need to protect your microcontroller inputs against ESD. (high speed, high voltage pulses of low energy in both polarities)
    --> use proper RC filtering. --> not only a "C" but combined with an "R". With this you are able to get a calculable delay. The delay time should be bigger than the expected noise time constant - including contact bouncing.

    Klaus
    It's mechanical type,there is no electrical operation inside interlock.When the actual value above set value,the contact will close.
    10R resistor series with 01.uF is enough for RC filtering..?

    - - - Updated - - -

    Shall we use dual diode to reduce ESD..?



  7. #7
    Super Moderator
    Points: 73,784, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,972
    Helped
    3411 / 3411
    Points
    73,784
    Level
    66

    Re: Interfacing interlocks with pic controller

    Hi,

    It's mechanical type,there is no electrical operation inside interlock.When the actual value above set value,the contact will close.
    And it has no contact rating???? and bouncing time...

    10R resistor series with 01.uF is enough for RC filtering..?
    tau = R x C

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisment

        
       

  8. #8
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by KlausST View Post
    Hi,


    And it has no contact rating???? and bouncing time...


    tau = R x C

    Klaus
    2A and they didn't mention any bouncing time..



  9. #9
    Super Moderator
    Points: 255,029, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,441
    Helped
    13537 / 13537
    Points
    255,029
    Level
    100

    Re: Interfacing interlocks with pic controller

    Any mechanical switch involves bouncing (10 ms range). Bouncing must not necessarily be a problem in this application, software can filter the signals.

    I would however place series resistors to the uC input so that e.g. inadvertently applied 24V control voltage don't damage it. But that's a matter of your device specification.



    •   AltAdvertisment

        
       

  10. #10
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by FvM View Post
    Any mechanical switch involves bouncing (10 ms range). Bouncing must not necessarily be a problem in this application, software can filter the signals.

    I would however place series resistors to the uC input so that e.g. inadvertently applied 24V control voltage don't damage it. But that's a matter of your device specification.
    When the switch is closed negative +5VDC will come to uC for sensing..
    Shall we use series resistor in GND path..?

    - - - Updated - - -

    Click image for larger version. 

Name:	1318_800.jpg 
Views:	1 
Size:	340.9 KB 
ID:	151398

    In another machine I noted,they used this type inductor in input sensing path of uC.They also used GND for sensing with interlocks.When Interlock switch close,GND will flow to the uC.

    Is this advice-able..?



  11. #11
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Shall we use ESD protected IC for input sensing..?



  12. #12
    Super Moderator
    Points: 78,711, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,891
    Helped
    4304 / 4304
    Points
    78,711
    Level
    68

    Re: Interfacing interlocks with pic controller

    I've never seen an application that needed an inductor to protect a PIC. A series resistor and maybe a small capacitor to ground should be more than sufficient. If you really are expecting extreme voltages on the interlock connection (very rare) use protection diodes at the PIC pin. I have used interlock wires >10m long in very noisy environments and only used a resistor/capacitor/diode combination and they have never failed in years of operation.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  13. #13
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by betwixt View Post
    I've never seen an application that needed an inductor to protect a PIC. A series resistor and maybe a small capacitor to ground should be more than sufficient. If you really are expecting extreme voltages on the interlock connection (very rare) use protection diodes at the PIC pin. I have used interlock wires >10m long in very noisy environments and only used a resistor/capacitor/diode combination and they have never failed in years of operation.

    Brian.
    Click image for larger version. 

Name:	image_2.png 
Views:	2 
Size:	7.4 KB 
ID:	151498

    Like this are you saying..?



  14. #14
    Super Moderator
    Points: 73,784, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,972
    Helped
    3411 / 3411
    Points
    73,784
    Level
    66

    Re: Interfacing interlocks with pic controller

    Hi,

    Shall we use ESD protected IC for input sensing..?
    Yes: if you expect ESD
    No: if you donīt expect ESD

    If ESD: caused by humans or by metallic devices? Whatīs the application?
    ESD isnīt ESD.

    ESD caused by humans standing on wood floor is low energy.
    But Iīve seen stackers in textile industry causing about 20cm wide sparks when they come close to a metal shelf.

    What is the expectable situation you want to protect the PIC against?
    You may say:
    * just typical human body ESD
    * protection against wrong wiring.. maybe at 230V AC maybe at 24V DC...
    * lightning fash
    * or something else. We can not know your situation.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  15. #15
    Super Moderator
    Points: 78,711, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,891
    Helped
    4304 / 4304
    Points
    78,711
    Level
    68

    Re: Interfacing interlocks with pic controller

    An interlock input is a 'go/no-go' logic input and the only real considerations are whether noise can exceed the logic thresholds and how quickly it has to react. Bearing in mind that you have a pull-up resistor to keep the sense line high if the interlock switch is open, the impedance at the PIC is relatively low (1K according to your original post) so it would take a large amount of capacitive or inductive coupled signal to cause any problem. I'm not sure why interlock wiring should be subject to ESD at all but if you want to be absolutely safe, increase the pull-up resistor to say 22K and wire TWO 1K resistors in series with a small Schottky diode (BAT85 or similar) from the junction to ground and another from the junction to VDD. That will let the first (interlock side) resistor absorb any discharges and the second one will further protect the PIC input. If you are worried about high frequency noise, add a capacitor of about 10nF from the PIC input to VSS, it will make a low pass filter in conjunction with the two 1K resistors.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  16. #16
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Quote Originally Posted by betwixt View Post
    An interlock input is a 'go/no-go' logic input and the only real considerations are whether noise can exceed the logic thresholds and how quickly it has to react. Bearing in mind that you have a pull-up resistor to keep the sense line high if the interlock switch is open, the impedance at the PIC is relatively low (1K according to your original post) so it would take a large amount of capacitive or inductive coupled signal to cause any problem. I'm not sure why interlock wiring should be subject to ESD at all but if you want to be absolutely safe, increase the pull-up resistor to say 22K and wire TWO 1K resistors in series with a small Schottky diode (BAT85 or similar) from the junction to ground and another from the junction to VDD. That will let the first (interlock side) resistor absorb any discharges and the second one will further protect the PIC input. If you are worried about high frequency noise, add a capacitor of about 10nF from the PIC input to VSS, it will make a low pass filter in conjunction with the two 1K resistors.

    Brian.
    Click image for larger version. 

Name:	img_3.jpg 
Views:	6 
Size:	21.1 KB 
ID:	151584

    Is this circuit is correct..?



  17. #17
    Super Moderator
    Points: 28,982, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,630
    Helped
    1096 / 1096
    Points
    28,982
    Level
    41
    Blog Entries
    8

    Re: Interfacing interlocks with pic controller

    Both D1, C1 do nothing there.
    You grounded the net that would carry a signal accross them.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  18. #18
    Super Moderator
    Points: 73,784, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,972
    Helped
    3411 / 3411
    Points
    73,784
    Level
    66

    Re: Interfacing interlocks with pic controller

    Hi,

    No. Donīt you recognize
    * that the left pin of R2 is +5V ... always, never changing
    * that the right pin of R2 is GND ... always, never changing

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  19. #19
    Super Moderator
    Points: 78,711, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,891
    Helped
    4304 / 4304
    Points
    78,711
    Level
    68

    Re: Interfacing interlocks with pic controller

    That isn't quite what I described!

    Remove the +5V connection.
    Remove D1 and the ground connection between D1 and R2.
    Add TWO small signal Schottky diodes, one with cathode to +5V and anode to the junction of R1 & R2, the other with cathode to the junction of R1 & R2 with its anode to ground. (both arrow symbols facing toward +5V)

    The idea is the diodes do nothing under normal conditions but if the 'INPUT' goes below ground, the ground side diode conducts current away and if 'INPUT' goes higher than +5V the other diode conducts the current safely into the supply line. It should clamp any voltage reaching the PIC to within safe levels and therefore protect it.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisment

        
       

  20. #20
    Full Member level 5
    Points: 1,807, Level: 9

    Join Date
    Sep 2016
    Posts
    288
    Helped
    1 / 1
    Points
    1,807
    Level
    9

    Re: Interfacing interlocks with pic controller

    Click image for larger version. 

Name:	img_4.jpg 
Views:	3 
Size:	42.5 KB 
ID:	151586

    Is this is correct..?
    Capacitor is place in correct position..?

    - - - Updated - - -

    Quote Originally Posted by venkates2218 View Post
    Click image for larger version. 

Name:	img_4.jpg 
Views:	3 
Size:	42.5 KB 
ID:	151586

    Is this is correct..?
    Capacitor is place in correct position..?
    Diode value is BAT54.Sorry for mistake



--[[ ]]--