+ Reply to Thread
Results 1 to 10 of 10

Thread: Industrial I/O question

  1. #1
    jnnewton Okay
    Join Date
    Oct 2007
    Posts
    96

    Default Industrial I/O question

    I would like to implement some 24V I/O via a pic. I am having trouble deciding what type of protection is best. I have used standard 4n27 opto's with 1.3 Vf and 60mA If. This works with a 390 ohm input resistor, but what if the input voltage jumps up to say around 45V. I would like the input to come on between 18 and 45V, with 22-30 being normal and anything above 45 would be considered out of the design criteria for the system. So, with 45V, I get a 820 ohm resistor with a 3 W capability needed which even if i knew where to get one, would get very hot. Is there an easy way to do this??? what happens if I put a zener between the input and ground, say a 27V one. Would a TVS work also, ( I could then account for a reversed Input).. Thanks for any Ideas.


  2. #2
    crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent
    Join Date
    Mar 2008
    Location
    USA
    Posts
    3,025

    Default

    There's no easy way to reduce the power if you need 60mA to drive the 4N27.

    You might try a lower current opto coupler such as a Fairchild HSR312. It only requires 2mA input current which would lower your maximum power to less than 0.2W (using a 11K ohm resistor to give ~2mA @ 24V).

  3. #3
    Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent
    Join Date
    Mar 2006
    Location
    Michigan, USA (GMT-5)
    Posts
    2,892

    Default

    We use LM339/LM393 Comparators for inputs with 10K/100K input resistors to limit current in the case of overvoltage. There is no earthly reason why your inputs should ever be above the specified range.

    For outputs we use current limited high side and low side bipolar switches. MJD340/MJD350 work well for this application.

    Using opto-isolators introduces another set of reliability problems that you just don't need unless you have a really good reson for needing isolation. BTW most people who think they need it can't really justify it. It's kinda like IBM. Nobody ever got fired for buying IBM even when there were better alternatives
    We never have time to do it right; but we always have time to do it over.

  4. #4
    crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent
    Join Date
    Mar 2008
    Location
    USA
    Posts
    3,025

    Default

    Certainly if the 24V ground is common with the pic circuit common you don't need an opto isolator. However, if you're in an industrial environment where you may want to keep the grounds isolated, then an opto isolator may be needed.

  5. #5
    KMoffett Excellent KMoffett Excellent KMoffett Excellent KMoffett Excellent KMoffett Excellent
    Join Date
    Oct 2007
    Location
    Minneapolis MN USA
    Posts
    1,385

    Default

    Why would you use 60ma. That's the "absolute maximum" Ifwd for the 4N27.
    http://www.fairchildsemi.com/ds/4N/4N27-M.pdf
    And it has a current transfer ratio of only 10%. Why not choose a better opto? What's the current requirement on the output side?

    Ken
    "To invent, you need a good imagination and a pile of junk."
    Thomas A. Edison (1847 - 1931)

  6. #6
    crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent crutschow Excellent
    Join Date
    Mar 2008
    Location
    USA
    Posts
    3,025

    Default

    KMoffett has a good point. For example the 4N35/36/37 has a forward transfer ratio of about 0.5 at 1mA input which would thus switch 0.5mA at the output. This would give a 5V swing with a 10K ohm resistor connected to 5V which should be adequate for the pic input.

  7. #7
    Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent
    Join Date
    Mar 2006
    Location
    Michigan, USA (GMT-5)
    Posts
    2,892

    Default

    Quote Originally Posted by crutschow
    Certainly if the 24V ground is common with the pic circuit common you don't need an opto isolator. However, if you're in an industrial environment where you may want to keep the grounds isolated, then an opto isolator may be needed.
    True enough, but just because the environment is "industrial" does not mean that isolation is "required".

    It is also the case that the CTR(current transfer ratio) will degrade with age. You can anticipate a future time when the opto will fail to work acceptably without some careful component choices.
    We never have time to do it right; but we always have time to do it over.

  8. #8
    jnnewton Okay
    Join Date
    Oct 2007
    Posts
    96

    Default

    i know this is an old one, but to papabravo, we tried the lm239 comparators, and it appears that they are not rail to rail, so i would need a divider on the input, which leads me to ask, why not just use a divider into the pic input? we put 5v on the inverting input, 24 input on the non-inverting, on 24V rail, and apparently these things have issues when the inputs are close to the supply (within 2 or so volts).
    Last edited by jnnewton; 9th June 2009 at 06:20 PM.

  9. #9
    Chippie Excellent Chippie Excellent Chippie Excellent Chippie Excellent Chippie Excellent
    Join Date
    Mar 2003
    Location
    Good 'ole England
    Posts
    961

    Default

    [QUOTE=jnnewton;296011]I would like to implement some 24V I/O via a pic. I am having trouble deciding what type of protection is best. I have used standard 4n27 opto's with 1.3 Vf and 60mA If. This works with a 390 ohm input resistor, but what if the input voltage jumps up to say around 45V. I would like the input to come on between 18 and 45V, with 22-30 being normal and anything above 45 would be considered out of the design criteria for the system. QUOTE]

    Why set a design criteria and then move the goal posts?


    24v i/o on a pic....with 22-30v being normal....

    I would like the input to come between 18 and 45 volts.......and anything above.........

    Hmm! just read the orig date....


    Sounds like english politics
    Last edited by Chippie; 9th June 2009 at 07:56 PM.
    Eccentric millionaire financed by 'er indoors

  10. #10
    Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent Papabravo Excellent
    Join Date
    Mar 2006
    Location
    Michigan, USA (GMT-5)
    Posts
    2,892

    Default

    Quote Originally Posted by jnnewton View Post
    i know this is an old one, but to papabravo, we tried the lm239 comparators, and it appears that they are not rail to rail, so i would need a divider on the input, which leads me to ask, why not just use a divider into the pic input? we put 5v on the inverting input, 24 input on the non-inverting, on 24V rail, and apparently these things have issues when the inputs are close to the supply (within 2 or so volts).
    You don't use a divider on the PIC input because you're still vulnerable to extreme overvoltage. 100K in series with a high impedane input at least limits the current to the input. Comparator outputs are open collector so you always pull them up to the PIC's VCC -- no problem there. We use the comparators with one input at V/2 to establish a threshold. With window comparators we use V/3 and 2V/3. The other input can go all the way to the rail without causing the common mode input malfunction. You have to read the datasheet very carefully to find this -- it's in the notes. We also use diode clamps and PTC resetable fuses. AFAIK none of our industrial customers has EVER complained.
    Last edited by Papabravo; 9th June 2009 at 10:24 PM.
    We never have time to do it right; but we always have time to do it over.

+ Reply to Thread

Similar Threads

  1. Capacitor Charge/Discharge question
    By ThermalRunaway in forum General Electronics Chat
    Replies: 25
    Latest: 12th August 2008, 04:48 PM
  2. Super I/O for next kit, getting the most out of a single I/O pin
    By blueroomelectronics in forum Micro Controllers
    Replies: 33
    Latest: 24th February 2008, 04:49 PM
  3. Basic Transmission question
    By CamNuge in forum General Electronics Chat
    Replies: 2
    Latest: 8th March 2006, 10:08 PM
  4. High speed data logging question
    By cubdh23 in forum Micro Controllers
    Replies: 3
    Latest: 19th August 2004, 11:54 AM
  5. Data Logging question with high speed!!!!
    By cubdh23 in forum General Electronics Chat
    Replies: 4
    Latest: 16th August 2004, 06:33 PM

Tags for this Thread