Skip to content
OnlyProjects
B.Tech / B.E. · MechatronicsFor educational purposes only
Code included

2-Axis Pick-and-Place Gantry on GRBL with a Python G-code Sender and Colour-Sorting Demo

Steppers, belts and a suction cup under GRBL — plus your own Python G-code sender that sorts parts by colour on a ₹6,500 budget

Mapped to your syllabusVTU 2022 Scheme (OBE/CBCS) · BXX685 (BEI685 / BME685 / BCV685) Major Project Phase-I · Semester 6

Overview

1 min read

2-Axis Pick-and-Place Gantry on GRBL is a mechatronics integration project that turns ~₹6,500 of hobby hardware into a working benchtop automation cell: a 300 × 200 mm belt-driven gantry picks small parts from a fixed nest, asks a TCS34725 colour sensor what it is holding, and drops it into the matching bin — while a Python program supervises every step.

The clever scoping decision is the controller. Instead of writing fragile home-grown stepper code, the team flashes GRBL v1.1 — the open-source motion controller that runs most hobby CNC machines — onto an Arduino Uno + CNC shield, then configures it like an industry integrator would: steps/mm derivation, acceleration limits, homing switches. That gives the project industrial-grade trapezoidal motion planning for free, and shifts the student work to where the learning is: a Python G-code sender and job sequencer (pyserial) that speaks GRBL's protocol — status polling, ok/error acks, soft state machine — plus a small Arduino Nano that drives the vacuum pump and reads the colour sensor, and a quantified performance study (positioning repeatability, homing repeatability, cycle-time budget, pick success rate vs part mass).

The demo task mirrors a real Indian SSI line: sorting capped vials or colour-coded fasteners arriving at a station into three bins. By the end, the team can defend every layer — why 80 steps/mm, why open-loop steppers are acceptable here, what the vacuum holding-force margin is, and exactly how many milliseconds each phase of the cycle costs — with measured data instead of assertions.

Relevant for
Karnataka
Level
Intermediate · 14 weeks · team of 4
Common at
Visvesvaraya Technological University, Anna University, Chennai, Jawaharlal Nehru Technological University Hyderabad
Updated
Nov 2026

Syllabus alignment

VTU · 2022 Scheme (OBE/CBCS)

BXX685 (BEI685 / BME685 / BCV685) · Major Project Phase-I · Semester 6 · 2 credits · CIE 100

Subjects this project applies
  • Mechatronics system design — integrating sensors, drives, controller and software into one machine
  • C programming / Arduino framework — GRBL flashing, limit switches and vacuum-driver Nano firmware
  • Python (pyserial, NumPy) — G-code sender, sequencer state machine and cycle-time analytics
  • Sensors & Actuators — stepper selection, A4988 current setting, TCS34725 colour sensing
  • Manufacturing practice — frame fabrication, belt drive layout and 3-D printed brackets
How it is evaluated

Team: individual or group ≤ 4, single- or multi-disciplinary

report : presentation : Q&A = 50 : 25 : 25; same report marks for all batch-mates

Also fits: Anna University Regulation 2021, JNTUH R22.

What's in the box

11 parts · 5 free · 2 previewed · 4 unlock for ₹2,000

Problem & synopsis

5 min read

Problem statement

Benchtop automation for small Indian units is priced out of reach — commercial pick-and-place cells cost lakhs and come locked to vendor software — while student-built alternatives typically lack proper motion planning and, more importantly, never measure what matters: repeatability, cycle time and pick reliability. Mechatronics students therefore graduate able to spin a motor but not to integrate a machine or defend its performance.

There is a need for a buildable, measurable 2-axis pick-and-place gantry that (a) uses a proven open-source motion controller (GRBL) configured from first principles — steps/mm, acceleration, homing, limits, (b) adds a sensor-driven sorting task through a custom Python G-code sender and sequencer that speaks the controller's real protocol, and (c) publishes a quantified performance study — positioning and homing repeatability, cycle-time breakdown and pick success rate — so the machine is demonstrated with evidence, and the department gains a documented, extensible automation cell.

Synopsis

Abstract

