← All Posts

PLC vs Microcontroller: When to Use Each in Industrial Projects

Every engineer who discovers Arduino has the same thought: "Why would I pay $1,500 for a PLC when I can buy a $20 microcontroller that does the same thing?" It is a fair question. On the surface, both devices read inputs, execute logic, and control outputs. The difference is not in what they do—it is in how they do it, where they do it, and what happens when something goes wrong.

PLCs (Programmable Logic Controllers) and microcontrollers (Arduino, ESP32, STM32) serve different markets. PLCs are built for industrial environments where failure is not an option. Microcontrollers are built for prototypes, hobbies, and applications where cost is the primary constraint and downtime is acceptable.

This guide explains the technical differences, when to use each, and why hobbyist microcontroller builds often fail when deployed in production environments.

Side-by-Side Comparison

Characteristic
PLC
Microcontroller
Cost
$500-$5,000+
$5-$50
Environment
Industrial (0-60°C, vibration, electrical noise)
Indoor (0-40°C, low vibration)
Timing
Deterministic scan cycle (guaranteed 10 ms)
Non-deterministic (depends on code)
I/O Protection
Isolated, surge-protected, 24V compatible
5V logic, minimal protection
Programming
IEC 61131-3 (ladder, structured text)
C/C++, Python, Arduino IDE
Component Life
10-20 years availability
3-5 years (obsolescence)
Support
Vendor support, documentation, training
Community forums, DIY
Best For
Production machinery, process control
Prototyping, data logging, hobbies

PLC: Industrial Control at Industrial Cost

A PLC is an industrial computer designed specifically for control applications. It is not a general-purpose computer. Every aspect of its design prioritizes reliability in harsh environments.

Deterministic Scan Cycles

The defining characteristic of a PLC is deterministic execution. The PLC executes a scan cycle repeatedly: read inputs, execute logic, write outputs. The scan time is predictable and guaranteed. If a PLC is configured for a 10 ms scan, you can guarantee that the logic executes every 10 ms, every time, with no variation.

This determinism is critical for real-time control. When a machine is moving at high speed, you need to guarantee that the control loop executes at a consistent rate. Non-deterministic timing causes jitter, instability, and unsafe conditions.

Industrial Ruggedization

PLCs are built to survive industrial environments:

  • Temperature: Rated for 0-60°C operation (some extend to -40-70°C). Consumer electronics fail at these extremes.
  • Vibration: Designed to mount on DIN rails in control cabinets with vibrating machinery. Connections are screw-terminal, not header pins.
  • Electrical noise: Inputs are opto-isolated. Outputs are relay or transistor with snubber circuits. The PLC itself is enclosed in a grounded metal case.
  • Power supply: Wide-range 24V DC input with surge protection. Handles the voltage spikes common in industrial panels.

Industrial I/O Modules

PLCs use modular I/O that connects to real-world equipment:

  • Inputs: 24V DC opto-isolated inputs. A 24V signal from a sensor connects directly. No level-shifting required. Isolation protects the PLC from ground loops and voltage spikes.
  • Outputs: Relay outputs for switching AC loads, transistor outputs for fast DC switching. Outputs are rated for inductive loads (motors, solenoids) with built-in snubber protection.
  • Analog: 0-10V and 4-20mA inputs with high resolution (12-16 bit). Isolated channels prevent ground loops.
  • Specialty: Thermocouple inputs, RTD inputs, high-speed counter inputs, encoder inputs. Purpose-built for industrial sensors.

IEC 61131-3 Programming

PLCs are programmed using IEC 61131-3 standard languages:

  • Ladder Logic: Graphical language that resembles electrical relay diagrams. Intuitive for electricians and maintenance staff.
  • Structured Text: Textual language similar to Pascal or C. Suitable for complex algorithms.
  • Function Block Diagram: Graphical language where functions are represented as blocks with inputs and outputs.
  • Sequential Function Chart: Graphical language for step-by-step processes.

The standard ensures that maintenance staff can read and modify PLC code years after the original developer has left. Ladder logic, in particular, is universally understood in the electrical trades.

Long-Term Availability

PLC vendors guarantee long component availability. When you buy a PLC model, you can typically purchase replacement units for 10-15 years. This is critical for industrial equipment that may operate for decades. You do not want to redesign a control panel because the microcontroller you used was discontinued after 3 years.

Vendor Support

When a PLC fails, you call vendor support. When you have a programming question, you have documentation and training courses. When you need a spare part, it is available from stock. This support infrastructure is part of what you are paying for. Microcontrollers have community support, but no vendor backs the product.

PLC cost example: A small machine control application requires 16 digital inputs, 8 digital outputs, and 2 analog inputs. A microcontroller solution: Arduino Mega ($25) + I/O expansion board ($75) + custom enclosure and protection circuitry ($100) = $200. PLC solution: Micro PLC ($800) + I/O modules ($400) = $1,200. The PLC costs 6x more, but provides deterministic timing, industrial isolation, 10-year availability, and vendor support. For production machinery, the premium is justified.

