element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Tech Connection
  • Learn
  • Learning Center
  • Tech Connection
  • More
  • Cancel
Tech Connection
Blog How to Program the Arduino Opta PLC
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Tech Connection to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
EMI-Reduction-Techniques
Engagement
  • Author Author: vivekvelusamy
  • Date Created: 8 Aug 2024 9:29 AM Date Created
  • Views 106014 views
  • Likes 6 likes
  • Comments 2 comments
  • AFX00002
  • arduino opta plc
  • arduino opta
  • arduino opta plc programming
  • programming arduino opta with plc
  • arduino plc tutorial
  • arduino industrial automation
  • arduino-e14
  • AFX00003
  • arduino opta features
  • how to use arduino plc
  • AFX00001
  • programmable logic controller
  • arduino
  • arduino opta microcontroller
Related
Recommended

How to Program the Arduino Opta PLC

vivekvelusamy
vivekvelusamy
8 Aug 2024

Profile imageIndustrial automation has transformed business operations by making them more competitive and cost-effective. This tech-driven shift has helped industries optimize processes, reduce errors, increase productivity, and cut costs. A key component of industrial automation systems is the programmable logic controller (PLC). They are the central control units for machines and manufacturing processes. When integrated with IoT and edge computing, PLCs can perform data analytics, automatic decision-making, failure prediction, and process optimization. However, programming a PLC has been complex and challenging, requiring specialized knowledge. Common challenges in PLC programming have included debugging syntax errors, logic errors, communication errors, and interfacing with external devices. This article explores how Arduino-based Opta® PLC can mitigate PLC programming challenges. It also introduces the Arduino PLC programming environment, highlighting its benefits and applications in automation.

Benefits of Arduino PLC Programming

The Arduino PLC IDE is an integrated development environment that bridges the gap between traditional PLC systems and the Arduino ecosystem. This open-source, free-to-use software offers a unified programming environment. It provides a range of debugging tools and access to a wide array of pre-installed libraries and function blocks, with the option to create custom libraries. This enables users to program and control PLCs, leveraging Arduino’s intuitive interface and capabilities for industrial automation applications.

ARDUINO AFX00002 Arduino Board Module

Figure 1: ARDUINO AFX00002 Arduino Board Module, Opta Wifi, STM32H747XI, 32 bit, ARM Cortex-M4/Cortex-M7
Buy Now

The Arduino PLC IDE supports five programming languages defined by the IEC 61131-3 standard:

  • Ladder Diagram (LD)
  • Sequential Function Chart (SFC)
  • Function Block Diagram (FBD)
  • Structured Text (ST)
  • Instruction List (IL)

Figure 2 illustrates a sample ladder logic program created with the the Arduino PLC IDE. In this program, a fan and an indicator lamp start after a delay of 10,000 ms. The timer is triggered by a proximity sensor. When a metal object comes within range of the proximity sensor, the timer starts. After 10,000 ms, the fan is energized, and the LED indicator illuminates.

The Arduino PLC IDE includes a comprehensive suite of monitoring and debugging tools. Users can view all PLC operations during debugging, as well as perform detailed code analysis.

Figure 2: A sample ladder logic program running on Opta® PLC
Figure 2: A sample ladder logic program running on Opta® PLC.

Getting Started with Programming the Arduino Opta® Micro-PLC

Designed as a collaboration between Arduino and tech company Finder®, the Arduino Opta® is a secure micro-PLC with Industrial IoT capabilities and is CE/UL certified for industrial, OEM, or building automation projects. The Opta® PLC offers ultra-secure connectivity, support OTA (Over-the-Air) firmware updates and enables remote control via the Arduino Cloud or third-party services. They can be programmed using either the Arduino programming language or the standard IEC-61131-3 PLC programming languages, with access to many ready-to-use software libraries and sketches.

ARDUINO AFX00003 Arduino Board Module, Opta Lite

Figure 3: ARDUINO AFX00003 Arduino Board Module, Opta Lite, STM32H747XI, 32 bit, ARM Cortex-M4/Cortex-M7
Buy Now

The Arduino Opta® is available in three variants:

  • Opta® Lite
  • Opta® RS485
  • Opta® WiFi

Table 1 details the differences between each variant. All options feature an STM32H747XI dual Cortex®-M7+M4 32-bit low-power Arm® MCU from STMicroelectronics, operating at 240 MHz. The two cores communicate via a remote procedure call mechanism, allowing functions to be called on the other processor. Opta® offers multiple choices for network connectivity, including Ethernet, USB, Wi-Fi® / Bluetooth® Low Energy (BLE), and industry-specific protocols such as RS-485. It also includes the ATECC608B, a secure element from Microchip®, which provides advanced security in IIoT environments. The compact design of Opta® allows for DIN rail mounting and can operate between temperature ranges of -20 °C to +50 °C without the need for external cooling.

Feature

OptaTm RS485

OptaTm WiFi

OptaTm Lite

USB

USB-C®

USB-C®

USB-C®

Ethernet Support

10/100BASE-T Port

10/100BASE-T Port

10/100BASE-T Port

RS-485

Half-duplex

Half-duplex

N/A

Wi-Fi®

N/A