Pick-and-place automation is the gateway skill of mechatronics: it forces the integration of mechanics, drives, sensing, real-time control and supervisory software. This project builds a 2-axis gantry robot on the GRBL motion controller, adds a colour-sensing end effector and a Python supervisory program, and demonstrates closed-loop-in-the-large behaviour — sensor-driven task selection on top of open-loop motion — with a measured performance study.

Introduction

Small Indian fabrication and packing units increasingly need benchtop automation: sorting colour-coded parts, kitting fasteners, loading fixtures. A commercial SCARA or delta cell starts at ₹2–4 lakh; a student-built gantry on hobby hardware demonstrates every principle of such machines — kinematics, stepper sizing, motion planning, end-effectors, HMI — for the cost of a textbook bundle.

Existing System

  • Commercial pick-and-place trainers (2–4 axis robotic kits) cost ₹80,000–₹4,00,000 and are locked to vendor software; students configure rather than build.
  • Home-built stepper projects usually bypass proper motion planning, producing jerky, stalled moves, and almost never quantify repeatability or cycle time.
  • Academic 3-D printers and CNC routers use GRBL/Marlin internally but treat the controller as a black box; the layer where industry integration engineers actually work — host software speaking G-code — is rarely taught.
  • Limitations: no integration experience, no performance evidence, no ownership of the supervisory layer.

Proposed System

  • Mechatronics stack: GT2-belt XY gantry (300 × 200 mm travel) on hardened rods, NEMA 17 steppers with A4988 drivers at 1/16 microstepping, Arduino Uno + CNC shield flashed with GRBL v1.1, homing via micro-switches, and a suction end effector (12 V vacuum pump + cup) raised/lowered by a servo.
  • Supervisory layer: a Python G-code sender and job sequencer implementing GRBL's protocol (wake, $ status polling, per-line ack tracking, error recovery) and a task state machine: home → move to nest → query colour → choose bin → place → repeat.
  • Sensing layer: TCS34725 on a Nano with a controlled white LED; RGB readings classified to red/green/blue part classes; Nano also drives the vacuum pump MOSFET.
  • Performance study: positioning repeatability (dial-indicator nest test), homing repeatability, cycle-time breakdown, pick success vs part mass, and belt-tension sensitivity — all tabulated.

Feasibility Study

  • Technical: GRBL is mature and documented; the only genuinely new code is the Python sender (≈500 lines), Nano firmware (≈100 lines) and the study scripts; the mechanical design uses parts any Fab lab or local fabricator can make.
  • Economic: BOM ≈ ₹6,000–6,500 (Uno ₹550, CNC shield ₹250, drivers ₹160, steppers ₹900, rods/bushings ₹600, belts/pulleys ₹400, frame ₹1,500, Nano ₹350, TCS34725 ₹350, vacuum pump ₹350, PSU ₹450, switches/misc ₹600); all software free.
  • Operational: runs from one 12 V 5 A supply; 40 × 40 × 15 mm demo parts are 3-D printed; safety limits (soft-limit G-code fence, E-stop on the PSU, guarded belt paths) are documented; no mains exposure.

Objectives

  1. 01Design and fabricate a 300 × 200 mm GT2 belt-driven XY gantry with hardened-rod guides, NEMA 17 steppers and a suction end effector under ₹7,000.
  2. 02Flash and configure GRBL v1.1 on an Arduino Uno + CNC shield, deriving steps/mm (200 × 16 ÷ 40 = 80 steps/mm), acceleration limits and homing behaviour.
  3. 03Wire and verify hard-limit/home micro-switches and configure soft-limit protection in GRBL's $ parameters.
  4. 04Develop a Python G-code sender and job sequencer (pyserial) implementing status polling, per-line acknowledgements and error handling against the GRBL protocol.
  5. 05Implement the colour-sensing subsystem: TCS34725 on a Nano with controlled illumination, RGB classification of three part colours, and MOSFET-driven vacuum control.
  6. 06Run the integrated sorting demo: pick from a fixed nest, classify, and place into the matching bin for 30 consecutive cycles.
  7. 07Quantify performance: positioning repeatability, homing repeatability, cycle-time breakdown by phase, and pick success rate as a function of part mass.

Scope

