The combination of an Arduino CNC shield and GRBL firmware has democratised desktop CNC machining. For under ₹2,000 in hardware, you can build a fully capable 3-axis CNC router, laser engraver, or foam cutter that speaks industry-standard G-code and connects to professional CAM software. This guide walks you through every step: choosing your shield, flashing GRBL, wiring stepper drivers, configuring critical GRBL settings, and sending your first job — all without needing a dedicated motion control computer.
Table of Contents
- 1. What Is GRBL and Why Use It?
- 2. Hardware Overview: Shield, Drivers, and Steppers
- 3. Complete Wiring Guide
- 4. Flashing GRBL to Arduino Uno
- 5. Critical GRBL Configuration Parameters
- 6. G-code Senders: UGS, Candle, and LaserGRBL
- 7. Running Your First CNC Job
- 8. Common Problems and Fixes
- FAQ
1. What Is GRBL and Why Use It?
GRBL is open-source, high-performance firmware for Atmel AVR processors (primarily the ATmega328P inside the Arduino Uno). It implements a complete G-code interpreter, real-time motion planning with look-ahead buffering, acceleration control, homing, and limit switch support — all running on a microcontroller that costs under ₹300.
The key advantages of GRBL over simple stepper libraries:
- Bresenham-based motion planning: Smooth multi-axis interpolation with velocity ramping between moves.
- G-code compatibility: Accepts standard G-code from Fusion 360, Inkscape, LightBurn, and virtually any CAM tool.
- Real-time overrides: Adjust feed rate and spindle speed during a job without stopping.
- Homing and work coordinates: Repeatable zero-point referencing with limit switches.
- Active community: GRBL 1.1h is the stable release; grblHAL extends it to 32-bit platforms.
GRBL occupies the full Arduino Uno program space (~32KB), leaving no room for user sketches — the Uno becomes a dedicated CNC controller. For CNC applications needing additional I/O (tool change, coolant, probing), the Arduino Mega 2560 with RAMPS 1.4 is a common alternative.
2. Hardware Overview: Shield, Drivers, and Steppers
The Arduino CNC Shield v3 (also called the GRBL CNC Shield) is the most widely used shield for GRBL builds. It slots directly onto an Arduino Uno and provides:
- 4 stepper driver sockets (X, Y, Z, and A — the fourth can clone the Y axis for dual-Y gantry machines)
- Dedicated enable, step, and direction pins for each axis (pre-wired to GRBL’s expected pins)
- Limit switch headers for X, Y, and Z (min/max)
- Spindle PWM and direction output
- Cool enable pin
- E-stop / Abort pin
- Microstepping jumpers (MS1, MS2, MS3) under each driver socket
Stepper driver options:
- A4988: 1A continuous (2A peak), up to 1/16 microstepping. The standard choice for NEMA 17 motors at moderate speeds. Requires Vref adjustment with a multimeter.
- DRV8825: 1.5A continuous (2.2A peak), up to 1/32 microstepping. Better for higher-resolution axes and slightly higher current motors. 6.3 µH minimum inductance requirement.
- TMC2208/TMC2209: 1.4A/2A continuous, StealthChop2 for near-silent operation. Drop-in replacements but require Vref or UART current setting and direction inversion in GRBL.
Stepper motor selection: NEMA 17 motors (42mm frame) are standard for desktop CNC. For a router cutting wood or acrylic, choose 1.5–2A, 40–50 N·cm holding torque. For a laser engraver (no cutting forces), 1A motors suffice.
3. Complete Wiring Guide
Before wiring, gather: Arduino Uno, CNC Shield v3, three stepper drivers (A4988 or DRV8825), 12V 5A PSU (for motors), USB cable, and three stepper motors.
Step 1 — Microstepping jumpers: Place jumpers under each driver socket for desired microstepping. For A4988: all 3 jumpers = 1/16 step. For DRV8825: all 3 jumpers = 1/32 step. Higher microstepping = smoother motion but lower torque and slower max speed.
Step 2 — Install drivers: Insert A4988/DRV8825 into X, Y, Z sockets. CRITICAL: Check orientation. The Enable (EN) pin on the driver must align with the EN pin on the shield. Installing backwards permanently destroys the driver. The A4988 has the potentiometer facing the USB port side on the CNC Shield v3.
Step 3 — Set Vref: Power the shield from 12V only (no USB yet). Measure Vref between the driver potentiometer and GND with a multimeter. For A4988: Vref = Imax × 0.8 (so for 1.2A motor: Vref = 0.96V). For DRV8825: Vref = Imax / 2 (so for 1.5A: Vref = 0.75V). Adjust the pot while measuring.
Step 4 — Connect motors: Wire each stepper’s 4 coils (A1, A2, B1, B2) to the motor terminals on the shield. Identify coil pairs with a multimeter (continuity between paired wires). Wrong pairing makes the motor vibrate without rotating.
Step 5 — Limit switches: Wire normally-open (NO) microswitches between Xmin/Ymin/Zmin pins and GND. GRBL’s default configuration uses normally-open switches (enable invert mask $5=0 for NO, $5=7 for NC).
Step 6 — Power: Connect 12V to the shield’s VMotor terminal (NOT the Arduino’s Vin — they are separate). Connect Arduino to PC via USB.
4. Flashing GRBL to Arduino Uno
GRBL is flashed like any Arduino sketch, but the official method uses a pre-compiled binary or the GRBL library approach. The library approach is recommended for customisation:
Method 1 — Arduino IDE Library (recommended):
- Download GRBL 1.1h from
github.com/gnea/grbl/releases(download the Source code .zip) - In Arduino IDE: Sketch → Include Library → Add .ZIP Library → select the downloaded zip
- Open: File → Examples → grbl → grblUpload
- Select Board: Arduino Uno, correct COM port
- Click Upload. GRBL flashes in about 15 seconds.
Method 2 — Pre-compiled hex with avrdude:
avrdude -p atmega328p -c arduino -P /dev/ttyUSB0 -b 115200
-U flash:w:grbl_v1.1h.atmega328p.hex:i
After flashing, open Serial Monitor at 115200 baud. You should see:
Grbl 1.1h ['$' for help]
Type $ and press Enter to see all configuration parameters. Type $$ for current values.
5. Critical GRBL Configuration Parameters
GRBL stores settings in EEPROM, sent via serial as $N=value commands. Essential parameters to configure:
$0=10 ; Step pulse time (microseconds) — don't change
$1=25 ; Step idle delay (ms) — time before drivers disable
$2=0 ; Step port invert mask — 0=normal
$3=0 ; Direction port invert mask — flip if axis moves backwards
$4=0 ; Step enable invert — 0=active LOW (standard)
$5=0 ; Limit switch invert — 0=NO switches, 1=NC switches
$10=1 ; Status report mask
$20=0 ; Soft limits enable (needs homing first)
$21=0 ; Hard limits enable (immediate stop on switch)
$22=1 ; Homing cycle enable — 1 to use limit switches
$23=0 ; Homing direction invert mask
$24=25.0 ; Homing feed rate (mm/min) — slow approach
$25=500.0 ; Homing seek rate (mm/min) — fast search
$27=1.0 ; Homing pull-off distance (mm)
$100=800 ; X steps/mm — (steps/rev × microsteps) / (pitch mm)
$101=800 ; Y steps/mm
$102=800 ; Z steps/mm
$110=1000 ; X max feed rate (mm/min)
$111=1000 ; Y max feed rate (mm/min)
$112=500 ; Z max feed rate (mm/min)
$120=50 ; X acceleration (mm/sec²)
$121=50 ; Y acceleration (mm/sec²)
$122=30 ; Z acceleration (mm/sec²)
$130=200 ; X max travel (mm)
$131=200 ; Y max travel (mm)
$132=100 ; Z max travel (mm)
Calculating steps/mm: For a NEMA 17 with 200 steps/rev, A4988 at 1/16 microstepping, and 2mm pitch leadscrew:
steps/mm = (200 × 16) / 2 = 1600
For GT2 belt with 20-tooth pulley (40mm per rev):
steps/mm = (200 × 16) / 40 = 80
Send settings via serial: $100=1600 then Enter. GRBL confirms with ok.
6. G-code Senders: UGS, Candle, and LaserGRBL
GRBL accepts G-code over serial (115200 baud), but a G-code sender provides a visual interface, file streaming, and real-time control:
- Universal Gcode Sender (UGS): Java-based, cross-platform, supports GRBL 1.1 fully including overrides and probing. Best choice for routing/milling.
- Candle: Qt-based, Windows-primary, fast visualiser with 3D toolpath preview. Very popular for desktop CNC routers.
- LaserGRBL: Windows-only, optimised for laser engravers. Built-in image-to-G-code converter, excellent for beginners.
- CNCjs: Node.js web-based, runs as a server on Raspberry Pi for headless operation. Accessible from any browser on the network.
After connecting, always perform homing ($H) before the first job to establish machine coordinates. Then set work offsets (G92 X0 Y0 Z0 or use the sender’s zero-all button).
7. Running Your First CNC Job
For a first test job, use a pen plotter setup (no spindle, no cutting). Place a pen in the Z axis, paper on the bed. Generate G-code from Inkscape using the Gcodetools extension or from a simple rectangle in your CAM software.
A minimal test G-code file:
G21 ; Metric mode
G90 ; Absolute coordinates
G92 X0 Y0 Z0 ; Set current position as origin
F500 ; Feed rate 500 mm/min
G0 Z5 ; Lift pen
G0 X0 Y0 ; Move to origin
G1 Z-1 F100 ; Lower pen (1mm down)
G1 X50 F500 ; Draw 50mm line
G1 Y50 ; Turn corner
G1 X0 ; Another side
G1 Y0 ; Back to start
G0 Z5 ; Lift pen
M30 ; End program
Stream this file from UGS or Candle. Watch for alarm states — GRBL will halt on soft/hard limit triggers and require $X (unlock) before resuming.
8. Common Problems and Fixes
- Motor moves but loses steps: Vref too low, acceleration too high, or current too low. Increase Vref slightly, reduce $120/$121/$122.
- Motor vibrates but doesn’t rotate: Coil wiring incorrect. Swap A2 and B1 wires (or A1 and B2). Check continuity between motor wire pairs.
- GRBL shows ALARM:3 (travel exceeded): Machine coordinates outside $130/$131/$132 limits. Home the machine and verify max travel settings.
- ALARM:1 (hard limit triggered): Limit switch triggered during move. Set $21=0 to disable hard limits during initial testing, or check switch wiring and invert mask ($5).
- Axis direction reversed: Flip direction with $3 invert mask or swap one coil pair (A1↔A2 or B1↔B2).
- TMC2208 drivers move wrong direction: TMC2208 in standalone mode has reversed direction compared to A4988. Invert the axis in $3 (e.g., $3=7 to invert all axes).
- Shield gets very hot: Motor current (Vref) is too high. Reduce Vref and add heatsinks to drivers. The shield’s copper pours help but are not sufficient at full rated current without cooling.
Frequently Asked Questions
Can GRBL run on an Arduino Mega instead of Uno?
Standard GRBL 1.1h targets ATmega328P (Uno only). For the Mega, use MegaGRBL or grblHAL, which add support for additional axes and I/O. The RAMPS 1.4 shield is the standard Mega-based CNC controller board.
How fast can a GRBL CNC router cut?
This depends on motor torque, machine rigidity, and material. Typical desktop CNC routers run 500–2000 mm/min for wood, 100–500 mm/min for aluminium. GRBL itself can handle up to ~30,000 steps/second per axis, which is rarely the limiting factor.
What is the difference between GRBL 0.9 and 1.1?
GRBL 1.1h (current stable) adds real-time feed and spindle overrides, improved laser mode ($32=1), better arc handling, and variable spindle speed via PWM. Always use 1.1h for new builds — 0.9 is obsolete.
Can I use GRBL for a laser engraver?
Yes — enable laser mode with $32=1. In laser mode, GRBL uses M4 (dynamic power) instead of M3, scaling laser power proportionally to feed rate. This eliminates burn marks at corners where the machine slows down. LaserGRBL is the recommended sender for laser projects.
Do I need limit switches for GRBL to work?
Limit switches are not mandatory for basic operation. Set $22=0 (homing disabled) and $21=0 (hard limits disabled) to operate without switches. However, without homing you cannot use soft limits or save repeatable work offsets across sessions.
Ready to build your CNC machine? Explore our full Arduino boards and CNC components collection at Zbotic — everything you need from Uno boards to stepper drivers, shipped across India.
Add comment