Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PLC Conveyor Cell Simulator

A bench-top, DIN-rail-mounted PLC training cell that simulates a conveyor-to-robot transfer station. A real photoelectric sensor detects parts, toggle switches simulate operator inputs, pilot lights show machine status, and a Raspberry Pi polls the PLC over Modbus TCP and serves a web-based HMI.

Hardware

  • PLC: AutomationDirect CLICK C0-10DD1E-D (24 VDC, sinking outputs, Ethernet, Modbus TCP)
  • Sensor: Taiss BEN5M photoelectric sensor
  • I/O: SPDT toggle switches, 24 VDC pilot lights
  • Power: 24 VDC supply
  • Compute: Raspberry Pi 4 (Modbus TCP client + Flask HMI server)

Network

Device IP Role
CLICK PLC 192.168.10.50 Modbus TCP server
Raspberry Pi 192.168.10.20 / 192.168.1.99 Modbus client + HMI
Engineering PC 192.168.1.30 SSH workstation
[Laptop] --SSH--> [Raspberry Pi] --Modbus TCP/502--> [CLICK PLC] --24V I/O--> [Photoeye / Switches / LEDs]

I/O Map

PLC Address Device Purpose
X001 SPDT 1 Enable
X002 BEN5M photoeye Part detect
X003 SPDT 2 Robot request / reset
X004 SPDT 3 Auto mode
Y001 LED Cell ready
Y002 LED Part detected
Y003 LED Robot request
Y004 LED Robot busy
C1 / C2 / C3 Modbus coils Request / busy / photoeye
CTD1 Modbus register Part count

Software

  • src/plc_client.py — Modbus TCP client (reads coils + part count register)
  • src/HMI.py — Flask server, polls the PLC in a background thread and exposes /api/status
  • src/templates/index.html — industrial-style HMI dashboard (auto-refreshes once per second)
  • src/plcstatus.py — status helper

Run

pip install flask pymodbus
python src/HMI.py

Then browse to http://<pi-ip>:5000.

To Do

  • Fault report generator

About

My PLC scripts in python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages