1. Home
  2. Explore
  3. Engineering
  4. Arduino SCARA Robot

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Arduino SCARA Robot

🤖 Arduino-Based SCARA Robot

Overview

This project involves building a SCARA Robot (Selective Compliance Assembly Robot Arm) using an Arduino UNO as the brain. The robot has 4 degrees of freedom driven by 4 NEMA 17 stepper motors plus a servo motor (MG996R) for the gripper. The control interface is built in Processing with forward and inverse kinematics.

SCARA robots are known for their rigid construction in the horizontal plane and compliance in the vertical direction, making them ideal for assembly tasks.

  • Components: Arduino UNO, CNC shield, four A4988 stepper drivers, 12V/6A power supply, micro switches for homing.

  • Control Methods: Forward kinematics (manually set joint angles → compute end‑effector position) and inverse kinematics (set desired position → compute required joint angles). Both methods can be used simultaneously from the same GUI.

  • Automation: Save movement sequences (angles) to an array; pressing “Run” executes them in a loop.

  • Speed/Acceleration: Adjustable from the GUI, though acceleration implementation has limitations (see Software section).


Mechanical Design

🖨️ 3D Printed Parts

The robot is designed for 3D printing on machines like Creality CR‑10 or Ender3. Parts are sized to fit even on smaller print beds.

  • Material: PLA+ for structural parts, normal PLA for pulleys and gripper.

  • Printing Settings: Use Horizontal Expansion of −0.1 mm to improve fit with bearings, rods, and bolts.

  • Print Time: ~120 hours at 60 mm/s. Base took ~32 hours.

  • Parametric Pulleys: GT2 pulleys are designed parametrically – changing the number of teeth automatically updates dimensions.

⚙️ Transmission and Joints

  • Joint 1: Two‑stage reduction with GT2 belts – 20:1 reduction ratio. Uses a closed 200 mm belt (motor → middle pulley) and a 300 mm belt (middle pulley → joint pulley).

  • Joint 2: Also two‑stage reduction – 16:1 ratio. Belts: 400 mm and 300 mm.

  • Joint 3: Single‑stage reduction – 4:1 ratio with a 400 mm belt.

  • Bearings per joint: Two thrust bearings and one radial ball bearing. Sizes vary: Joint 1 uses 35 mm inner/47 mm outer radial and 40 mm/60 mm thrust; Joints 2 and 3 use smaller (30/42 radial, 35/52 thrust).

  • Joints are hollow to pass wires through (motor wires, micro switch wires, gripper cable).

📐 Belt Length Sizing

The designer used a sensor feature in 3DEXPERIENCE SolidWorks to dimension pulley centerlines. A closed loop of pulleys is created, then a sensor tracks the total path length. Adjusting centerline distance yields the desired belt length.

Z‑Axis

  • Lead screw: 8 mm diameter, 38 cm long (cut from longer stock).

  • Guide rods: Four 10 mm smooth rods, 40 cm long.

  • Linear bearings: Sliding on the rods. The lead screw nut is secured in the arm.

  • Height depends on rod length; lead screw is 2 cm shorter to fit, or the top motor can be raised 2 cm with spacer nuts.

Gripper (End Effector)

  • Driven by MG996R servo.

  • Two sides slide on 6 mm rods; connected to servo horn via 3D printed links and M3 bolts.

  • Gripper ends are interchangeable – can be swapped for different shapes or sizes.

  • Attached to the robot arm with M4 bolts.


Step‑by‑Step Assembly

🔧 Base Assembly

  1. Insert radial bearing (35×47 mm) into the base.

  2. Place first thrust bearing (40×60 mm) on top (between pulley and base).

  3. On the other side of the base, add second thrust bearing and the joint coupler.

  4. Couple the pulley and upper part using four M4×55 bolts with self‑locking nuts. Tighten so the joint is sturdy but free to rotate.

  5. Install the middle pulley with two 608 ball bearings (one top, one bottom). Secure with M8×45 bolt, washer, and self‑locking nut. (Note: M8 bolt head placed at bottom to fit inside base.)

  6. Mount the stepper motor for Joint 1 using four M3 bolts, pairing it with the middle pulley via 200 mm belt. Stretch belt before tightening.

  7. Check belt tension; if loose, add idler pulleys on slots (use M5×35 bolts and nuts to create tightening pulleys on both sides).

  8. Install micro switch for Joint 1 (solder wires beforehand – space is tight). Secure with M3×20 bolt and nut (only one bolt fits; a shorter bolt glued on the other side).