802.11 b/g/n

N/A

SKU

AFX00001

AFX00002

AFX00003

Table 1: Differences between the variants of Arduino Opta® micro-PLCs

How to Program the Opta®

Programming of Arduino Opta® can be done using Arduino IDE or Arduino PLC IDE software, both of which are open-source environments. These tools simplify complex automation projects. It is recommended that users download and install both packages on their computers. Let's discuss how to program an Arduino Opta® PLC and connect it with Arduino Cloud.

ARDUINO AFX00001 Arduino Board Module, Opta RS485

Figure 4: ARDUINO AFX00001 Arduino Board Module, Opta RS485, STM32H747XI, 32 bit, ARM Cortex-M4/Cortex-M7
Buy Now

Creating Your First Program using Ladder Logic for Arduino Opta® PLC

Follow these basic steps to create a ladder logic-based program on the Opta® PLC:

  1. Connect the Opta® PLC and open the Arduino IDE tool. Install the core for the Opta® by navigating to Tools > Board > Boards Manager. In the Boards Manager section, search for Opta mbed and install it.
  2. After installing Opta mbed, open the Arduino PLC IDE tool and create a new project. Name your project and select ‘Opta 1.0’ as the target.
  3. Download the initial sketch, but only on a complete reset or first use. The overview page will show the device info and status along with an image of your Opta® PLC. At the bottom of the image, you will find the ‘Other’ option for manual sketch download. Select the correct COM port (check Device Manager on your computer) and download it.
  4. After the initial download, you can connect to the Opta® PLC online through the On-line menu > Connect. You can now see the status of your connected PLC.
  5. The next step is to define the Opta I/O tags. To define the I/O tags, navigate to the 'Resources' tab > 'Button Inputs' and assign the one called 'User' with any variable name ( for example, 'User_A' ). Repeat the process in the ‘LED Outputs’ tab, locate L1(or any other LED), and name it simply 'LED_1' for physical input and output map programmable input and relay outputs accordingly. After mapping is complete, save the Program using the icon on the main page or go to the main menu > ‘File’ > ‘Save Program’.
  6. To Create a new program, go to the main menu > ‘Project’ > ‘New Object’ > ‘New Program’. Select the LD option for ladder logic, name it, and define how it will run (Fast/slow/Background/Init).
  7. Now, a new ladder logic program will be displayed in the work area. It will contain a single rung with an input and output condition. This program also appears under the fast task folder and the project as a ladder diagram symbol. Now configure the rung by double-clicking or right-clicking > 'properties' and enter the variable names that are already defined.
  8. Go to ‘On-line’ > ‘Download code’, and your Opta® should now run on the Ladder logic program.
Figure 5: Programming Arduino Opta® PLC using Ladder Logic
Figure 5: Programming Arduino Opta® PLC using Ladder Logic

Connecting Arduino Opta® PLC with Arduino Cloud

To integrate the Opta® PLC with the Arduino Cloud, follow these steps:

  1. Configure Arduino Cloud: we need to configure the Arduino Cloud with Opta® to create a Thing. This involves registering Opta® with Cloud variables and configuring a dashboard to perform various actions.
  2. Access the Full Editor: Navigate to 'Things'> 'Opta PLC IDE Cloud Thing > 'Sketch' > 'Open full editor,' of which ‘Opta® PLC IDE Cloud’ is the name of the Thing you created.
  3. Extract the Web-Based code: Once your Arduino Cloud Thing is successfully created, we can extract the web-based code. This code will serve as the base for the Arduino sketch for Opta® in the desktop PLC IDE. The code can be accessed by going to the full editor.
Figure 6: Dashboard created in the Arduino Cloud
Figure 6: Dashboard created in the Arduino Cloud. Image Source: Arduino

Conclusion

PLCs will continue to play an essential role in the real-time manufacturing environment. With the launch of Opta®, Arduino has enabled entry-level engineers to learn and explore IEC-61131-3 standard programming. It also allows system engineers and integrators to retrofit legacy equipment for the Industry 4.0 environment with IIoT capability. With the help of the highly configurable pre-installed and customizable libraries and function blocks of the PLC IDE tool, users can design and develop their IIoT applications on Opta® devices.

Review the Arduino Opta Micro-PLC

To learn more varieties about the different variants of the Opta® from Arduino Shop Now

About the Sponsor

sponsor

Arduino designs, manufactures, and supports electronic devices and software, allowing people around the world to easily access advanced technologies that interact with the physical world. Our products are straightforward, simple, and powerful, ready to satisfy users’ needs from students to makers and all the way to professional developers. For more information, please visit this page: go here

  • Sign in to reply
  • kmikemoo
    kmikemoo 10 months ago

    I was so excited about this that I ordered one from Arduino even before the RoadTest was closed.  I've been playing with it infrequently for a couple of weeks.  The PLC IDE is quirky.  If I want to know why my sketch doesn't compile, I have to go to the Arduino IDE to get the detail that I need to know what's going wrong.  Maybe there is something that I am missing in the PLC IDE, but that's where I'm at right now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mhd720
    mhd720 10 months ago

    Very keen to Roadtest!!! Hopefully my prior experience with Arduino will help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube