Skip to Content
All case studies

Case study · Test bench · Arduino based PLC

Prove a pneumatic sequence on a bench first.

A belt, 3 cylinders, 8 sensors and one Arduino based PLC.

3pneumatic cylinders, moved by 3 solenoid valves
8digital inputs: 2 capacitive and 6 inductive sensors
4digital outputs: 3 valves and the belt motor
8GRAFCET steps, from step 0 to step 7

A sequence can look right on paper.

A bench shows it before a real line runs it.

This case describes a bench model of a box labelling line, built for testing and learning. An industrial Arduino based PLC from Industrial Shields runs it: a conveyor belt, three pneumatic cylinders, two capacitive sensors and six inductive end-of-stroke sensors. The program is written in the Arduino IDE and follows a GRAFCET of eight steps. The original case was written for schools. The same kind of bench is useful to anyone who must check a sequence before it runs on a machine, or train people on sequential logic: system integrators, maintenance teams and in-company training.

From the original case

What the case publishes.

The original case gives the device list, the wiring rule and the GRAFCET. It does not give the PLC model, the program or the valve type. This page keeps that line: facts are facts, and examples are marked as examples.

Pneumatic training bench with cylinders, compressed air lines and sensors, photo from the original case study
Photo published with the original case study: a pneumatic bench with cylinders, compressed air lines and sensors.
  • A box labelling line as a bench model
  • 3 cylinders (C1, C2, C3) moved with compressed air through 3 solenoid valves
  • 2 capacitive sensors (S1, S2) and 6 inductive sensors (micro 1 to 6), two per cylinder
  • A conveyor belt moved by a motor
  • All sensors on digital inputs, all actuators on digital outputs
  • A GRAFCET of 8 steps, redrawn on this page

The challenge

Check the sequence before it moves a real box.

A labelling line looks simple: feed a box, put a label on it, take it out. The control logic has to run every step in the right order and wait for the right sensor each time. The bench lets you see each step happen.

01

Eight steps, one order

C1 places the box, C2 puts the label, C3 takes the box out. Each cylinder must finish its stroke before the next one moves. From step 1 to step 7, the PLC waits for a sensor before it moves on.

02

Twelve signals to wire

Eight inputs and four outputs, with two types of sensor. Each signal must reach the right terminal and the right variable in the program.

03

Real air, real motion

Three cylinders move with compressed air through three solenoid valves. A motor runs the belt. These are real actuators with real end-of-stroke sensors.

Built for testing and learning

You see the cylinder move and the sensor switch. That makes the bench a direct way to test a sequence and to teach sequential logic to a team.

How it works

Run the GRAFCET. Then break it on purpose.

Press the buttons. The first panel runs the GRAFCET of the case on a drawing of the bench. The second panel lets you make a sensor fail and shows where the sequence stops. They are illustrative simulations with scaled times. They do not show the program of the case.

Test 1 · Sequence

Eight GRAFCET steps. Steps 1 to 7 wait for a sensor.

Step 0 starts the belt. In step 1 the PLC waits for a box at S1. Then C1 places the box on the belt, and the belt carries it to S2. C2 moves down and back to put the label. C3 takes the box out of the labelling area. The cycle closes when C3 is back (micro 6) and S2 sees no box.

  • Steps 1 to 7 end on a sensor, never on a fixed time
  • Two end-of-stroke sensors per cylinder: one forward, one back
  • C2 only moves when C1 is back (micro 2) and the box is at S2
  • A new cycle only starts when the station is empty (S2 OFF)
FEEDBeltOUTC1C3C2S1S2

Outputs
BeltValve C1Valve C2Valve C3
Inputs
S1S2micro 1micro 2micro 3micro 4micro 5micro 6

