PLC Simulator
Controller fundamentals

PLC vs Microcontroller: What's the Difference (and When to Use Each)

Both read inputs and switch outputs — so why does a factory pay hundreds for a PLC when a microcontroller costs a few dollars? The answer is the scan cycle, the I/O, and who has to fix it at 3 a.m. See the difference run live in a browser PLC simulator.

Join 1900+ learners practicing PLC programming

The short answer

A PLC is a rugged, certified industrial controller programmed in ladder logic and maintained by plant electricians; a microcontroller is a cheap, flexible chip programmed in C by embedded engineers. Choose a PLC for factories, safety and long service life. Choose a microcontroller for prototypes, custom hardware and high-volume products.

The comparison comes up constantly because the two devices genuinely overlap: strip either one down and you find a processor reading inputs, executing logic and driving outputs. In fact every modern PLC has a microcontroller or microprocessor at its core. What separates them is not the silicon — it is the engineering wrapped around it, the programming model on top of it, and the person expected to keep it running for the next twenty years.

This guide walks through the differences that actually decide a project, explains why the scan cycle is the one distinction most articles gloss over, and — because this site is a browser-based PLC simulator — lets you watch that scan cycle execute live instead of taking our word for it.

Side by side

PLC vs microcontroller: the differences that matter

DimensionPLCMicrocontroller
ArchitectureModular system: power supply, CPU, plug-in I/O modules in a rack or DIN-rail baseSingle chip on a board you design (or a dev board like Arduino / ESP32)
ProgrammingIEC 61131-3: ladder logic, structured text, function block — readable by any trained electricianC / C++ / MicroPython firmware — readable by the engineer who wrote it
Execution modelDeterministic scan cycle: read inputs → execute logic → write outputs, enforced by a watchdogFree-running loop plus interrupts — timing behaviour is whatever your code makes it
I/OIsolated, protected industrial I/O: 24 VDC, 4–20 mA analog, relay and 120/240 VAC outputs, wired to screw terminals3.3 V / 5 V GPIO pins — needs level shifters, optocouplers and driver circuits to touch real field devices
EnvironmentRated for panel temperatures, vibration and electrical noise; conformal-coated options for harsh plantsCommercial-grade parts; hardening the board for a factory floor is your engineering problem
Certification & safetyUL / CE as standard; safety-rated CPUs and I/O (SIL, PLe) available off the shelfWhatever certification you pay to have your custom board tested for
Cost profileHigher device cost; low lifecycle cost — spares from the distributor, no board redesigns, decades of vendor supportVery low device cost; lifecycle cost lives in board design, firmware maintenance and component obsolescence
Who maintains itPlant electricians and maintenance techs, online, often without stopping the machineThe embedded engineer who designed it — or nobody, once they leave

Read the table top to bottom and a pattern appears: none of these rows says one device is better. The PLC wins wherever reliability, standardisation and maintainability by other people matter; the microcontroller wins wherever unit cost, board-level flexibility and custom hardware matter. They are optimised for opposite failure modes.

PLC system architecture — power supply, CPU and separate isolated input and output modules wired directly to 24 V field devices, in contrast to a microcontroller's bare GPIO pinsA modular PLC rack on a backplane: power supply, CPU processor, input module, output module and a communications module side by side.PLC RACKbackplane busPSUPowerCPUProcessorDIInputDOOutputNETComms
A PLC is a system, not a chip: isolated I/O modules wire straight to field devices with no interface circuitry to design.

Execution model

The scan cycle is the real difference

Most PLC-vs-microcontroller articles spend their time on ruggedness and price. Those matter, but the deepest difference is in how the two devices execute your logic — and it changes how you think about programming them.

A microcontroller runs firmware. Your C code executes top to bottom in a loop you wrote, at whatever speed the work allows. Anything time-critical hangs off interrupts that can fire at any instant — including halfway through a calculation that was using the value the interrupt just changed. The timing behaviour of the whole system is emergent: it depends on your code paths, your interrupt priorities, and whatever the Wi-Fi stack decided to do this millisecond. Skilled embedded engineers manage this well; it is still their job to manage it.

A PLC runs a scan cycle. The vendor's runtime — not your code — executes a fixed loop, typically every few milliseconds: read all inputs into an image table, execute your logic top to bottom against that frozen snapshot, then write all outputs at once. A watchdog timer halts the CPU and faults the controller if a scan ever overruns. The consequences are profound:

  • Inputs cannot change mid-logic. Every rung in the same scan sees the same input values. A whole class of race conditions that plague interrupt-driven firmware simply cannot occur.
  • Outputs update atomically. Field devices never see a half-computed intermediate state, because outputs are only written after all logic has been solved.
  • Timing is deterministic. The scan time is measurable, bounded and monitored. You can state with confidence how quickly the machine reacts to an input — and prove it.
  • The program structure is standard. There is no main loop to architect. Any technician who understands the scan cycle understands the execution of every PLC program ever written.
PLC scan cycle — read inputs, execute ladder logic against the frozen input image, write outputs, repeat every few milliseconds under a watchdog timer, unlike a microcontroller's free-running loop and interruptsThe repeating PLC scan cycle: read inputs, execute the ladder logic, update outputs, then housekeeping, looping continuously.1Read Inputs2Execute Logic3Update Outputs4HousekeepingSCANCYCLE
The scan cycle: read inputs → execute logic → write outputs, repeated deterministically. This loop belongs to the PLC runtime, not to your program.