Z‑Axis Assembly

  1. Secure the Z‑axis bottom plate on top of the joint coupler.

  2. Attach four clamps for the smooth rods.

  3. Insert the four smooth rods; they go all the way down into the joint coupler. Tighten rods with clamps (M4 bolts and nuts).

  4. Insert the bearing for the lead screw.

  5. Slide on a cover piece to hide the hardware.

Arm 1 Assembly

  1. Install linear bearings into the arm’s lower part (tight fit; use horizontal expansion if needed).

  2. Pair the two arm parts with four M5×25 bolts. (Tightening may be tight – model was later updated for better access.)

  3. Install the second stepper motor (NEMA 17) with a 20‑tooth GT2 pulley.

  4. Secure the lead screw nut.

  5. Install belts for Joint 2: 400 mm (motor → middle) and 300 mm (middle → joint). Bearings are smaller here.

  6. Insert six M4×20 bolts into the hexagon slots of the joint coupler – these will attach Arm 2.

  7. Use idler pulleys for belt tensioning if needed.

  8. Install micro switch for Joint 2.

🔄 Tension and Backlash Improvement

After assembling Arm 2 to the joint coupler, excessive play was noticed. The M4 bolts loosely fit in the holes. Solution: drill holes to 4.5 mm and use M5 bolts instead. The 3D model was updated to have 3.5 mm holes for M4 bolts. This significantly reduced backlash (only belt backlash remains).

Arm 2 Assembly

  1. Install the third stepper (shorter NEMA 17 – 24 mm length for lighter weight).

  2. Single‑stage reduction with a 400 mm belt.

  3. Before merging lower and upper arm parts, pass all wires through the hollow second joint:

    • Motor wires for Joint 3

    • Micro switch wires

    • End‑effector cable (4‑wire cable, using 3 wires for servo)

  4. Insert M4 nuts in upper arm slots for securing the lower part.

  5. Route wires under hooks to keep them clear of moving parts. Use a simple wire holder to prevent wires from catching on pulley nuts.

  6. Snap‑fit the arm cover onto Arm 1.

Final Assembly

  1. Insert the complete arm assembly onto the Z‑axis rods.

  2. Prepare the Z‑axis top plate: install micro switch, attach four clamps.

  3. Slide a cover piece above the bottom, then attach the top plate, tightening with clamps.

  4. Insert and cut the lead screw to 38 cm (if longer).

  5. Attach the fourth stepper motor (Z‑axis) using a 5 mm‑to‑8 mm shaft coupler.

  6. Pass wires through the top cover and secure it with two bolts.

Cable Management

  • Use cable sleeves and zip ties.

  • Mark each wire (e.g., for motor phases, micro switch) before inserting into sleeves to avoid incorrect connections.

Gripper Assembly

  • Assemble the gripper on the end of Arm 2. Use M3 bolts and nuts. Space is tight – patience required.

  • Connect servo to the previously installed 4‑wire cable (3 wires used).

  • Attach gripper to arm with M4 bolts and nuts.

Base Mounting

  • Secure the robot base to a 20 mm thick piece of wood using 12 holes on the bottom of the robot base.

  • Print a hole pattern template, drill holes in wood, countersink for flat‑head bolts, insert M4 nuts into base slots, and bolt the wood to the robot.

  • Clamp the wood base to a table for stability.


⚡ Electronics

Components

  • Arduino UNO (or MEGA with RAMPS board)

  • CNC Shield v3 (often used for GRBL) – acts as a breakout board for stepper drivers

  • Four A4988 stepper drivers with heat sinks

  • 12V power supply, minimum 4 A (recommended 6 A)

  • Micro switches (3 for joints, 1 for Z‑axis) – for homing limits

  • Servo motor (MG996R) for gripper

Connections

  • A4988 drivers are set to quarter‑step mode by placing jumpers on the CNC shield's step‑select pins (MS1, MS2, MS3).

  • Stepper motors connected to the shield’s motor outputs (X, Y, Z, A channels).

  • Micro switches connected to the limit‑switch pins on the shield.

  • Servo motor connected to a spare pin (or separate 5V supply if needed).

  • A circuit diagram was provided (refer to original source for exact wiring).

Current Limiting: Set stepper driver current to the lowest practical level to avoid overheating. Higher current may require better cooling.

Enclosure

  • 3D printed case for Arduino UNO + CNC shield (attaches to robot base).

  • Wires squeezed into the case, leaving driver heat sinks exposed for cooling.


🧮 Kinematics

Forward Kinematics

Purpose: Given joint angles θ1\theta_1θ1​ (shoulder) and θ2\theta_2θ2​ (elbow), find the end‑effector position (X,Y)(X, Y)(X,Y).

Equation (from trigonometry, using link lengths L1L_1L1​ and L2L_2L2​):

