PLC Basics for Makers: Ladder Logic, I/O, and When to Use a PLC Instead of a Microcontroller
This site has covered specific industrial PLC integrations before — programming a SureServo drive over Modbus, wiring a FANUC robot into a Productivity PLC cell — but never the basics: what a PLC actually is, how ladder logic reads, and when reaching for one makes more sense than an ESP32 or Arduino. If you've only ever automated things with a microcontroller sketch, PLCs can look like a different universe of vocabulary (rungs, scan cycles, normally-open contacts) for a job that seems conceptually similar. This guide bridges that gap for makers who are starting to outgrow hobby boards for anything involving mains voltage, safety-critical machine control, or a system that has to run unattended for years without a firmware update.
What a PLC Is, and Why It's Not Just an Arduino
A Programmable Logic Controller is an industrial computer built around one job: reading a set of inputs, running a control program, and driving a set of outputs, over and over, forever, in an environment that would kill a hobby board. The differences that matter for makers deciding whether to use one:
- I/O is isolated and rated for real-world voltages. PLC inputs commonly accept 24V DC or 120/240V AC directly, and outputs are relay or transistor stages rated to switch real loads — no level shifters, no optoisolator breakout boards, no separate driver circuit.
- The scan cycle is deterministic. A PLC reads all inputs, executes the entire program, and updates all outputs in one predictable cycle, typically a few milliseconds. There's no delay() call blocking anything and no interrupt priority juggling — every rung runs, every scan, in order.
- It's built to survive. Industrial PLCs are rated for wide temperature ranges, vibration, electrical noise, and continuous duty for years, and most support hot-swappable I/O modules and battery-backed memory that survives power loss.
- Programming is ladder logic, not C. This is the biggest mental shift — see below.
The tradeoff is cost and complexity: even an entry-level PLC (Click, AutomationDirect, or similar) plus I/O modules costs more than an ESP32 and a relay board, and ladder logic has a learning curve if you've only written imperative code. For a hobby WiFi sensor or a one-off automation, a microcontroller is still the right tool. A PLC earns its keep when you need mains-voltage I/O without building your own isolation circuitry, when a control failure could hurt someone or destroy expensive material, or when the system needs to run reliably for years with no one around to reflash it.
Reading Ladder Logic
Ladder logic is drawn to resemble an electrical relay schematic turned sideways — two vertical "rails" representing power, with horizontal "rungs" between them containing the logic. Each rung is evaluated left to right, and if the conditions on the left are true, the output on the right energizes.
SymbolNameMeaning —| |—Normally-open (NO) contactPasses power when the referenced input/bit is TRUE (like reading a variable as true) —|/|—Normally-closed (NC) contactPasses power when the referenced input/bit is FALSE —( )—Output coilSets a bit or energizes a physical output when the rung's logic is true —(L)—Latch (set) coilSets a bit TRUE and holds it, even after the rung goes false, until explicitly unlatched —(U)—Unlatch (reset) coilClears a latched bit TON / TOFTimer on/off delayDelays turning a bit on or off by a configured time CTU / CTDCounter up/downIncrements or decrements a count on each rising edge of an inputA simple example: a motor start/stop circuit with a seal-in (hold) contact reads as "Start button OR (Motor Running AND NOT Stop button) energizes Motor Running." In ladder form, that's a Start contact in parallel with a Motor Running contact (the seal-in, so releasing the start button doesn't stop the motor), in series with a normally-closed Stop contact, driving a Motor Running output coil. This pattern — a self-latching output using its own contact — is one of the first things every PLC tutorial teaches because it shows up everywhere: any process that needs to "stay on" once triggered until something explicitly stops it.
Inputs, Outputs, and Wiring Basics
PLC I/O is organized into addressed points — X0, X1... for inputs and Y0, Y1... on some platforms, or I:0/0, O:0/0 style addressing on others, varying by manufacturer. Two wiring conventions matter for makers coming from 3.3V/5V logic:
- Sourcing vs. sinking: a sourcing (PNP) output supplies positive voltage to the load when active; a sinking (NPN) output connects the load to ground when active. Mixing conventions between a PLC and a sensor is a common first-project wiring mistake — check both devices' datasheets before wiring.
- Isolated I/O commons: input and output banks often have separate common terminals, sometimes on separate isolated power supplies, specifically so a fault on the output side (driving a motor contactor) can't feed back into the input side (reading a sensor). Don't assume every terminal on the same block shares a ground.
Entry-level PLCs aimed at hobbyists and small automation shops — AutomationDirect's Click series is a common starting point — ship with free programming software and enough onboard I/O to run a small machine without add-on modules, making them a reasonable first PLC to learn on before touching a full rack-mounted industrial system.
Safety Considerations
PLCs are frequently used specifically because they're driving something dangerous — a motor, a heater, a pneumatic actuator, mains voltage. A few things that matter more here than in typical maker electronics:
- An emergency stop circuit should be hardwired through the PLC, not implemented purely in software as a ladder rung — a genuine E-stop needs to physically break power to the hazard independent of whatever the program is doing, using a dedicated safety relay or safety-rated PLC input where the application warrants it.
- Never work on PLC I/O wiring while output-side power is live, especially on modules switching mains voltage or driving motor contactors.
- Label wiring and document your ladder program — a PLC installation that outlives your memory of why you wrote a rung a certain way is the entire point of using one, so treat documentation as part of the deliverable, not an afterthought.
When to Reach for a PLC Instead of an ESP32
Use a MicrocontrollerUse a PLC Low-voltage sensing, WiFi/BLE connectivity, rapid prototypingMains-voltage I/O, motor/heater control, safety-relevant machine control One-off or hobby project, comfortable reflashing firmwareSystem needs to run for years without a maintainer present Complex logic, math, displays, or networkingSimple, deterministic on/off and timing logic with real-world electrical noise Budget-constrained, sub-$20 controllerReliability and field-serviceability matter more than unit costNone of this replaces the specific integration guides already on this site for particular PLC/servo/robot combinations — think of this as the on-ramp to those. Once ladder logic and I/O wiring conventions make sense, the more advanced Modbus RTU and EtherNet/IP integration content here will read very differently than it does the first time through.
Related Guides
- FANUC Robot to AutomationDirect Productivity PLC: EtherNet/IP UOP I/O, Custom DI/DO, and Turck Safety Block Cell Integration
- Implementing Material Pre-heating for Production
- How to Use the Flipper Zero as a USB Rubber Ducky
- Automated Plant Watering System with Raspberry Pi
- Running Home Assistant on a Raspberry Pi 4
- Auto-Backup Your Raspberry Pi SD Card to a Network Share
- Kiosk Mode on Raspberry Pi: Boot Straight to a Webpage
- Using Flipper Zero as a USB Rubber Ducky (BadUSB)