Introduction
Build a complete pick and place mechatronics system with conveyor belt, photoelectric sensors, pneumatic actuators, and PLC control. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Build a complete pick and place mechatronics system with conveyor belt, photoelectric sensors, pneumatic actuators, and PLC control.
Build a complete pick and place mechatronics system with conveyor belt, photoelectric sensors, pneumatic actuators, and PLC control. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Create a P&ID (Piping and Instrumentation Diagram) for the pneumatic system: air supply → filter-regulator-lubricator (FRL) unit → pressure gauge → solenoid valves → cylinders. Electrical schematic: PLC I/O wiring, sensor connections, actuator outputs. Functional description: object placed at conveyor inlet → conveyor transports → photoelectric sensor detects metal (inductive) or plastic → sort decision made → pneumatic pusher directs to correct bin. Count all inputs (sensors, operator buttons) and outputs (actuators, indicators) to verify PLC I/O capacity.
10 components required for this project.
| # | Component | Purpose | Qty |
|---|---|---|---|
| 1 | Conveyor belt (500mm × 100mm, 12V motor) | Object transport | x1 |
| 2 | Pneumatic cylinders (single-acting, 25mm bore) | Pick and push actuators | x2 |
| 3 | Solenoid valves (5/2 way, 12V) | Pneumatic cylinder control | x2 |
| 4 | Air compressor (5L, 8 bar max) | Compressed air supply | x1 |
| 5 | Photoelectric sensors (diffuse type) | Object detection and counting | x4 |
| 6 | Inductive proximity sensor (8mm range) | Metal object detection | x2 |
| 7 | Arduino Mega + relay module (8-channel) | System PLC | x1 |
| 8 | Conveyor speed controller (PWM) | Variable belt speed | x1 |
| 9 | HMI display (Nextion 3.2") | Operator interface | x1 |
| 10 | Cabinet with DIN rail | Control panel | x1 |
Follow these 5 steps carefully.
Create a P&ID (Piping and Instrumentation Diagram) for the pneumatic system: air supply → filter-regulator-lubricator (FRL) unit → pressure gauge → solenoid valves → cylinders. Electrical schematic: PLC I/O wiring, sensor connections, actuator outputs. Functional description: object placed at conveyor inlet → conveyor transports → photoelectric sensor detects metal (inductive) or plastic → sort decision made → pneumatic pusher directs to correct bin. Count all inputs (sensors, operator buttons) and outputs (actuators, indicators) to verify PLC I/O capacity.
Pneumatic circuit: compressor → pressure regulator (set 4–6 bar) → FRL unit (filter removes water and debris, regulator sets pressure, lubricator adds oil mist for valve longevity) → solenoid valves → cylinders. Flow control valves: install on cylinder exhaust ports to control extension/retraction speed (meter-out control). Safety: never bypass or adjust pressure above component ratings. Cylinder extend time adjustment: flow control valve → increase restriction → slower extend. All connections: use push-to-connect fittings (6mm tubing for small cylinders).
Photoelectric sensors: teach-in mode — press button with target object in place, sensor learns the reflection level. Set hysteresis to avoid flicker. Inductive sensors: detect ferrous metals within rated range (8mm). Output: NPN (sinks current) or PNP (sources current) — match to PLC input type. Test each sensor: block/unblock with target object, verify LED indicator response and digital output level. Wiring: use shielded cable for sensors near motors (motor noise can cause false triggers).
PLC programming in Arduino (not true IEC 61131 PLC, but functionally equivalent for this scale): scan all sensor inputs every scan cycle (10ms). Implement state machine for each actuator: IDLE → EXTENDING → EXTENDED → RETRACTING → RETRACTED. Timers for cylinder motion (extend time, dwell time at extended position, retract time). Counters: count objects, count rejects, count total throughput. Alarm conditions: cylinder timeout (stuck), low pressure alarm, sensor failure detection (output always on or always off).
Nextion display: program with Nextion Editor. Screens: Main (conveyor speed control, start/stop, status indicators), Counters (total count, good count, reject count, shift totals), Settings (speeds, timings, sort criteria), Alarms (active alarms list with timestamp). Communication: Arduino serial → Nextion at 9600 baud. Protocol: send page switch commands, update numeric displays, receive button press events. Safety: physical emergency stop button (red, mushroom-head, locking) must immediately stop all motion — hardwired to contactor, not through PLC software.
Core code for pick_place_plc.ino:
// Mechatronics Pick & Place System Controller // Inputs #define SENSOR_ENTRY 2 // Photoelectric - object approaching #define SENSOR_SORT 3 // Inductive - detect metal #define SENSOR_COUNT 4 // Photoelectric - count objects in bin #define BTN_START 5 // Operator start button #define BTN_STOP 6 // Operator stop button #define BTN_ESTOP 7 // Emergency stop (normally closed) // Outputs #define CONVEYOR_PWM 9 // Belt speed (PWM) #define SORT_CYLINDER 10 // Pusher solenoid #define COUNT_CYLINDER 11 // Gate solenoid #define INDICATOR_RUN 12 // Green run light #define INDICATOR_FAULT 13 // Red fault light // Counters and timers int total_count = 0, metal_count = 0, plastic_count = 0; bool system_running = false; unsigned long sort_timer = 0; void loop() { // Safety: E-stop check if(!digitalRead(BTN_ESTOP)) { analogWrite(CONVEYOR_PWM, 0); digitalWrite(SORT_CYLINDER, LOW); system_running = false; digitalWrite(INDICATOR_FAULT, HIGH); Serial.println("E-STOP TRIGGERED"); return; } // Start/Stop logic if(digitalRead(BTN_START)) system_running = true; if(digitalRead(BTN_STOP)) system_running = false; digitalWrite(INDICATOR_RUN, system_running); analogWrite(CONVEYOR_PWM, system_running ? 180 : 0); if(system_running) { // Object detected at sort station if(digitalRead(SENSOR_SORT)) { // Metal detected: trigger sort pusher if(!sort_timer) sort_timer = millis(); digitalWrite(SORT_CYLINDER, HIGH); // Extend pusher metal_count++; } else if(sort_timer && millis() - sort_timer > 500) { digitalWrite(SORT_CYLINDER, LOW); // Retract pusher sort_timer = 0; } // Count all objects static bool prev_count_sensor = false; bool curr = digitalRead(SENSOR_ENTRY); if(curr && !prev_count_sensor) total_count++; prev_count_sensor = curr; // Update HMI every second static unsigned long last_hmi = 0; if(millis() - last_hmi > 1000) { Serial.print("n0.val="); Serial.print(total_count); Serial.write(0xFF); Serial.write(0xFF); Serial.write(0xFF); last_hmi = millis(); } } }
Test Mechatronics Pick and Place System by verifying each subsystem individually before full integration.
Verify power voltages, check ground connections, use serial monitor for debug.
An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.