Microcontroller: Flexible and Cheap, But Not Industrial

Microcontrollers (Arduino, ESP32, STM32) are general-purpose computing devices. They excel at flexibility and low cost, but lack the industrial features of PLCs.

Low Cost and High Flexibility

Microcontrollers are incredibly cheap. An Arduino Nano clone costs $10. An ESP32 with WiFi costs $5. This accessibility makes microcontrollers ideal for:

  • Prototyping: Test a control concept before committing to PLC hardware
  • Data acquisition: Read sensors and log to SD card or cloud
  • User interfaces: Build custom HMI panels
  • Educational projects: Learn control theory and programming

Non-Deterministic Timing

Microcontroller code runs on an operating system (or bare metal with no real-time guarantees). The loop() function in Arduino runs whenever the processor has time. If you add serial printing, WiFi operations, or complex calculations, the loop time varies. This non-determinism is acceptable for data logging and user interfaces, but unacceptable for real-time control.

Limited I/O Protection

Microcontroller I/O pins are 5V (or 3.3V) logic with minimal protection. Connecting industrial 24V sensors directly will destroy the chip. Using microcontrollers in industrial environments requires:

  • Level-shifting circuits to convert 24V to 5V
  • Opto-isolation to protect against ground loops and voltage spikes
  • Relay drivers to switch inductive loads
  • Protection diodes and snubber circuits

All of this protection circuitry must be designed and built. With a PLC, it is included out of the box.

C/C++ Programming

Microcontrollers are typically programmed in C/C++ (or MicroPython/CircuitPython). This provides flexibility and performance, but:

  • Requires software development skills
  • Lacks the standardization of IEC 61131-3
  • Maintenance staff may not be able to read or modify the code
  • No built-in debugging tools for industrial environments

Component Obsolescence

Microcontroller chips have short product lifecycles. A chip popular today may be discontinued in 3-5 years. When that happens, you must redesign your hardware. PLC vendors guarantee long availability specifically to avoid this problem.

Environmental Limitations

Microcontrollers are rated for commercial or extended temperature ranges (0-70°C typically). Industrial environments exceed these ranges:

  • Control cabinets in summer can reach 70°C internally
  • Outdoor installations in winter can drop below -20°C
  • Humidity causes corrosion on PCB connections over time
  • Vibration loosens Arduino header connections

Microcontrollers can be ruggedized with conformal coating, potting, and custom enclosures, but this adds cost and engineering effort that negates the initial price advantage.

Why Hobbyist Builds Fail in Factories

Every automation engineer has seen it: a brilliant engineer built a custom controller using Arduino, it worked perfectly on the bench, and then failed repeatedly when installed in the plant. The reasons are predictable.

Electrical Noise

Industrial environments are electrically noisy. VFDs, motors, welders, and switching power supplies generate noise on power lines and radiated EMI. Microcontrollers reset, crash, or behave unpredictably when exposed to this noise. PLCs are designed with filtering, shielding, and isolation specifically to handle noise.

Voltage Spikes

24V industrial power systems experience voltage spikes. When a motor turns off, inductive kickback sends spikes of hundreds of volts. Microcontroller inputs connected without opto-isolation are destroyed. PLC inputs are isolated by design.

Vibration

Arduino header connections are friction-fit. In a vibrating cabinet, they loosen. Connections become intermittent. The system works when touched, fails when left alone. PLCs use screw terminals that stay tight.

Temperature Extremes

A microcontroller that worked at room temperature crashes when the cabinet reaches 60°C in summer. Clock timing drifts. Silicon behavior changes. PLCs are rated for these extremes and tested at temperature extremes during manufacturing.

Lack of Fail-Safe Design

Hobbyist code often lacks watchdog timers, error handling, and safe state design. When the microcontroller crashes, it stays crashed. Output states are undefined. A PLC includes watchdog timers—if the scan cycle exceeds the configured time, the PLC forces outputs to a safe state.

Maintenance Nightmare

When the original engineer leaves, no one knows how the custom microcontroller system works. There is no documentation. No standard programming model. The replacement maintenance staff cannot troubleshoot or modify the system. PLCs use standard languages and documentation that any trained electrician can understand.

The real cost is not the hardware. A microcontroller may cost $20, but the engineering time to design protection circuitry, the maintenance burden when the original developer leaves, and the downtime when the system fails in production far exceed the PLC premium. For production equipment, the PLC pays for itself in reliability and supportability.

When to Use Each

The decision framework is straightforward when you consider the consequences of failure.

Use a PLC When:

  • The application is safety-critical (machine control, process control)
  • Failure causes downtime, damage, or safety risk
  • The equipment will be operated by maintenance staff who did not build it
  • Deterministic timing is required
  • The environment includes electrical noise, vibration, or temperature extremes
  • Long-term support (10+ years) is required
  • You need vendor support and spare parts availability

