Home > Projects > Robotics – Automation Projects > Arduino as a PLC Concept: Scan Cycle, I/O Mapping and Simulation Limits

Arduino as a PLC Concept: Scan Cycle, I/O Mapping and Simulation Limits

Summary of Arduino as a PLC Concept: Scan Cycle, I/O Mapping and Simulation Limits


This article explains how an Arduino can simulate PLC-style logic by executing a distinct scan cycle of reading inputs, evaluating logic, and writing outputs. It contrasts this hobbyist approach with industrial PLCs, highlighting the lack of isolation, safety functions, and deterministic timing in microcontroller simulations. Using Proteus VSM for simulation, the guide emphasizes strict I/O mapping, ADC impedance limits, and the critical distinction between logical validation and physical safety, warning against using such systems for mains machinery.

Parts used in the Arduino PLC Simulation:

  • Arduino (Microcontroller)
  • ATmega328P Microcontroller
  • Proteus Virtual System Modelling (VSM) Software
  • Mixed-mode SPICE Circuitry
  • Analog-to-Digital Converter (ADC)
  • 4-channel Relay Module
3 min read

Quick answer: an Arduino can run a PLC-style loop – read inputs, evaluate logic, write outputs, repeat – and that is a genuinely useful way to learn PLC concepts. It stops being “a PLC” the moment protection, isolation and certification enter the picture, and none of those come from the microcontroller alone.

The scan cycle in plain terms

PLC programming ideas map onto a simple loop: gather input states, evaluate your logic against them, then drive outputs, and do it repeatedly. Keeping those three phases distinct in your code makes the behaviour predictable and easier to reason about than interleaving reads and writes.

Simulated controller versus industrial PLC

Proteus VSM co-simulates supported microcontroller firmware with mixed-mode SPICE circuitry, and the vendor documents interactive indicators and debugging aids. The vendor is also explicit that simulation is distinct from physical prototype testing – which is exactly the boundary a hobby “PLC” sits on.

Aspect Microcontroller + simulation Industrial PLC
Execution Software loop, timing depends on code Deterministic, real-time scan
I/O protection Not inherent to a bare MCU Opto/relay isolation, surge handling
Safety functions Not implemented Emergency-stop and safety relays
Validation Simulation only Physical prototype plus standards testing

An ordered I/O mapping workflow

  1. List every input and output by function before naming any pin.
  2. Assign each signal to a physical point and record the mapping in one place.
  3. Note the electrical character of each point – digital or analog – and keep analog source impedance within the datasheet’s guidance of about 10 kilohms or less.
  4. Remember the ADC is 10-bit with a single-ended result referenced to the selected VREF, so define that reference explicitly.
  5. Simulate the logic and confirm each output responds to its inputs, treating the result as a logic check rather than a physical validation.

Two datasheet cautions are worth repeating here because they are easy to violate in automation code: the ADC’s absolute maximum ratings are stress limits rather than functional operating conditions, and the ATmega ADC reference and source-impedance guidance are not optional niceties.

Reader questions

Is this actually a programmable logic controller?

It is a programmable logic concept running on a microcontroller. Real PLCs add isolation, deterministic scan timing and safety functions this does not have.

Can I use it to control mains machinery?

No. This is a low-voltage, simulation-oriented reference; machine safety, emergency stops and mains automation are out of scope.

Does a clean simulation prove the design works?

No. The simulation vendor states it is distinct from physical prototype testing. Simulation validates logic, not wiring or protection.

Is a relay safe as a protective device?

Not by itself. Never rely on a microcontroller, or a controller-driven relay, as the sole protective shutdown.

Documentation

See also the Arduino 4-channel relay using ATmega328P with Proteus simulation guide for a simulation-oriented companion read.

Documentation note: the cited sources cover MCU ADC characteristics and Proteus simulation capabilities. Ladder toolchain compatibility, relay schematic details and EMI immunity are outside their scope and are not covered here.

Quick Solutions to Questions related to Arduino PLC Simulation:

  • Can an Arduino run a PLC-style loop?
    Yes, an Arduino can read inputs, evaluate logic, write outputs, and repeat in a useful way to learn PLC concepts.
  • Does a clean simulation prove the design works physically?
    No, the simulation vendor states it is distinct from physical prototype testing and validates logic but not wiring or protection.
  • Is this system safe for controlling mains machinery?
    No, it is a low-voltage reference that lacks machine safety, emergency stops, and mains automation capabilities.
  • Is a relay safe as the sole protective device?
    No, you should never rely on a microcontroller or controller-driven relay as the sole protective shutdown mechanism.
  • What is the recommended source impedance for the ADC?
    The datasheet guidance suggests keeping analog source impedance within about 10 kilohms or less.
  • How does execution timing differ between this method and an industrial PLC?
    The microcontroller loop timing depends on code, whereas an industrial PLC uses deterministic, real-time scan timing.
  • What are the three phases of the PLC programming idea?
    The phases are gathering input states, evaluating logic against them, and driving outputs repeatedly.
  • Why is the ATmega ADC reference not optional?
    The ADC reference and source-impedance guidance are essential technical requirements, not optional niceties.

About The Author

Avatar of Ibrar Ayyub

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Use Arduino for Projects

Free Arduino projects, circuits, code and tutorials. Pick a board, pick a sensor, build something.

Scroll to Top