In scope

  • Two axes of motion (X/Y) with servo-lifted Z at the end effector; suction pick of rigid, non-porous parts up to ~80 g.
  • GRBL-based motion control with homing and soft limits; Nano-based sensing and vacuum control; Python supervisory software.
  • Three-colour classification demo with controlled LED illumination; repeatability, cycle-time and pick-success studies.

Out of scope

  • Machine vision (camera-based part localisation), force feedback and conveyor synchronisation — future scope.
  • Closed-loop steppers/servos, encoders and backlash compensation beyond tensioning practice.
  • Industrial safety certification; multi-gantry coordination; payload optimisation beyond the stated 80 g class.

Methodology

The project follows a V-model-flavoured build-and-verify methodology: each layer is built, then verified against a specific test before the next layer mounts on it — the only sane order for an integration project.

PhaseWeeksActivitiesDeliverable
1. Design & sourcing1–2Payload/force calc (suction area vs mass), kinematics and steps/mm derivation, frame drawings, BOMDesign report + Phase-I synopsis
2. Mechanical build3–4Frame fabrication, rod/bushing alignment jig, belt runs and tensioning, end-effector mountGantry moves freely by hand
3. Motion electronics5–6A4988 Vref current setting, GRBL flash, steps/mm calibration against a rule, acceleration tuning, homing switches + soft limitsMachine homes and cuts a 100 mm square within spec
4. Software layers7–9Python sender (protocol layer → sequencer), Nano firmware (sensor + pump), unit tests with a fake serial portSender passes protocol test suite
5. Integration10–11Wire Nano sensor into the nest, integrate state machine, failure-mode drills (part absent, ack timeout)30-cycle sorting demo succeeds
6. Performance study & reporting12–14Repeatability, cycle-time, pick-success experiments; belt-tension sensitivity; report + demoFinal report + study tables

Testing approach: unit tests for the sender against a mock serial device (ok/error/timeout paths); integration tests scripted end-to-end with the nest instrumented; metrology tests — positioning repeatability from 20 placement attempts into a dial-indicator nest, homing repeatability from 20 home cycles; pick success over 30 trials at 3 part masses; every result tabulated with apparatus, procedure and uncertainty notes.

Architecture & tech stack

1 diagram · 5 technologies · 2 min read

  • GRBL v1.1 on Arduino Uno + CNC shield — proven open-source motion controller (industry-standard extra)
  • C (Arduino framework) — limit-switch wiring, vacuum-pump driver Nano firmware
  • Python (pyserial, NumPy) — G-code sender, job sequencer state machine and test analytics
  • NEMA 17 steppers + A4988 drivers + GT2 belt drive — actuation hardware
  • TCS34725 colour sensor on Arduino Nano — part identification

The machine is a classic three-controller mechatronics architecture — motion controller, resource controller and supervisory host — deliberately mirroring how real cells split real-time and non-real-time duties.

  1. Motion controller (Arduino Uno + CNC shield, GRBL v1.1): executes G-code with trapezoidal acceleration planning, drives A4988 step/dir signals at 1/16 microstepping, manages homing switches and soft limits, and reports status as <Idle|Run|Alarm...> lines. The team configures it through $ parameters — $100/$101 = 80 steps/mm (200 steps/rev × 16 µstep ÷ 40 mm/rev), $110/$111 feed maxima, $120/$121 acceleration, $22 homing.
  2. Resource controller (Arduino Nano): owns everything GRBL cannot do — I2C reads of the TCS34725 with the onboard LED held constant during integration, a nearest-reference RGB classification, and a MOSFET channel for the 12 V vacuum pump. It exposes a tiny line protocol to the host: READ → rgb r,g,b; class red.
  3. Supervisory host (Python, pyserial): opens both serial ports, streams G-code with ack tracking, and runs the job state machine home → pick move → vacuum on → lift → READ → select bin → place → vacuum off. All events append to a CSV cycle log used by the analysis scripts.
