Advertisement
Intermediate Time: 4–5 weeks Mechanical Engineering

Mechatronics Pick and Place System

Build a complete pick and place mechatronics system with conveyor belt, photoelectric sensors, pneumatic actuators, and PLC control.

MechatronicsConveyorPLCPneumaticsSensor IntegrationAutomation
DifficultyIntermediate
Duration4–5 weeks
Components10 items
Steps5 steps

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.

Theory & Background

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.

Advertisement

Components & Requirements

10 components required for this project.

#ComponentPurposeQty
1Conveyor belt (500mm × 100mm, 12V motor)Object transportx1
2Pneumatic cylinders (single-acting, 25mm bore)Pick and push actuatorsx2
3Solenoid valves (5/2 way, 12V)Pneumatic cylinder controlx2
4Air compressor (5L, 8 bar max)Compressed air supplyx1
5Photoelectric sensors (diffuse type)Object detection and countingx4
6Inductive proximity sensor (8mm range)Metal object detectionx2
7Arduino Mega + relay module (8-channel)System PLCx1
8Conveyor speed controller (PWM)Variable belt speedx1
9HMI display (Nextion 3.2")Operator interfacex1
10Cabinet with DIN railControl panelx1

Step-by-Step Implementation

Follow these 5 steps carefully.

1
System Design and P&ID

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.

2
Pneumatic Circuit Assembly

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).

3
Sensor Integration and Calibration

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).

4
PLC Programming (Ladder Logic equivalent)

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).

5
HMI Design and Operator Interface

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.

Code & Implementation

Core code for pick_place_plc.ino:

pick_place_plc.ino C/C++
// 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();     }   } }

Testing & Troubleshooting

Test Mechatronics Pick and Place System by verifying each subsystem individually before full integration.

!
Troubleshooting Tips

Verify power voltages, check ground connections, use serial monitor for debug.

Real-World Applications

*Factory automation production line
*Package sorting and routing
*Pharmaceutical dispensing system
*Food production line automation
*Automotive assembly line component
*Warehouse sortation system
*PCB assembly machine
*Material handling and logistics

Extensions & Next Steps

  • Add machine vision inspection station with camera
  • Implement OEE (Overall Equipment Effectiveness) tracking
  • Build a predictive maintenance system using motor current analysis
  • Add SCADA system integration with Modbus TCP
  • Implement adaptive sorting using machine learning for new object types

Interactive Playground

Coming Soon

An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.

Frequently Asked Questions

What is the difference between a PLC and a microcontroller (Arduino) for industrial automation?
Industrial PLC (Siemens S7, Allen Bradley): IEC 61131 standard programming languages (Ladder, Function Block, ST), hardened against electromagnetic interference and industrial environment, diagnostic functions (I/O forced, monitoring, online change), safety-certified versions (SIL ratings), certified to operate in temperature extremes (-25°C to +70°C), IP65+ ratings, 24V industrial I/O standard. Arduino: not industrially certified, susceptible to EMI from large motors, not suitable for safety-critical applications. For learning and prototyping: Arduino is excellent. For actual industrial deployment: always use a certified PLC.
Advertisement