Use a Microcontroller When:

  • Building a prototype or proof-of-concept
  • The application is non-critical (data logging, user interface)
  • Cost is the primary constraint and failure is acceptable
  • Development speed is more important than production reliability
  • The environment is controlled (office, lab, home)
  • You have in-house expertise to design and maintain custom hardware
  • The project is educational or experimental

Hybrid Approaches

The best solutions often use both:

  • PLC for control, microcontroller for edge: The PLC handles real-time control and safety. The microcontroller reads local sensors and communicates via Modbus to the PLC.
  • Microcontroller for prototype, PLC for production: Develop and test with Arduino to prove the concept. Once the design is finalized, reimplement in a PLC for production deployment.
  • Microcontroller for UI, PLC for logic: The microcontroller runs a custom touch interface. The PLC handles actual control. They communicate via Modbus or MQTT.

How Voltrus PLC Fits In

Voltrus PLC is a programmable logic controller designed for small to medium industrial applications. It bridges the gap between expensive enterprise PLCs and hobbyist microcontrollers.

Deterministic Execution

Voltrus PLC provides guaranteed scan cycles from 1 ms to 100 ms. Real-time control loops execute predictably, every time.

Industrial I/O

Built-in digital and analog I/O with industrial isolation. 24V inputs connect directly. Relay outputs switch inductive loads. No external protection circuitry required.

IEC 61131-3 Programming

Support for ladder logic, structured text, and function block diagram. Maintenance staff can read and modify the code. No proprietary programming languages.

Modern Connectivity

Built-in Ethernet with Modbus TCP server and client. Communicate with SCADA systems, HMI panels, and other PLCs. USB programming port for laptop connection.

Lifetime Support

Voltrus PLC is guaranteed available for 10 years from introduction. Replacement units will be available. Your investment is protected.

Voltrus PLC pricing: Starting at $499 for a 16 I/O unit. Lifetime warranty. No annual licensing. Includes programming software. The cost of a high-end microcontroller development board, with industrial reliability and PLC support.

Frequently Asked Questions

What is the difference between a PLC and a microcontroller?

A PLC (Programmable Logic Controller) is an industrial computer designed specifically for control applications. It is ruggedized for harsh environments, uses deterministic scan cycles for real-time control, supports industrial I/O modules, and is programmed via IEC 61131-3 languages. A microcontroller (Arduino, ESP32, STM32) is a general-purpose microcomputer on a chip. It is inexpensive, flexible, and easy to program, but lacks industrial ruggedization, deterministic timing guarantees, and long-term component availability. PLCs are designed for 10-20 year operation in factories. Microcontrollers are designed for prototypes and hobby projects.

When should I use a PLC instead of a microcontroller?

Use a PLC when the application is safety-critical or production-critical: machine control, process control, building automation, or any system where failure causes downtime, damage, or safety risk. PLCs provide deterministic scan cycles (you can guarantee the loop executes every 10 ms), industrial I/O (isolated inputs that survive 24V spikes, relay outputs that switch inductive loads), and support from automation vendors for decades. If the equipment will be operated by maintenance staff who did not build it, a PLC is the right choice.

When is a microcontroller the better choice?

Microcontrollers shine in prototyping, data logging, and non-critical automation. Use them for: proof-of-concept projects before committing to PLC hardware, data acquisition and logging (reading sensors and storing to SD card or cloud), user interfaces and HMI panels, educational projects, and applications where cost is the primary constraint and failure is acceptable. Microcontrollers are also excellent as edge devices—reading local sensors and communicating via Modbus or MQTT to a PLC or SCADA system.

Why do hobbyist microcontroller builds fail in industrial environments?

Industrial environments expose electronics to conditions that hobbyist designs cannot handle: electrical noise from VFDs and motors causes microcontrollers to reset, voltage spikes on 24V lines fry unprotected 5V inputs, humid and corrosive atmospheres corrode PCB connections over time, vibration loosens Arduino header connections, and temperature extremes exceed component ratings. Beyond environmental issues, hobbyist code often lacks watchdog timers, error handling, and fail-safe states. When a microcontroller crashes in a factory, it stays crashed until someone power-cycles it. When a PLC crashes, it watchdog-restarts and enters a safe state.

Can I use a microcontroller as a PLC for small projects?

Technically yes, with industrial Arduino clones and industrial I/O shields, you can approximate PLC functionality. However, you are still missing the key advantages of a PLC: deterministic timing (Arduino's loop() timing varies based on code), long-term support (component obsolescence in 5 years), and institutional support (who maintains the code when the original developer leaves?). For truly small, non-critical projects (home automation, lab equipment), a microcontroller may be sufficient. For anything installed in a production facility, the PLC's premium pays for itself in reliability and supportability.

Industrial Control at Hobbyist Prices

Voltrus PLC provides deterministic scan cycles, industrial I/O, and IEC 61131-3 programming starting at $499. Lifetime warranty. No licensing fees.

Explore Voltrus PLC

Further Reading