Transitions

    Example: one single-solenoid valve per cylinder (output ON moves forward, OFF moves back). The case names 3 valves and does not publish their type. Illustrative simulation of the GRAFCET published with the case. Scaled times. The program of the case is not published.

    Test 2 · Sensor fault

    Make a sensor fail. See where the sequence stops.

    In a GRAFCET, a step ends only when its transition is true. If a sensor never switches, the sequence waits in that step for ever. On a bench you find this with a cable you unplug, not on a running line. A typical way to make it visible: a timer per step. If a step lasts longer than expected, the PLC switches the outputs off and reports the missing signal. The case does not publish its fault handling.

    • The waiting step tells you which device to check
    • A step timer turns a silent stop into a clear alarm
    • You test the fault handling before the machine needs it
    • Add an emergency stop and interlocks before you use real air pressure
    0belt on1S1 ON2C1 FWDmicro 1 ON3C1 BWDmicro 2 + S2 ON4C2 FWDmicro 3 ON5C2 BWDmicro 4 ON6C3 FWDmicro 5 ON7C3 BWDmicro 6 ON + S2 OFF0

    Make a sensor fail

    Select one or more sensors. They will never switch ON.

    Step time0.0 s
    example limit: 3 s

    GRAFCET redrawn from the original case. The step timer and the alarm are a typical pattern, not part of the published case.

    Related example: a valve sequence as a state machine

    System architecture

    How does one Arduino based PLC run a pneumatic labelling bench?

    Eight sensors go to digital inputs of the PLC: two capacitive sensors for the box and six inductive sensors for the ends of stroke. Four digital outputs drive the three solenoid valves and the belt motor. The case also names a USB link to a Panel PC (HMI). Industrial Shields PLCs connect to other devices over Ethernet and Modbus. Wi-Fi, GPRS and LoRa are available in specific versions.

    Pneumatic test bench: a box labelling sequence with GRAFCET on an Arduino based PLCS1capacitiveS2capacitivemicro 1inductive · C1micro 2inductive · C1micro 3inductive · C2micro 4inductive · C2micro 5inductive · C3micro 6inductive · C3digital inArduino based PLCIndustrial Shields8 digital inputs · 4 digital outputsValve C1digital outC1Valve C2digital outC2Valve C3digital outC3Belt motordigital outConveyor beltcompressed airUSBPanel PC (HMI)Other devicesEthernet · ModbusWi-Fi, GPRS, LoRa: specific versionsoptions named in the caseBased on the device list and the GRAFCET of the case. The terminal assignment, the valve type and the PLC model are not published.S1capacitiveS2capacitivemicro 1inductive · C1micro 2inductive · C1micro 3inductive · C2micro 4inductive · C2micro 5inductive · C3micro 6inductive · C3digital inArduino based PLCIndustrial Shields8 digital inputs · 4 digital outputsdigital outValve C1C1Valve C2C2Valve C3C3Belt motorConveyor beltcompressed airPanel PC (HMI)USBOther devicesEthernet · Modbusoptions named in the caseBased on the device list and the GRAFCETof the case. Not published: terminals,valve type and PLC model.
    Sensor signals, digital inputsDigital outputsCompressed airOptions named in the case
    Signals
    SignalBetweenTypeRole in the GRAFCET
    S1, capacitiveBetweenSensor → PLCTypeDigital inputRole in the GRAFCETBox present: step 1 to step 2
    S2, capacitiveBetweenSensor → PLCTypeDigital inputRole in the GRAFCETBox at the labelling station: step 3 to 4. OFF when the box has left: step 7 to 0
    micro 1, inductiveBetweenC1 → PLCTypeDigital inputRole in the GRAFCETC1 forward: step 2 to 3
    micro 2, inductiveBetweenC1 → PLCTypeDigital inputRole in the GRAFCETC1 back: step 3 to 4, with S2
    micro 3, inductiveBetweenC2 → PLCTypeDigital inputRole in the GRAFCETC2 forward, label applied: step 4 to 5
    micro 4, inductiveBetweenC2 → PLCTypeDigital inputRole in the GRAFCETC2 back: step 5 to 6
    micro 5, inductiveBetweenC3 → PLCTypeDigital inputRole in the GRAFCETC3 forward, box out: step 6 to 7
    micro 6, inductiveBetweenC3 → PLCTypeDigital inputRole in the GRAFCETC3 back: step 7 to 0, with S2 OFF
    Valve C1BetweenPLC → solenoid valveTypeDigital outputRole in the GRAFCETMoves C1 (steps 2 and 3)
    Valve C2BetweenPLC → solenoid valveTypeDigital outputRole in the GRAFCETMoves C2 (steps 4 and 5)
    Valve C3BetweenPLC → solenoid valveTypeDigital outputRole in the GRAFCETMoves C3 (steps 6 and 7)
    Belt motorBetweenPLC → motorTypeDigital outputRole in the GRAFCETRuns the conveyor belt from step 0
    HMI linkBetweenPLC ↔ Panel PCTypeUSBRole in the GRAFCETOption named in the case. Not part of the sequence

    Why it works

    An industrial PLC on the bench. Open code in your hands.

    You own the application

    You write the program in the Arduino IDE, which is free. You know every line of the code, so you can change the sequence, add a step or reuse it on another machine.

    Industrial hardware on the bench

    The bench runs on an industrial Arduino based PLC for the DIN rail. A sequence you prove on the bench runs on the same family of controllers in a cabinet.

    Ready to connect

    Industrial Shields PLCs connect to a Panel PC (HMI) over USB and to other devices over Ethernet and Modbus. Wi-Fi, GPRS and LoRa are available in specific versions. You can add a screen or a link to a line controller later.

    Hardware used

    One Arduino based PLC for the whole bench.

    M-DUINO ETHERNET PLC ARDUINO 42, industrial PLC based on Arduino Mega with 42 I/O

    M-DUINO ETHERNET PLC ARDUINO 42

    An industrial PLC built around an original Arduino Mega 2560. On this bench it reads the 8 sensors, drives the 3 solenoid valves and the belt motor, and runs the GRAFCET. You program it with the Arduino IDE.

    Inputs
    26: 14 digital optoisolated, 12 analog/digital (0-10 V)
    Outputs
    16: 10 digital optoisolated, 6 analog/digital/PWM (0-10 V), 5 to 24 Vdc
    Ethernet
    W5500, 10/100 Mbit, RJ45
    Serial and buses
    RS-485, RS-232, TTL, I2C, SPI
    Power supply
    12 to 24 Vdc
    Mounting
    DIN rail TS35, IP20

    The case names an Arduino based PLC from Industrial Shields and does not publish the exact model. The original PDF shows an M-Duino. The image shows the M-DUINO ETHERNET PLC ARDUINO 42: its 14 digital inputs and 10 digital outputs cover the 8 inputs and 4 outputs of this sequence, with spare I/O. Its outputs are optoisolated, without relays: the belt motor needs a contactor or an interface relay. Check the current of your valve coils in the family datasheet.

    Questions about this case

    What does the bench automate?

    A box labelling line. A conveyor belt, three pneumatic cylinders (C1 places the box, C2 puts the label, C3 takes the box out), two capacitive sensors and six inductive end-of-stroke sensors. One Arduino based PLC from Industrial Shields runs the sequence.

    How many I/O does the PLC need for this sequence?

    Twelve digital signals: 8 inputs (S1, S2 and micro 1 to 6) and 4 outputs (three solenoid valves and the belt motor). The M-Duino 42 has 14 digital inputs and 10 digital outputs, so it covers them with spare I/O. To choose the valve for each cylinder, see 5/2 and 5/3 solenoid valves and how to wire them.

    How do you turn a GRAFCET into Arduino code?

    The case does not publish its program. A typical way: one variable holds the active step, and a switch statement has one case per step. Each case sets the outputs of the step and checks its transition. If the transition is true, the variable moves to the next step. A team that works with GRAFCET can map it line by line.

    Is this bench only for schools?

    No. The original case was written for schools. The same bench is a way to check a sequence before it runs on a machine, and to train integrators or maintenance teams on sequential logic with real cylinders and sensors. For another test bench with code and a bill of materials, see the fuse test bench project pack.

    Can the bench talk to an HMI or to other devices?

    Yes. The case names a USB link to a Panel PC (HMI). Industrial Shields PLCs connect to other devices over Ethernet and Modbus. Wi-Fi, GPRS and LoRa are available in specific versions. The case does not publish an HMI screen or a network setup.

    Which parts of this page are facts, and which are examples?

    Facts from the original case: the device list, the wiring rule (sensors on digital inputs, valves and motor on digital outputs), the GRAFCET and the communication options. Examples: the PLC model in the image, the valve type, the step timer, the times in the simulations and the code structure.

    Download the case study

    4-page PDF with the challenge, the logic, the architecture and the hardware. No form required.

    Similar project?

    Tell us your sequence. An engineer will answer.

    Send us your steps or your GRAFCET, your sensors and your actuators. Bench, training rig or real machine: we will tell you which controller fits and how to map the I/O.

    • You get an answer from our technical team
    • I/O count and controller sizing
    • Arduino, ESP32 or Raspberry Pi based PLCs