PLC Sim Lab

Free online PLC simulator: learn automation by running a plant

Practise PLC programming and ladder logic without hardware. A metal / non-metal sorting line is controlled by a simulated PLC. Press START, watch the sensors fire, follow the ladder logic rung by rung, then break things with fault injection and see what happens.

Open the Playground → wire your own panel and write your own ladder logic 🎓 Free course: lessons, fault finding & certificate

Watch: build your first PLC circuit

Watch the full tutorial (13 min, 4K): build your first PLC circuit step by step. Open on YouTube →

Sorting line simulator

Inductive proximity sensor PX1 flags metal parts. A FIFO shift register tracks every part down the belt until photo-eye PE2 tells the PLC it has reached the pneumatic diverter. Capacitive level sensors stop the line when a bin is full. Click any component on the machine to learn what it is.

Tip: click a component on the machine (sensor, cylinder, motor, bin, stack light...) to see how it works.
Operator panel (HMI)
Rated Sn = 8 mm on steel. Aluminium only reaches 0.4 × Sn – widen the gap and watch aluminium get mis-sorted.
0C0 metal
0C1 non-metal
0mis-sorts
Fault injection
PLC I/O image table
Part tracking FIFO (1 = metal → divert) · oldest on the left
Scan #0 · scan time 0 ms
Ladder logic – live power flow (green = true)

Sensor lab

Each sensor on its own test bench. Move the target, change the material, and watch the output LED.

Inductive proximity sensor

An oscillator coil creates a high-frequency magnetic field at the sensor face. A metal target lets eddy currents flow, which damps the oscillation. When the amplitude falls below a threshold, the output switches. Non-ferrous metals damp less, so the working range is multiplied by a correction factor. A small hysteresis band stops the output chattering at the edge.

Capacitive proximity sensor

The sensor face is one plate of a capacitor and the surroundings are the other. Anything with a dielectric constant higher than air raises the capacitance. That's why it detects plastic, wood, powder and liquid, even through a non-metal tank wall. You tune the sensitivity pot so the wall is ignored and the product is detected. The simulator uses two of these as bin-full level switches.

Photoelectric sensor (photo-eye)

Through-beam uses a separate emitter and receiver. It has the longest range and is the most reliable. Retro-reflective uses one housing plus a reflector; a polarizing filter helps with shiny objects, but clear bottles can still fool it. Diffuse relies on the object reflecting light back, so dark or clear objects may be missed. Dark-ON means the output is ON when the beam is blocked.

Ultrasonic level sensor (analog 4–20 mA)

The sensor sends an ultrasonic burst and times the echo: distance = speed of sound × time / 2. It outputs a 4–20 mA current loop. 4 mA is a "live zero", so 0 mA means a broken wire. The PLC analog input card converts the current to a raw count (for example 0–27648 on Siemens S7). The program then scales that count to engineering units.

Wiring a 3-wire DC sensor: PNP vs NPN

Most DC proximity sensors have three wires: brown +24 V, blue 0 V and black output. The output transistor either sources +24 V to the load (PNP) or sinks the load to 0 V (NPN). The PLC input card must be the opposite type.

Field equipment reference

What each device does and how it connects to the PLC.

How a PLC works: the scan cycle

A PLC doesn't react to inputs the moment they change. It runs one loop forever, typically every 1–20 ms. The simulator above runs exactly this loop.

  1. Read inputs. The state of every input terminal is copied into the input image table. The program only sees this snapshot, so an input that flickers mid-scan can't confuse it.
  2. Execute program. Rungs are solved top-to-bottom, left-to-right. Results are written to the output image table and to internal memory bits (M / markers).
  3. Write outputs. The output image is copied to the physical output terminals, which switch contactors, solenoid valves and lamps.
  4. Housekeeping. Communications (HMI, SCADA, fieldbus), diagnostics and the watchdog timer run here. If a scan takes too long, the watchdog faults the CPU and the outputs drop to a safe state.

Common ladder instructions