flowchart TD
  PY["Python supervisor (pyserial)<br/>G-code sender + job sequencer"] -->|"USB serial: G-code, status"| GRBL["Arduino Uno + CNC shield<br/>GRBL v1.1 motion planner"]
  PY -->|"USB serial: READ / PUMP cmd"| NANO["Arduino Nano<br/>resource controller"]
  GRBL -->|"step/dir"| DRV["A4988 drivers @ 1/16 µstep"]
  DRV --> MX["NEMA 17 X-axis"]
  DRV --> MY["NEMA 17 Y-axis"]
  MX --> BELT["GT2 belt gantry 300 x 200 mm"]
  MY --> BELT
  BELT --> EE["Suction cup + servo lift"]
  NANO --> VAC["MOSFET -> 12 V vacuum pump"]
  NANO --> CS["TCS34725 colour sensor<br/>(I2C, LED held on)"]
  PART(["Part in nest"]) --> CS
  SW["Home / limit micro-switches"] --> GRBL
  GRBL -->|"ok / error / status"| PY
  NANO -->|"rgb + class"| PY
  PY --> CSV["cycle_log.csv -> analytics"]

The split is defensible in a viva: GRBL owns anything time-critical (step pulses, acceleration), the Nano owns anything GRBL's firmware cannot be modified to do (I2C sensing, pump), and the Python host owns orchestration — exactly the real-time vs non-real-time boundary found in industrial cells. Failure handling is explicit: an ack timeout or an Alarm state aborts the cycle, records it, and returns the machine to a known homed state.

Modules

4 modules

  1. Module 01

    Mechanical Frame & End Effector

    Designs and fabricates the plywood + box-section base, hardened-rod guide rails with LM8UU bushings on printed carriers, GT2 belt runs with 20-tooth pulleys and idlers, tensioning slots, and the end effector: suction cup on a servo-lifted bracket, pump mount and silicone tubing; includes an alignment jig procedure so the two axes are square within 0.5 mm over the full travel.

  2. Module 02

    Motion Electronics & GRBL Configuration

    Sets A4988 Vref currents for the NEMA 17s, wires X/Y motor and homing micro-switches to the CNC shield, flashes GRBL v1.1, then derives and enters $ parameters — 80 steps/mm from motor/pulley/microstep arithmetic, feed and acceleration limits tuned against stall tests, $22 homing cycle and $21/$20 hard and soft limits — and verifies accuracy with a ruled 100 mm square and dial-indicator repeatability runs.

  3. Module 03

    Python G-code Sender & Job Sequencer

    Implements the GRBL protocol layer in pyserial — wake handshake, per-line streaming with ok/error tracking, status polling state parsing, alarm handling and timeout recovery — plus a mock-serial unit test suite; on top sits the job sequencer state machine (home, pick, classify, place, log) that writes every cycle to CSV and can resume cleanly after an aborted cycle.

  4. Module 04

    Colour Sensing & Performance Study

    Builds the Nano firmware for TCS34725 reads with fixed LED illumination and integration time, calibrates three colour classes against the actual demo parts with a distance-in-RGB classifier, drives the vacuum MOSFET, and executes the performance study: positioning and homing repeatability (20 trials each), cycle-time breakdown per phase, pick success vs part mass over 30 trials, and belt-tension sensitivity, all tabulated with uncertainties.

Slides

11 slides · titles free · bullets, notes and the .pptx unlock

  1. Slide 1

    2-Axis Pick-and-Place Gantry on GRBL

  2. Slide 2

    Why This Project

  3. Slide 3

    Problem Statement

  4. Slide 4

    System Architecture

  5. Slide 5

    Mechanical Design

  6. Slide 6

    Motion Control: GRBL Configuration

  7. Slide 7

    Software Layers

  8. Slide 8

    Colour Sensing

  9. Slide 9

    Demo & Performance Study

  10. Slide 10

    Testing Summary

  11. Slide 11

    Conclusion & Future Scope

Bullets, speaker notes and the .pptx · ₹2,000

The titles above are the real outline. The rest is what you present from.

Unlock for ₹2,000

Viva questions & answers

3 of 15 answered free · 12 unlock

