Jewel Nath
← Home

ConveySort-Arm

A small sorting cell built at RoboAI from low-cost parts. A conveyor belt brings each block to a six-servo arm, a webcam and OpenCV measure it, and the arm sets it down in the place for its size.

Built and runOct – Nov 2024My part: with Shafiul Alam Chowdhury, its design, build and tests; the sorter’s vision program and its Arduino firmware are mine

What it shows

Vision
OpenCV sizes each block by the area of its outline, and waits for eleven frames in a row to agree before it decides
Control
An Arduino runs a stepper belt that stops each block at an ultrasonic sensor, and a 15-step pick-and-place on six servos
Simple interfaces
The PC and the Arduino share one character per sort over serial
Timing
35 to 38 s per sort, computed from the firmware

Built and run · Oct – Nov 2024

A belt, a camera and an arm

A belt turned by a stepper motor ends at an ultrasonic sensor. A webcam looks down at the belt, and the arm stands beside its end, where it can reach the stopped block and three set-down places around its base.

The whole cell at work · Nov 2024

In video

Short silent clips. Tap one to play it.

Before the camera, and the camera’s view

  • Nov 2024

    One full cycle: the belt brings a block to the sensor, and the arm picks it up and sets it down

  • Nov 2024

    The tuning window: blocks placed on the belt by hand, each outlined, measured and called large, medium or small

The build

  1. 5 Oct 2024

    The first version on one board: a cloth belt, the stepper, the sensor, an Arduino and the arm.

  2. 11 Nov 2024

    A black belt that ends at the sensor; a block rides toward it.

  3. 16 Nov 2024

    The gripper closes on a block at the sensor, the stepper driver in front.

  4. 16 Nov 2024

    The conveyor from above, with the three test sizes.

  5. 16 Nov 2024

    The webcam on its first stand, looking down at the belt.

ConveySort-Arm in 2024, from the repository’s history and the dated photos and videos (from the report)

How it works

A PC sees, an Arduino moves

The work is split between a PC and an Arduino Uno. The PC reads the webcam and sizes the block; the Arduino runs everything that moves. The two agree on four characters: 0 sends the arm home, and 1, 2 and 3 sort a small, a medium or a large block.

Datasheet

Arm
Six servos: base, shoulder, elbow, wrist pitch, wrist roll and gripper, on a PCA9685 board
Belt
A stepper motor through a TB6600 driver
Sensor
An HC-SR04 ultrasonic sensor at the end of the belt
Controller
An Arduino Uno: the belt, the sensor and the arm
Vision
A webcam, and Python with OpenCV on a PC
Link
USB serial at 9600 baud, one character per sort

The whole cell

System overview, from the ConveySort-Arm report. Tap to open it large.

How long a sort takes

ComputedThe time of one sort, from the command to the arm back home, worked out from the firmware as committed in 2026. Not measured over many blocks.

a small block
35.0 s
a medium block
36.5 s
a large block, whose place is furthest round
37.9 s
of each sort is the one-second pause after each of its 21 moves
21 s

Sizing a block

The PC turns each camera frame grey, blurs it, and keeps only the white block on the black belt. OpenCV finds the block’s outline, and its area decides the size: under 17,000 square pixels it is small, under 28,000 medium, and anything larger is large.

A single frame can be wrong while a hand passes or the block still moves. So the program sends a size only when eleven frames in a row agree, and at most once every five seconds.

How the PC sizes a block
The size classes by outline area
When the PC sends a size

The belt

The Arduino reads the ultrasonic sensor every 100 ms. With a block 7 to 45 cm away it runs the belt, and when the block is within 7 cm, at the belt’s end, it stops. It acts on a size only when the belt has stopped with a block in place, so a size sent early does no harm.

The belt’s states, from the distance the sensor reads
The Arduino’s connections

The pick and place

The arm sorts a block in 15 steps, each moving one joint: it reaches over the belt, grips the block, lifts it, turns its base to the block’s place, lowers it and lets go. Then it goes home, joint by joint: 21 moves in all. Two steps depend on the size: the grip closes wider for a larger block, and the base turns to 90°, 50° or 10°.

Each joint moves in small steps, about 45° a second, with a pause after each move, chosen to keep the hobby servos steady.

The 15-step pick-and-place
Joint angles over one sort, computed from the firmware
The time of one sort by block size, computed from the firmware

A ROS 2 workspace, written

Beside the sorter, the repository holds a ROS 2 Humble workspace for the arm: its model, a hardware interface, MoveIt and a task server. It is adapted from Antonio Brandi’s course on manipulators, changed for six servos instead of four, with the arm’s model from EnviroBot. As written, its task presets still fit the course’s arm.

Running the arm from it was the next step; the project ended first, with the sorter working on its own. The workspace is written, not run, and the sorter does not use it.

The ROS 2 workspace: ten packages, written but not run

My part, and the team

Built at RoboAI

ConveySort-Arm is RoboAI’s work, built by Shafiul Alam Chowdhury and me. We designed, built and tested it together; the sorter’s vision program and its Arduino firmware are mine, and I put its code into its public repository and wrote its technical report.

The team

  • Jewel Nath
  • Shafiul Alam Chowdhury

Built on

Each file taken from another project keeps its own licence notice; the rest of the code is under the MIT licence.

What I learned

A physical stop makes picking easy

Stopping each block at the same point, with an ultrasonic sensor, let one fixed sequence pick every block. No grasp planning was needed.

Let each board do what it does well

The PC handled the camera and OpenCV; the Arduino handled timing and motors. One character per sort was all they needed to share.

Slow is reliable, but pauses add up

Small steps and a pause after each were chosen to keep the hobby servos steady, at the cost of a sort that takes over half a minute.

The report

Read the full design

13 pages and 13 diagrams, checked against the code, its history and the dated photos and videos, with Shafiul Alam Chowdhury as co-author.

Technical report · v1.0 · Zenodo · Oct 2026

ConveySort-Arm: A Low-Cost Vision-Guided Sorting Cell with a Conveyor Belt and a Six-Servo Arm — Design and Prototype

J. Nath, S. A. Chowdhury

DOI 10.5281/zenodo.23741975

Next: Pi Car

A Raspberry Pi 3 car I built and coded alone in 2022: it follows a line, avoids obstacles, stops at a table’s edge and drives from a live-video panel.