SymbolNameMeaning
--] [--XIC / NO contactTrue when the bit is 1
--]/[--XIO / NC contactTrue when the bit is 0
--( )--OTE / output coilBit follows the rung condition
--(S)-- --(R)--Set / Reset (Latch / Unlatch)Bit stays on until it is explicitly reset
--|P|-- --|N|--Rising / falling edge (one-shot)True for exactly one scan on the edge
TONOn-delay timerQ / DN turns on after the input has been true for the preset time
CTUCount upAccumulator +1 on each false→true transition
FFL / FFUFIFO load / unloadQueue used to track parts between stations

Note on Stop and E-Stop: they are wired normally closed, so the input reads 1 when healthy and the program uses a normally-open contact. If a wire breaks, the input drops to 0 and the machine stops. This is called fail-safe wiring. Real E-stops also cut power through a safety relay, not just through the PLC program.

PLC exercises with full solutions

Practice problems from real PLC courses, each solved step by step: the task, the I/O list, the reasoning, the complete ladder program and a video. Open any solution in the simulator and run it.

All PLC exercises →

Frequently asked questions

Quick answers about the simulator, the Playground and PLC wiring.

Is PLC Sim Lab free?

Yes. The simulator, the sensor lab and the Playground are free to use in your browser. There is nothing to install and no account to create.

Do I need to install any software?

No. Everything runs in a modern web browser (Chrome, Edge, Firefox or Safari). It works best on a laptop or desktop, because wiring and ladder editing need a mouse and a bigger screen.

What can I do in the Playground?

Place real control-panel parts (power supplies, push buttons, sensors, relays, contactors, motors, cylinders, conveyors, robots), wire them to a PLC terminal by terminal, write your own ladder logic and press RUN to watch it work, including physics such as parts moving on a conveyor and cylinders hitting limit switches.

Which PLC brands does it support?

You can switch the PLC between Siemens (S7 / TIA Portal style), Mitsubishi (MELSEC, X/Y addresses), Allen-Bradley (MicroLogix / RSLogix style) and TOYOPUC. Click the brand name on the PLC. Your program and wiring stay the same; only the address names change.

Which ladder instructions are available?

Normally open and normally closed contacts, rising and falling edge contacts (P / N), parallel branches, coils, set and reset coils, on-delay and off-delay timers (TON / TOF) and up counters (CTU), plus memory bits and system bits such as the 1 Hz clock.

What is the difference between sourcing (PNP) and sinking (NPN) outputs?

A sourcing output switches +24 V to the load, so the other side of the load goes to 0 V. A sinking output switches the load to 0 V, so the other side of the load goes to +24 V. Many Mitsubishi and TOYOPUC PLCs use sinking outputs. In the Playground, click OUT TYPE on the PLC to choose.

Why does my lamp or motor not turn on?

Check three things: the PLC has L+ and M wired to the power supply, the PLC is in RUN, and the load is wired to the correct side (to 0 V for sourcing outputs, to +24 V for sinking outputs). Hover over any terminal to see its voltage, and open the Monitor to see which inputs and outputs are on.

Where are my projects saved?

In your own browser on your own device. Nothing is uploaded. Use Save to keep named projects and My projects to open them again. To move a project to another computer, or to back it up, use Export and then Import.

Can I download my program to a real PLC?

No. PLC Sim Lab is a learning simulator. The ladder logic is written the same way as in real PLC software, so what you learn carries over, but you still need the manufacturer's software (for example TIA Portal, GX Works or RSLogix) to program real hardware.

Is it safe to practise mains (230 V / 415 V) wiring here?

Yes, nothing here is live. Shorts trip the simulated supply instead of hurting anyone. Real mains wiring must only be done by qualified people, with the power isolated and locked off.

Who is it for?

Students, apprentices, maintenance technicians and engineers who want to practise PLC wiring and ladder logic, and teachers who want a free tool to demonstrate sensors, relays, motor starters and the PLC scan cycle.