top of page
Search
protowattworkshop

PLC vs. Microcontrollers: Which One Should You Use?

Updated: Nov 4, 2023

There are a multitude of articles listing the differences between PLC (Programmable Logic Controller) and embedded programming and how to choose one based on your specific application. Each strategy has its own distinct advantages, and in years past the use cases were pretty easy to differentiate. But these days, as technology has advanced and more powerful tools are within grasp, the line between PLCs and microcontrollers has blurred.


Tale of the tape

PLCs:

  • Easy to program & diagnose (ladder logic!)

  • Robust and industrial

  • Turn-key

  • Drop-in replaceable

  • Expensive, but accompanied with top level support

  • Modular and easy to expand

  • Regulatory compliance

  • Uses standard protocols (RS-232, RS-485, CAN bus, Ethernet, etc.)

Microcontrollers:

  • Complex, low level, bespoke

  • Small, higher sensitivity, versatile

  • Customizable with a high degree of variables

  • Suited for high volume

  • Cost effective

  • Requires custom PCB design

  • Open ended, ready for more purpose-built design

  • Meant for OEMs

But what is this?

Fundamentally, a PLC is just a microcontroller with a highly robust, decades-long refined ecosystem built around it. It uses the ubiquitous IEC 61131 programming standard, and must follow strict regulatory guidelines dictated by UL, FCC, CE, RoHS, and/or SIL. These standards and guidelines do as they are intended to: smooth out some of the rough edges that come with a bare-bones microcontroller. You are trading freedom and granularity for robustness and reliability (there's always a trade-off).


If you need more versatility, you may need to go straight to the source. For example: you are an OEM and need to build a product with a small footprint and propriety. You care about profit margins and plan to produce as many as you can sell. It needs to be capable of receiving updates as the product matures and you would rather not lose valuable profits paying for licensing fees that sometimes come with PLCs. The best choice would be to front load the development cycle by creating a custom PCB with custom firmware and installing it automatically as a step in manufacturing the PCB.


So if you know what your application is then it seems like an easy choice, right? If you're going to automate a production line, get out the PLC. If you want to make any money in volume, better to brush up on your C++. That's where things begin to blur. To state the obvious: companies like Arduino and Raspberry Pi have drastically reduced prototyping costs and development time by building open-source platforms that provide millions of people with opportunities to learn and build thousands of libraries that will likely do exactly what you are looking for. Today, there have never been more options for off-the-shelf products with a variety of speeds, memory, I/O, size, and connectivity. However, those microcontrollers are still relatively basic and susceptible to bugs. They are not equipped to handle the 12 & 24V inputs and outputs required even for the most fundamental PLC functions.


Enter the platypus


We are now beginning to see an explosion of off-the-shelf offerings from both legacy manufacturers as well as lesser-known 3rd parties. First on our list is the Arduino Portenta Machine Control. This is one of the first forays into the industrial world by one of the biggest names in consumer-oriented automation. Powered by a highly capable Portenta H7, the Machine Control boasts some respectable features:

  • Dual-core 32-bit processors

  • A total of 28 isolated 12/24VDC I/O (8 in, 8 out, 12 I/O)

  • Up to 16-bit analog 0-10VDC or 4-20mA inputs

  • CAN bus, RS-232/422/485

  • Ethernet, Wi-Fi, USB-C, Bluetooth® Low Energy

  • Push-in terminals

  • DIN rail mountability

  • CE, FCC and RoHS certified

Despite the questionable $360 price tag, this unit is certainly worth considering for a small industrial automation project. The various serial protocols enable expandability, and the mixture of I/O and (oh yeah!) thermocouple inputs provide a compact platform that can be used in process control, motion, assembly, fluid handling, or any combination (with limitations). As with any novel Arduino product, it can take time for the libraries to mature and catch up to the capabilities of the hardware. However, the open-source nature of the platform provides a strong ecosystem that will only improve its usefulness as more and more talented developers contribute to the project. We have used this in a handful of projects and have been reasonably satisfied with its abilities (review to come later).


It seems Arduino recognized some of the limitations to the Machine Control relative to PLC hardware and soon after released the Arduino Opta line. With three models: Lite, RS485, and WiFi, they are a series of "micro PLC" modules, in addition to their namesake features, they offer 2.3 kW relays, Modbus TCP & RDU, CE, FCC and RoHS certification, OTA updates, and hardware security.

Source: Arduino.cc


Attempting to bridge the PLC-IDE gap, all previously mentioned models are compatible with the new Arduino PLC IDE which claims to utilize IEC 61131-3 languages:

  • Ladder Diagram (LD)

  • Function Block Diagram (FBD)

  • Sequential Function Chart (SFC)

  • Structured Text (ST)

  • Instruction List (IL)

Of course in tandem with the typical IDE C++ variant. Full disclosure: we have not used the PLC IDE.


Not to be outdone, Industrial Shields' Arduino PLC lists a dizzying array of configurations with all of the same offerings as the Machine Control, albeit less powerful. It takes a truer PLC form and price point.


At this point, you may wonder if this is just an Arduino ad....it's not. If you prefer a burgundy terminal, you may like the next one on the list: Industrial Shields' Raspberry Pi PLC. With a wide range of options, this box is designed for industry with:

  • 12-24VDC operation

  • Dozens of isolated analog and digital inputs & outputs

  • Up to 16x 1.3 kW relays

  • RS485 (x2 HALF-Duplex), Wi-Fi, Bluetooth®

  • RTC (real-time clock)

  • 2x expansion ports for GPRS or CAN

  • CE, FCC, RoHS, and ETL compliant

Plus all of the power and features we've come to know and love from the Raspberry Pi... I know, hold back the urge to ask where they were able to buy the Pis.


If your paradox of choice isn't tingling yet, take this:


Uh, thanks Dall-E

When zooming out to view the rapid evolution of the humble embedded controller, one might see two worlds beginning to collide. Where there once was a sharp line of demarcation now lies something more ambiguous, and when you take the myriad of options into consideration it can be quite overwhelming. As an engineer tasked with starting a project that would involve one of these tools, you can easily become lost in the sea of possibilities. When you are a business owner and need to get the job done, you simply need a solution as fast as possible.


Silver lining

As overwhelming as it may be, these numerous options present opportunities for innovation and growth. If most of your experience is with PLC hardware, we encourage you to consider some of the products listed in this article; you might find ways to reduce the cost or size of your project. If your background is in embedded systems, perhaps there are ways you can offer alternative skills or perspectives on projects outside of your typical scope. Ultimately, we encourage the same for both parties: find ways to do things differently and always strive for growth and education. No matter where those efforts end up, they lead to learning.



If you are an engineer looking for ways to help your company, or if you're a business leader trying to discern the best way to get results, send us an email. We love to help, and thrive on bringing creative ideas to life.



56 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page