X=L1cos⁡(θ1)+L2cos⁡(θ1+θ2)X = L_1 \cos(\theta_1) + L_2 \cos(\theta_1 + \theta_2)X=L1​cos(θ1​)+L2​cos(θ1​+θ2​)
Y=L1sin⁡(θ1)+L2sin⁡(θ1+θ2)Y = L_1 \sin(\theta_1) + L_2 \sin(\theta_1 + \theta_2)Y=L1​sin(θ1​)+L2​sin(θ1​+θ2​)
  • On the GUI, sliders set θ1\theta_1θ1​ and θ2\theta_2θ2​ directly; the program calculates and displays X,Y,ZX, Y, ZX,Y,Z (Z from lead screw position).

Inverse Kinematics

Purpose: Given desired (X,Y)(X, Y)(X,Y) coordinates, calculate the required joint angles θ1\theta_1θ1​ and θ2\theta_2θ2​.

Equation:

cos⁡(θ2)=X2+Y2−L12−L222L1L2\cos(\theta_2) = \frac{X^2 + Y^2 - L_1^2 - L_2^2}{2 L_1 L_2}cos(θ2​)=2L1​L2​X2+Y2−L12​−L22​​
θ2=arccos⁡(cos⁡(θ2))(elbow angle)\theta_2 = \arccos(\cos(\theta_2)) \quad \text{(elbow angle)}θ2​=arccos(cos(θ2​))(elbow angle)
θ1=arctan⁡2(Y,X)−arctan⁡2(L2sin⁡(θ2),L1+L2cos⁡(θ2))\theta_1 = \arctan2(Y, X) - \arctan2(L_2 \sin(\theta_2), L_1 + L_2 \cos(\theta_2))θ1​=arctan2(Y,X)−arctan2(L2​sin(θ2​),L1​+L2​cos(θ2​))
  • Adjustments are made for quadrant using if statements (e.g., handling angles beyond ±180°).

  • A third angle ϕ\phiϕ (phi) sets the orientation of the gripper (not part of the 2‑link IK; computed separately).

Z‑Axis Control

  • The Z‑axis is controlled by a lead screw. The stepper motor rotation is directly translated into vertical movement (no kinematic transformation needed). Homing is achieved with a micro switch.


💻 Software & Control

Programming Environment

  • Processing (Java‑based) for the GUI.

  • Arduino code for motor control and serial communication.

  • Libraries:

    • controlP5 (Processing) – buttons, sliders, text fields.

    • AccelStepper (Arduino) – stepper motor control.

GUI Features

  • Sliders (left side): manual control of θ1\theta_1θ1​, θ2\theta_2θ2​, and gripper angle.

  • Text fields (right side): input X, Y coordinates for inverse kinematics.

  • Real‑time display: computed X, Y, Z and joint angles update live.

  • Save button: stores the current joint angles into an array (sequence of positions).

  • Run button: executes stored positions in order, looping repeatedly.

  • Speed/Acceleration sliders: adjust movement parameters.

Serial Communication

  • The Processing program sends data as one long string via serial port.

  • Arduino parses the string, extracting:

    • Joint angles (θ1,θ2\theta_1, \theta_2θ1​,θ2​), gripper value

    • Speed and acceleration values

    • Command flags (Save, Run, etc.)

  • After parsing, Arduino updates the stepper motor targets accordingly.

Motor Control

  • AccelStepper library used. However, it cannot implement acceleration/deceleration when controlling multiple steppers simultaneously (a known limitation). The designer still implemented some acceleration, but it is not smooth.

  • The robot moves to a home position on startup (using micro switches).

Code Availability

Full commented code is available on the project website. Includes detailed explanations of kinematics equations and serial parsing.


🔍 Performance Notes & Limitations

  • Backlash: Primarily from the GT2 belts. Additional play was reduced by using M5 bolts instead of M4 in the joint couplings.

  • Rigidity: The robot is not as rigid as expected. The entire Z‑axis and arm assembly is supported only by the first joint. The plastic base can bend under stress from weight and inertial forces. This is acceptable for learning but limits precision.

  • Acceleration: Not fully smooth due to the limitations of the AccelStepper library.

  • Versatility: The robot can be adapted for other end‑effectors – e.g., a 3D‑printer hot end or a laser head. The designer plans future projects with these modifications.

Despite limitations, this project provides an excellent hands‑on introduction to SCARA robot design, kinematics, and control for hobbyists and students.


Final Notes

  • All STL files and the full 3D model are available for download.

  • A complete list of bolts, nuts, bearings, and electronic components is provided on the project website.

  • The robot can be used both manually (via GUI) and automatically (pre‑programmed sequence).

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent