Standard 24V PLC Input and Output Circuits - Page 1
Forum section: electronics / projects

author: fchk
author_rank: Frequent Contributor
timestamp: December 20, 2016, 02:50:58 pm
content: Hello_World();I'm about to start a PLC project. In order to avoid common mistakes and reinventing the wheel again I'm looking for proven standard designs for 24V optocoupled inputs and outputs with proper protection circuits. I've got no experience in the whole PLC business.Thanksfchk

author: CM800
author_rank: Frequent Contributor
timestamp: December 20, 2016, 03:08:13 pm
content: Quote from: fchk on December 20, 2016, 02:50:58 pmLet's start getting some information together:What is the maximum input frequency and maximum output frequency?What is the max input current acceptable?What is the max output current acceptable?Should the outputs be pull up, pull down or wirable for both?Should the pull up, pull down or work for both?Peak voltage designed for? (Do you want it 36V safe or 48V safe?)Isolation barrier required?

author: fchk
author_rank: Frequent Contributor
timestamp: December 20, 2016, 07:34:28 pm
content: >What is the maximum input frequency and maximum output frequency?Less than 1 kHz, not critical, can be less if this is a problem>What is the max input current acceptable?10...20mA (optocoupler current for led)>What is the max output current acceptable?100...250mA>Should the outputs be pull up, pull down or wirable for both?Common ground, positive side switched (PNP), should be able to drive an relay. Pull-down to ground for non-energized state.>Should the pull up, pull down or work for both?>Peak voltage designed for? (Do you want it 36V safe or 48V safe?)My plan was 40V, since components start to get more expensive when going over 40v>Isolation barrier required?yesfchk

author: CM800
author_rank: Frequent Contributor
timestamp: December 20, 2016, 07:49:03 pm
content: Now spend 2 minutes on the great machine called 'the google'http://i822.photobucket.com/albums/zz150/MoyanoJonathan/DISEOENTRADAS.jpghttp://www.electronics-tutorials.ws/articles/opto5.gif?x98918

author: nctnico
author_rank: Super Contributor
timestamp: December 20, 2016, 07:55:52 pm
content: The biggest mistake IMHO is to use optocoupler while having the same ground on both sides. This removes the need for the optocoupler. What has worked well for me as inputs is a series resistor (pulse proof and able to handle overload) and a zener + capacitor parallel. As an output you can use relays or P or N channels mosfets depending on sink or source outputs. Either way they need protection with a TVS and something fuseable like a 5 or 10 OHm series resistor may be wise. The TPIC6 series from TI has current and temperature limit so these may even be a better choice.

author: CM800
author_rank: Frequent Contributor
timestamp: December 20, 2016, 07:57:46 pm
content: Quote from: nctnico on December 20, 2016, 07:55:52 pmI'd ignore that and operate it separately. Just consider the grounds on either side of the optocoupler not connected.

author: max_torque
author_rank: Super Contributor
timestamp: December 20, 2016, 10:39:21 pm
content: Quote from: fchk on December 20, 2016, 02:50:58 pmQuote from: fchk on December 20, 2016, 02:50:58 pmIn that case, if it were me, i'd go and buy some existing PLCs and see how they do it. You may of course decide to do it differently, but only if you can come up with a valid engineering reason to do that!If it's just a hobby project, then what you do for I/O just needs to suit your application. For a commercial project, many more factors come into play, which existing PLCs will have all experienced and solved

author: Paul Moir
author_rank: Frequent Contributor
timestamp: December 21, 2016, 08:01:03 am
content: Sometimes they're fairly explicit in their manuals because sometimes it's important. For example here's an excerpt an old Siemens Step 7 manual:Not exactly rocket science.

author: Jeroen3
author_rank: Super Contributor
timestamp: December 21, 2016, 09:15:32 am
content: Quote from: fchk on December 20, 2016, 02:50:58 pmQuote from: fchk on December 20, 2016, 02:50:58 pmList of industrial automation vendors.But:8-Channel Digital Input Module for Programmable Logic Controllers (PLCs)And:Infineon Protected High-Side Switches for Industrial ApplicationsOr: Panasonic APF relays, they're little relays that don't use too much power.They work reliably, except when you try to use them to switchan arrayof 220V relays.Or just get Wago modules. They're cheap to buy and program, and very extensible.

author: salbayeng
author_rank: Frequent Contributor
timestamp: December 21, 2016, 09:45:15 am
content: Output drivers can be a bit tricky , BJT are more rugged than MOSFET, and you should put a PTC in there to limit current to say 100mA (RUEF010) , a SMD PTC is better as you can thermally bond it to the collector pad.You need to plan for(a) some fool shorting the output to +24v , so the transistor needs to hold the short long enough for the PTC to trip before the transistor melts, so will need something in SOT223 or bigger, If you put say a 2v zener (or LED if one is handy) from base to ground, and then put say 2ohms in the emitter leg, then the transistor turns into a 500mA current sink , it will be dissipating 12W for ~ 100msec until the PTC trips.(b) another fool connecting to a relay without a diode, best prevention is to use say a 100v transistor, and put a 50v MOV across it , another approach is put a capacitor (1nF) from base to collector, this slows down the slew rate, limits the inductive kickback, and removes the EMI.(c) another fool, has diode on relay but wires it the wrong way, see (a)(d) another fool wires up the relay base wrong so mains voltage appears on your driver line, need a fuse or a 5ohm "flameproof" resistor (cheaper than fuses, do the same job)I normally use MOSFETs if I have some control of the external wiring. See fig below of typical output.If you are uncertain about what the user might connect to your input optos (eg 5vDC , 24vDc, 24VAC) , then use "ACinput " optocouplers, (they have back to back LED's) ,In conjunction with current limiters made from back to back JFETS (or Depletion MOSFETS e.g. BSP149). Should probably put a 50v MOV on the input too, but place a 5ohm "flameproof" resistor in front to act as a fuse or a "mains rated" PTC likehttp://au.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyCMF-RL50A-0See schematic below of typical input.Note the BSP149 has a -1v threshold so connect a resistor between gate/source to get 1v at the desired current, eg 220ohm is close to 5mA , 1k is 1mA , etc

author: jbb
author_rank: Super Contributor
timestamp: December 21, 2016, 10:41:46 pm
content: If you want something pre-cooked, Silabs have an interesting part:http://www.silabs.com/Support%20Documents/TechnicalDocs/Si838x-DataSheet.pdfIt's got 8x bipolar inputs (common COM terminal, though) and either 8 pin parallel out or an SPI interface. Look around page 19 of the datasheet for a suggested PLC input. (You'll probably need some ESD/idiot protection.)

author: salbayeng
author_rank: Frequent Contributor
timestamp: December 22, 2016, 03:08:09 am
content: Silabs have some good parts, I've used some of their isolators for serial and I2C before.This one doubles as a port expander, so that's very useful.

author: pyroesp
author_rank: Regular Contributor
timestamp: December 22, 2016, 05:45:55 am
content: There's also OpenPLC, which might be interesting to take a look at.http://www.openplcproject.com/concept-hardware

author: Monkeh
author_rank: Super Contributor
timestamp: December 22, 2016, 06:53:53 am
content: Quote from: pyroesp on December 22, 2016, 05:45:55 amInteresting is one way to put it. I guess 74HC04s are cheaper than code these days?