Don't read about the scan cycle — watch one

This is the part no blog post can show you. Our simulator has a scan cycle highlight mode that slows the loop down and lights up each phase — input read, rung-by-rung logic solve, output write — as it happens. If you come from microcontrollers, five minutes of watching it will teach you more than any diagram.

Decision guide

When to choose a PLC — and when a microcontroller wins

Choose a PLC when…

  • It controls production equipment. Downtime costs real money, and the controller must be diagnosable and repairable by the maintenance team on shift — not by whoever designed a custom board years ago.
  • Safety or certification is involved. Machine safety functions, hazardous areas and regulated industries expect certified controllers and documented, standard logic. Safety-rated PLCs exist off the shelf; safety-rated custom MCU boards are a project in themselves.
  • The system must live for decades. PLC vendors support product families, keep spares available and provide migration paths for many years. Industrial machines routinely outlive several generations of consumer silicon.
  • It wires to industrial field devices. 24 V sensors, 4–20 mA transmitters, contactors and VFDs connect to PLC I/O modules directly. With an MCU, every one of those interfaces is circuitry you must design, protect and test.
  • Someone else will modify it later. Ladder logic on a standard platform is the industrial world's shared language. Machines get modified for their whole working life — by different people every time.

A microcontroller wins when…

  • Unit cost dominates. If you are building a product in volume, a chip that costs a few dollars beats a controller that costs hundreds — the engineering effort amortises across every unit sold.
  • You need custom hardware. Tight enclosures, battery power, custom sensors, radios, displays: an MCU goes on whatever board you can design. A PLC is the shape the vendor made it.
  • You are prototyping or learning electronics. An Arduino starter kit costs less than lunch for two, and the feedback loop from idea to blinking LED is minutes. Nothing in industrial automation is that accessible as hardware.
  • The application is a device, not a machine. IoT sensors, consumer appliances, robotics hobby projects and one-off lab rigs have no plant electrician, no 24 V panel and no certification audit — the PLC's advantages don't apply.
  • You have (or are) an embedded engineer. Everything the PLC gives you as a product, a capable team can build as firmware — when the volumes or constraints justify it.

The honest summary: PLCs and microcontrollers rarely compete for the same job. If you are asking the question about a factory machine, the answer is almost always a PLC. If you are asking about a product or a project on your bench, it is almost always a microcontroller. For a deeper treatment of the hardware-selection side — architectures, I/O interfacing and cost-at-scale — see this hardware-selection guide to PLCs vs microcontrollers on plcprogramming.io.

From hobbyist to industrial

Coming from Arduino? You already know more PLC than you think

A large share of the people comparing PLCs and microcontrollers are makers and Arduino programmers wondering whether their skills transfer to industrial automation — often because the jobs are there. The good news: the mental model transfers almost completely.

Digital inputs, digital outputs, debouncing a push-button, latching a motor on, timing a delay — every concept you used on an Arduino exists in a PLC. What changes is the notation and the discipline. Instead of digitalRead() and an if statement, you draw a contact and a coil on a ladder rung. Instead of millis() arithmetic, you drop a TON timer block and read its done bit. Instead of architecting a loop, you trust the scan cycle.

The two things that genuinely feel foreign at first are ladder logic's relay-diagram notation and the scan cycle's frozen-snapshot execution. Both click fastest by doing, not reading — and unlike your Arduino bench, you don't need to buy anything. The free beginner track starts from your very first rung and auto-grades each exercise in the browser, and the full PLC programming course carries on through timers, counters, sequencing and HMI design. If you can wire an H-bridge, you can learn ladder logic in a weekend.

Browser-based PLC simulator — build ladder logic rungs, run the scan cycle and watch simulated industrial machines respond, with no hardware, licence or install, ideal for Arduino programmers crossing over to PLCsA web browser window running a PLC ladder logic simulator with an input/output strip, requiring no installation or download.plcsimulator.app/playno installINPUTSOUTPUTS
The crossover lab: real ladder logic, a real scan cycle, simulated machines — entirely in the browser.

The one comparison you can actually run

Every article on this topic describes the scan cycle in words. This site is the only place you can watch one execute — because the PLC simulator runs entirely in your browser.

Watch the read-inputs → execute-logic → write-outputs loop phase by phase
Toggle an input mid-scan and see why the logic can’t react until the next scan
Build the same start/stop latch you’d code on an Arduino — as a ladder rung
Run TON / TOF timers and watch the accumulator climb in real time
Practise in Allen-Bradley dialect or IEC 61131-3 — no vendor licence, no install
Auto-graded scenarios tell you whether your logic is actually correct
Questions

PLC vs microcontroller FAQ

Use a PLC when the controller has to survive an industrial environment and be maintained by people who did not build it. A PLC gives you isolated 24 V industrial I/O that wires straight to field devices, a deterministic scan cycle, safety and hazardous-area certifications, hot-swappable modules, decades of vendor support, and — critically — a standardised programming model (IEC 61131-3 ladder logic) that any plant electrician can open, read and troubleshoot at 3 a.m. without the original developer. A microcontroller can technically do the same control job, but every one of those guarantees becomes custom engineering work you have to do, document and maintain yourself.

See the scan cycle run — right now, in this browser

No hardware. No licence. No install. The fastest way to understand what makes a PLC a PLC.

Try the simulator free →