PLC Hardware and I/O Wiring
Identify PLC modules, size a power supply, wire sinking and sourcing devices, connect 4-20 mA signals, and protect outputs and terminals.
Table of contents
Most PLC problems do not start in the program. They start in the wiring: a sensor on the wrong common, a shield tied at both ends, a stray strand across two terminals. If you can read a PLC's hardware and wire it cleanly, you solve the problems that take up most of a controls technician's day. This guide covers what is in the rack and how field devices connect to it.
What You Will Be Able to Do
- Name the main hardware parts of a PLC, and what each one does.
- Size a 24 V DC power supply with enough margin.
- Choose the right input and output type for a device.
- Wire sinking and sourcing devices, including a 3-wire sensor.
- Connect a 4-20 mA signal and work out what it means.
Warning: A PLC panel often contains 120 or 480 volts next to 24 V DC wiring, and a PLC output can start a machine. Lock out before you change wiring. Work on energized panels is for qualified people only.
What Is in the Rack
| Part | What it does |
|---|---|
| Power supply | Converts 120 or 240 V AC to the DC the PLC needs |
| CPU | Runs the program, handles I/O and networks, reports faults |
| Input modules | Bring in signals from field devices |
| Output modules | Send commands to field devices |
| Communication modules | Connect to drives, operator panels and other PLCs |
A compact PLC has all these in one body, with room for a few add-ons. A modular PLC has a backplane or rail, with a card for each function. Module slots are numbered, and the configuration in the software must match what is really in the rack.
Sizing the Power Supply
Add up the current draw of the CPU, the modules and any field devices the supply feeds. Then allow at least 20 percent more.
Worked Example: A 24 V DC Supply
A panel has a CPU drawing 0.6 amps, I/O modules drawing 0.8 amps and 12 sensors at 0.05 amps each.
- Sensors: 12 x 0.05 = 0.6 amps.
- Total: 0.6 + 0.8 + 0.6 = 2.0 amps.
- Add 20 percent: 2.0 x 1.2 = 2.4 amps.
- Pick the next size up, a 5-amp supply, which also leaves room to grow.
Many panels feed sensors and output loads from a separate supply, so that a field short does not take down the CPU.
Inputs
Digital Inputs
A digital, or discrete, input reads ON or OFF. Pushbuttons, limit switches, proximity sensors, photo eyes and relay contacts are all digital. Common voltages are 24 V DC and 120 V AC.
Each input has a status LED on the module. It lights when the module sees voltage at that terminal. Modules also filter the signal for a few milliseconds, so contact bounce and noise do not create false readings.
Analog Inputs
An analog input reads a value that can change smoothly, such as pressure, level, flow or temperature. The module converts that into a number, using an analog-to-digital converter.
| Signal | Where it is used |
|---|---|
| 4-20 mA | Process instruments, the most common |
| 0-10 V DC | Shorter runs, HVAC and drives |
| RTD | Precise temperature, as a resistance |
| Thermocouple | High temperature, as a small voltage |
A module's resolution is how finely it can divide the signal. A 12-bit module has 4,096 steps, and a 16-bit module has 65,536.
Outputs
Digital Outputs
Digital outputs turn things on and off, such as coils, solenoids and lamps.
| Type | Switches | Good for | Watch out for |
|---|---|---|---|
| Relay | AC or DC | Mixed voltages, infrequent switching | Slow, and contacts wear out |
| Transistor | DC only | Fast, frequent switching | Sensitive to shorts |
| Triac | AC only | AC loads, frequent switching | Heat, and a small leakage current |
Leakage from a triac output can keep a small relay or pilot lamp on after the output is off. A loading resistor fixes this.
Analog Outputs
Analog outputs send a changing signal, usually 4-20 mA or 0-10 V DC. Common uses are a drive's speed reference, a proportional valve or a damper actuator.
Sinking and Sourcing
Sinking and sourcing describe which way DC current flows at a device.
- A sourcing device supplies current. It connects the load to the positive side.
- A sinking device takes in current. It connects the load to the negative side.
The rule is simple: a sourcing device has to pair with a sinking device. One pushes current and the other receives it. Two sourcing devices, or two sinking devices, make no complete path, and nothing works.
| Device | Type |
|---|---|
| PNP sensor | Sourcing |
| NPN sensor | Sinking |
| Sinking input module | Pairs with a PNP sensor |
| Sourcing input module | Pairs with an NPN sensor |
Module manuals sometimes use these terms differently, so check the wiring diagram for your module. On many modules, the way you wire the common sets the mode. In North America, PNP sensors with sinking inputs are widely used, because a wire that shorts to ground will not turn on an input.
Wiring a 3-Wire Sensor
A 3-wire proximity sensor usually uses these colors:
| Wire | Goes to |
|---|---|
| Brown | +24 V DC |
| Blue | 0 V DC |
| Black | PLC input terminal |
The black wire is the signal in both NPN and PNP sensors. What changes is what the sensor does to it. A PNP sensor connects black to +24 V when it detects a target. An NPN sensor connects black to 0 V. Your input module must be wired for the type you have.
When a Sensor Does Not Work
- Measure 24 V between brown and blue, at the sensor.
- Check the sensor's own LED, as you put a target in front of it.
- Measure the signal at the input terminal.
- Check the module LED.
- Check the input status in the software.
If the module LED lights but the software does not show the input, suspect the module or the configuration.
Wiring a 4-20 mA Loop
A 4-20 mA signal is a current loop. Current stays the same along the whole loop, so a long wire run does not change the reading. It also makes faults obvious. If the signal reads 0 mA, the wire is broken, since a healthy loop never falls under 4 mA.
Most transmitters are 2-wire, meaning the loop wires also power the instrument. The loop runs from the +24 V supply through the transmitter, into the analog input and back to 0 V.
To convert a signal to a process value:
Value = (mA - 4) / 16 x range
Worked Example: A Tank Pressure
A transmitter is set for 0 to 150 PSI. It reads 10 mA.
- Subtract the 4 mA offset: 10 - 4 = 6.
- Divide by the 16 mA span: 6 / 16 = 0.375.
- Multiply by the range: 0.375 x 150 = 56.25 PSI.
Some modules give a raw count that the program must scale into engineering units, so check the module's manual.
Good Wiring Practice
Most intermittent faults come from poor wiring.
- Use ferrules on stranded wire. A ferrule keeps every strand in the terminal. A stray strand can short to the terminal next to it.
- Label both ends of every wire. Use the wire number from the drawing, or the I/O address.
- Use shielded cable for analog signals. Ground the shield at one end only, typically at the PLC. A shield grounded at both ends lets current flow on it, and that adds noise.
- Separate power and signal wiring. Run them in separate raceways or wire ducts. A common guideline is at least 12 inches between parallel runs of power and signal. Cross at right angles.
- Fuse outputs, singly or in small groups, so that a shorted field device does not destroy a module.
- Keep commons straight. Modules group terminals on shared commons, and mixing supplies on one common causes strange faults.
Protecting Outputs From Coils
A coil stores energy in its magnetic field. When the output turns off, the collapsing field creates a voltage spike that can damage output modules, burn relay contacts and create noise.
- On DC coils, connect a diode across the coil, with the stripe toward the positive side.
- On AC coils, use an RC snubber or a metal oxide varistor.
Many contactors and solenoids offer plug-in suppressors for this.
Communications
PLCs connect to drives, operator panels and other equipment over networks.
| Network | Notes |
|---|---|
| EtherNet/IP | Common with Allen-Bradley systems |
| PROFINET | Common with Siemens systems |
| Modbus TCP | An open protocol on Ethernet |
| DeviceNet, PROFIBUS | Older fieldbus networks, still in service |
| RS-232, RS-485 | Serial links to instruments and older devices |
Industrial Ethernet uses the same kind of cable as an office network, but it needs industrial-rated connectors and careful routing away from drive cables. Do not plug a plant network into an office switch without talking to your controls group.
Safety Circuits
A standard PLC is not a safety device. E-stops, light curtains and guard switches are normally wired through a safety relay or a safety-rated controller, and they remove power from the outputs directly. A PLC may monitor them, but ordinary logic alone must not be what keeps someone safe. Never jumper a safety device to get a machine running.
Common Mistakes
| Mistake | What it costs |
|---|---|
| NPN sensor on a module wired for PNP | An input that never turns on |
| Shield grounded at both ends | Noisy, jumpy analog readings |
| No suppression on a coil | Damaged outputs and random resets |
| Bare stranded wire in a terminal | Intermittent shorts |
| Analog wires next to motor leads | Unstable process values |
| Loading a supply to its limit | CPU faults when outputs switch on |
Check Your Understanding
1. A panel needs 3.5 amps of 24 V DC. What is the smallest size you should use?
3.5 x 1.2 = 4.2 amps, so use a supply rated at least that high, such as 5 amps.
2. Which output type do you choose for a fast 24 V DC solenoid that switches several times a second?
A transistor output, because it switches DC fast and has no contacts to wear.
3. A level transmitter is set for 0 to 20 feet and reads 12 mA. What is the level?
(12 - 4) / 16 x 20 = 10 feet.
4. An analog input shows 0 mA. What does that tell you?
The loop is broken or the transmitter has no power, because a healthy signal never goes under 4 mA.
5. A PNP sensor wired to a sourcing input never turns on. Why?
Two sourcing devices cannot make a complete path. The input needs to be sinking.
Key Takeaways
- A PLC has a power supply, CPU, input and output modules, and communication modules.
- Size power supplies for at least 20 percent over the calculated load.
- A sourcing device has to pair with a sinking device.
- Digital signals are on or off. Analog signals are ranges of values, such as 4-20 mA.
- Ground analog shields at one end, usually at the PLC, and keep them away from power.
- Use ferrules, fuses and coil suppression to prevent most nuisance faults.