Robotic arm that picks and sorts by colour

Pick-and-place robots sort parts on every factory line, but industrial arms cost lakhs. A four-axis arm that sees an object's colour and places it in the right bin teaches kinematics, servo control and sensing.

Arduino UnoMajor projectMECH, ECE, EEE
UNOIRCOLOUR66°Featured
Parts
₹4,100
Build
14 weeks
Board
Arduino Uno
Objectives
5

Block diagram

Inputs
  • IR
    IR sensorDetects an object at the pick spot
  • COLOUR
    Colour sensorReads the object's colour
  • ESP32
    CameraCaptures a photo when the event happens+
Controller
  • UNO
    Arduino UnoPlans the moves
Power
  • SUPPLY
    5 V 3 A supplyServo power
Outputs
  • 66°
    PCA9685 servo driverDrives four servos smoothly
  • DOF
    4-DOF armPicks and places

Objectives

  1. To compute joint angles for a target point with inverse kinematics.
  2. To identify red, green, blue and yellow objects reliably under room light.
  3. To pick and place each object in its bin within 8 s.
  4. To measure placement accuracy and success over 40 picks.
  5. To capture and store an image automatically when an event is detected.

Parts and specifications

Total about ₹4,100 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Inverse kinematics (planar)

Upper arm L1 = 8 cm, forearm L2 = 8 cm, target r = 12 cm, z = 2 cm: D = (r² + z² − L1² − L2²) / (2 L1 L2) = (144 + 4 − 128) / 128 = 0.156, elbow θ2 = acos(0.156) = 81°, shoulder θ1 = atan2(z, r) + atan2(L2 sin θ2, L1 + L2 cos θ2) = 9.5° + 41° = 50.5°. Base = atan2(y, x).

Servo pulse from angle

PCA9685 at 50 Hz has 4096 steps per 20 ms; 0.5 to 2.5 ms = 102 to 512 counts. 90° ≈ 307 counts.

Colour decision

Normalise r, g, b by clear (c) to remove brightness, then nearest stored reference in rgb space. Red block: r/c = 0.55, g/c = 0.22, b/c = 0.20.

Supply

Four servos can draw 2.5 A together when moving; the 5 A buck with a 1000 µF capacitor avoids resets.

Pin map

SignalPin or connection
PCA9685 SDA / SCLA4 / A5 (0x40); TCS34725 on the same bus (0x29)
Servo channels base / shoulder / elbow / gripperPCA9685 ch 0 / 1 / 2 / 3, V+ from the 5 V 3 A buck
IR object sensorD2
Colour sensor LEDTCS34725 LED pin to D3

Firmware outline

  1. Calibrate: record pulse counts for 0° and 180° on each servo; store reference colours for each block.
  2. Wait for the IR sensor; move the sensor arm or read the colour at the pick spot.
  3. Compute IK for the pick point; move each joint in small steps (smooth motion) and close the gripper.
  4. Lift, compute IK for the bin of that colour, place, open, return home.
  5. Count sorted items per colour; flag unknown colours to a reject bin.

Test plan

TestExpected result
40 blocks in four coloursSuccess rate and wrong bins
Room light vs lampColour accuracy
Target points across the workspacePlacement error in mm
Cycle timeUnder 8 s per block

These rows start your results table when you plan the project.

Viva practice

Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.

1. What is inverse kinematics?
2. Why normalise colour readings?
3. Why a PCA9685?
4. What limits the arm's accuracy?
5. How do industrial arms differ?

Make it yours

One or two upgrades for a mini project, two to four for a major one.

Build these first

Datasheets and sources to cite

  • Craig, Introduction to Robotics: Mechanics and Control
  • NXP PCA9685 datasheet
  • ams TCS34725 datasheet

About this project

How much does the robotic arm that picks and sorts by colour project cost?

About ₹3,400 for the parts in the base list: Arduino Uno R3 (CH340 clone), 4-DOF acrylic robot arm kit, MG90S or SG90 servos × 4, PCA9685 16-channel servo driver, TCS34725 colour sensor, IR obstacle sensor module, XL4015 buck (servo 5 V 3 A), 12 V 2 A DC adapter, Coloured blocks and three bins.

How long does it take?

About 12 weeks for the base project, built on an Arduino Uno. Each upgrade adds time.

Which branches is it suitable for?

Mechanical / Mechatronics, Electronics and Communication, Electrical and Electronics, as a major project.

Which pins and design calculations does it use?

PCA9685 SDA / SCL on A4 / A5 (0x40); TCS34725 on the same bus (0x29); Servo channels base / shoulder / elbow / gripper on PCA9685 ch 0 / 1 / 2 / 3, V+ from the 5 V 3 A buck; IR object sensor on D2. Worked calculations on this page: inverse kinematics (planar), servo pulse from angle, colour decision, supply.

How do I test it?

40 blocks in four colours: Success rate and wrong bins. Room light vs lamp: Colour accuracy. Target points across the workspace: Placement error in mm. Cycle time: Under 8 s per block.

What are the objectives?

To compute joint angles for a target point with inverse kinematics. To identify red, green, blue and yellow objects reliably under room light. To pick and place each object in its bin within 8 s. To measure placement accuracy and success over 40 picks.