Sorting system with color sensor
Couldn't load pickup availability
Description
This function block automatically sorts conveyor objects by color— red , blue , and green —and reliably rejects any unrecognized objects. The clearly structured code in Structured Control Language (SCL) is immediately executable in the Siemens TIA Portal and provides a robust solution for modern sorting systems in industry and logistics.
Note: All modules are designed exclusively as a learning and optimization basis and are not approved for live operation. System modules, in particular, must be finally tested and commissioned by qualified personnel before productive use.
How it works
The process begins with the security check :
An emergency stop or stop button stops the entire system immediately, all outputs are switched off and the process is reset to the start.
In automatic mode , the conveyor belt starts as soon as the start button is pressed and transports the objects to the color detection station .
An edge detector detects each newly arriving object – the belt stops and sorting begins.
Within a state machine (FSM) the color of the object is now checked:
- When red , blue or green the corresponding switch is activated and the corresponding counter is increased .
- If no color is detected , the rejection logic automatically takes effect and the counter for “Unknown” is increased.
An IEC timer ensures that the selected switch remains in position for a defined time.
Afterwards, all switches go into neutral position , the belt starts running again – and the cycle begins again.
Technical details
- Safety priority : Emergency stop and stop signal reset all relevant variables immediately
- Object detection : Edge triggers register each arrival exactly once
- Control via pedometer (FSM) : reliably controls belt travel, switches and sorting phases
- Switch holding time : controlled by an IEC timer
- Real-time counts : separate counters for red, blue, green and “unknown” – ideal for evaluations and HMI display
-
TRUE/FALSE outputs :
Foerderband
,WeicheRot
,WeicheBlau
,WeicheGruen
,Ausschleusen
– directly controllable for valves or relays
Possible applications
Can be used in:
- Sorting systems for bottles, cartons or plastic parts
- Recycling stations where material separation by color is necessary
- Logistics centers , e.g. for returns or packaging units
- Training or demo projects in which FSM logic, sensors and counting functions are to be demonstrated in a practical manner
Thanks to the modular structure, the control system can be easily adapted to other sorting characteristics (e.g. shape, size, weight).
compatibility
- Runs on Siemens S7-1200 and S7-1500 controllers
- Fully compatible with TIA Portal from version V13
- Recommended for testing: Version V16 or higher , with PLCSIM and HMI connection
Scope of delivery
You will receive:
- An .scl file with all inputs and outputs , trigger logic, timer configurations and counting variables
- Comments in the header area for adjusting sensor thresholds, switch times and counting behavior
- The download link is available immediately after purchase
Support
Whether you need help adapting the sensor logic , the switch control or the integration into your control system – I am happy to assist you.
Simply contact us by email or directly via shop support – together we will find the right solution for your application.