Read each answer, close it, and say it in your own words. Your viva will ask. Now you'll know.

  1. 01Concept

    Why did you use GRBL instead of writing your own stepper control code?

    GRBL gives us a proven real-time motion planner — trapezoidal acceleration, look-ahead, junction handling — that would take months to reproduce correctly, and running steppers with naive delay loops produces stalls and jerky motion. Using GRBL let us spend our effort on the layers that were actually new to us: the host protocol software, the sensing subsystem and the performance measurement, which is also how real integrators work with controllers they configure rather than rewrite.

  2. 02Concept

    Derive your steps/mm value and explain each term.

    Steps per millimetre equals motor steps per revolution times microstepping divided by belt travel per revolution: 200 steps for a 1.8-degree motor, times 16 for our A4988 microstepping, divided by 40 millimetres for a 20-tooth GT2 pulley, giving 80 steps per millimetre. We then verified it empirically by commanding a 100 millimetre move and measuring against a steel rule, trimming the value until error was under a percent.

  3. 03Concept

    Your motion is open-loop — why is that acceptable, and when would it not be?

    Open-loop steppers are acceptable here because our loads are light — under 80 grams on low-friction bushings — and we tuned acceleration below the stall limit, so lost steps are rare and homing at every cycle start re-zeroes any drift. It would not be acceptable with heavy payloads, aggressive accelerations or long unsupervised runs, where closed-loop steppers or servos with encoders become necessary, which is why we listed them as future scope.

+12 more questions, with answers

Try the free ones out loud first. Your examiner will not accept “it's in the PPT”.

Source code & how to run

7 steps · complete source code · unlocks with the project

Unlocks with the project · ₹2,000

7 steps · source code zip

Prerequisites, install, seed data and tests, written for demo day. Plus the complete source.

Unlock for ₹2,000

READMEFIRST

243 words · unlocks with the project

What to change before it goes anywhere near a submission. Skipping it is how the demo fails live.

Unlocks with the project · ₹2,000

243 words · ~1 min read

The checklist of things to rename, re-seed and re-think so the project reads as yours.

Unlock for ₹2,000

Instructions

354 words · unlocks with the project

How to study it, adapt it and walk your examiner through it, step by step.

Unlocks with the project · ₹2,000

354 words · ~2 min read

Report structure, formatting rules and the submission checklist your department will grade.

Unlock for ₹2,000

References

6 sources

  1. GRBL v1.1 — Open-Source Motion Control for Arduino (gnea/grbl Wiki)
  2. pySerial — Python Serial Port Extension Documentation
  3. Adafruit Learning System — Adafruit Color Sensors (TCS34725 Guide)
  4. Pololu A4988 Stepper Motor Driver Carrier — Product Guide
  5. Arduino UNO R3 — Official Documentation and Pinout
  6. W. Bolton, Mechatronics: Electronic Control Systems in Mechanical and Electrical Engineering, 6th ed., Pearson

Cite this bundle

OnlyProjects. (2026). 2-Axis Pick-and-Place Gantry on GRBL with a Python G-code Sender and Colour-Sorting Demo: B.Tech / B.E. Mechatronics project bundle [Educational resource]. https://onlyprojects.online/projects/btech-mechatronics-pick-and-place-gantry-grbl-colour-sorting

Future scope

1 min read

  • Camera vision — a webcam over the nest for part localisation and defect rejection, replacing fixed-nest assumptions.
  • Third axis — a proper Z axis with leadscrew for bin walls of different heights and stack placing.
  • Conveyor synchronisation — a belt feeder with encoder pickup so parts arrive in motion.
  • Closed-loop motion — TMC2209 stallGuard or encoder feedback to quantify and reduce lost-step effects under load.
  • HMI and safety upgrade — a Raspberry Pi touchscreen panel, physical E-stop chain and interlocked guarding to approach commercial-cell practice.
  • Weighted demo line — integrate with the department's PLC trainer over Modbus so the cell reports into a SCADA-style dashboard.

Keep browsing

Same degree, same syllabus slot, different idea. Pick the one your guide will actually approve.

B.Tech / B.E.Code included

Aerospace / Aeronautical

Low-Speed Open-Circuit Wind Tunnel with Force Balance for Aerofoil Lift-Drag Measurement

Build a subsonic test tunnel on a student budget, then trace lift and drag on a 3D-printed NACA 0012 against theory

  • C / Arduino Uno (industry-standard extra) — HX711 load-cell and serial logging firmware
  • Python (NumPy, Matplotlib) — calibration, force coefficients and plots
  • MATLAB / Scilab — thin-airfoil theory overlay and regression
  • +4

intermediate14 wk4 students