PLC Hardware: CPU, I/O Modules, and How They Connect to the Factory Floor
The Central Processing Unit (CPU)
The CPU is the brain of every PLC. It fetches the user program from memory, executes it once per scan cycle, and manages all communication with I/O modules and external devices.
Modern PLC CPUs contain several key components:
- Processor: executes the logic program, typically with scan times between 1 and 50 milliseconds
- Program memory: stores the user program (ladder logic, structured text, etc.), usually flash-based
- Data memory: holds variable values, timers, counters, and I/O image tables during runtime
- Communication ports: Ethernet, RS-232, RS-485, or proprietary connections for programming and networking
- Real-time clock: used for time-stamping events and scheduling operations
A Siemens S7-1200 CPU, for example, offers 100 KB of program memory, 75 KB of data memory, and a built-in Profinet Ethernet port. For a small packaging machine with 30 I/O points, this is more than sufficient. Larger systems like an S7-1500 provide megabytes of memory and sub-millisecond scan times for complex motion control.
Choosing the Right CPU
When selecting a CPU for a project, consider these factors:
- I/O count: how many digital and analog points does the application need?
- Program size: complex sequencing and recipe management require more memory
- Scan time requirements: high-speed counting or motion control demands faster CPUs
- Communication needs: how many HMIs, drives, and remote I/O stations must connect?
Digital Input Modules
Digital input modules read ON/OFF signals from field devices such as pushbuttons, limit switches, proximity sensors, and safety interlocks. Each input channel detects whether a voltage is present (logic 1) or absent (logic 0).
Common digital input specifications:
| Parameter | Typical Value |
|---|---|
| Voltage | 24V DC (most common), 120V AC, 230V AC |
| Current draw | 5-10 mA per point |
| Points per module | 8, 16, or 32 channels |
| Response time | 0.2 to 6 milliseconds |
| Isolation | Optocoupler between field and logic side |
Wiring a Digital Input
A typical 24V DC input wiring configuration for a proximity sensor on a conveyor:
- Connect the sensor's brown wire to +24V DC power supply
- Connect the sensor's blue wire to 0V DC (ground)
- Connect the sensor's black wire (signal output) to the PLC input terminal
- Connect the PLC input common terminal to 0V DC
The PLC reads this input during the input scan phase. When the sensor detects a metal object on the conveyor, it sends 24V to the PLC input, which appears as TRUE in the input image table.
Digital Output Modules
Digital output modules switch field devices ON or OFF based on program decisions. They drive contactors, solenoid valves, indicator lights, and alarms.
Three common output types exist:
- Relay outputs: mechanical contacts that can switch AC or DC loads up to 2A per point. Slower switching speed (about 10ms) but versatile for mixed voltage loads.
- Transistor outputs (DC): solid-state switching for 24V DC loads, very fast (under 1ms), ideal for high-speed applications like pulse outputs to stepper motors.
- Triac outputs (AC): solid-state switching for AC loads, faster than relays but limited to AC circuits.
Protecting Outputs
Always protect PLC outputs from inductive loads (motors, contactors, solenoid valves):
- DC loads: place a flyback diode across the coil, cathode toward the positive terminal
- AC loads: place an RC snubber circuit (typically 100 ohm + 0.1 uF) across the coil
Failing to protect outputs is the most common cause of PLC output module failure in the field.
Analog Input and Output Modules
Analog modules handle continuously variable signals rather than simple ON/OFF states. They are essential for measuring temperature, pressure, flow, level, and speed, and for controlling proportional valves and variable frequency drives.
Analog Inputs
Analog input modules convert a continuous electrical signal into a digital number the CPU can process:
- 4-20 mA current input: the industrial standard, immune to cable length and resistance variations
- 0-10 V voltage input: simpler wiring, but sensitive to cable length and electrical noise
- Thermocouple input: direct connection for Type J, K, T temperature sensors with built-in cold junction compensation
- RTD input: direct connection for PT100/PT1000 resistance temperature sensors
A typical 16-bit analog input converts a 4-20 mA signal to a raw integer value from 0 to 27648 (Siemens convention). The program then scales this to engineering units.
Analog Outputs
Analog output modules convert a digital value from the program into a continuous signal:
- 4-20 mA output: drives proportional valves, VFD speed references
- 0-10 V output: drives some VFDs and positioners
Power Supply and Rack
The power supply converts facility AC power (120V or 230V) to the regulated DC voltages needed by the PLC modules. In modular PLC systems, modules mount on a rack (also called a backplane) that provides power and a high-speed data bus between modules.
Power Supply Sizing
To size the power supply correctly:
- List every module in the rack and its current consumption from the datasheet
- Add the current required by field devices powered from the PLC (sensors on 24V output)
- Add a 20% safety margin
- Select a power supply that meets or exceeds this total
For a typical small system with a CPU, 2 digital input modules, 1 digital output module, and 1 analog input module, a 5A 24V DC power supply is usually sufficient.
Rack Configuration
Modular PLCs use numbered slots in the rack. The CPU always occupies a fixed position (usually slot 0 or 1). I/O modules fill the remaining slots and are automatically assigned addresses based on their slot position. This physical arrangement directly maps to the I/O addresses used in the program.
Connecting a PLC to the Factory: A Practical Diagram
Consider a small filling station with these field devices:
Inputs (sensors to PLC):
- Bottle-present sensor (proximity, 24V DC digital) on input I0.0
- Fill level sensor (4-20 mA analog) on analog input AI0
- Start pushbutton on input I0.1
- Stop pushbutton on input I0.2
- Emergency stop on input I0.3
Outputs (PLC to actuators):
- Fill valve solenoid (24V DC) on output Q0.0
- Conveyor motor contactor (24V DC coil) on output Q0.1
- Green run lamp on output Q0.2
- Red fault lamp on output Q0.3
The wiring follows a consistent pattern: sensors connect to input modules, actuators connect to output modules, and the CPU orchestrates everything through the program. Every wire terminates at labeled terminal blocks, and every circuit includes appropriate fuses or circuit breakers for protection.
This hardware foundation supports the programming techniques covered in the next lessons, where we will bring these inputs and outputs to life with Ladder Logic and Structured Text.
Summary
PLC hardware consists of a CPU for program execution, digital I/O modules for ON/OFF signals, analog modules for variable measurements and control, and a power supply mounted on a rack. Digital inputs read sensors through optocoupled isolation, digital outputs drive loads through relays or transistors, and analog modules convert between electrical signals and numerical values. Proper sizing of power supplies and protection of outputs from inductive loads are critical for reliable operation. Understanding the hardware is essential before writing the programs that will control it.