Introduction: Phantomx Pincher Color Sorting

This instructable show how to use a Phantomx pincher and CMUcam5 pixy to make a color sorting robot cell.

The robot will be able to sort objects of two colors (blue and green) by grapping an object from a set position and moving it to the Pixy camera. The position where the robot should pick up the object will be adjustable. The user can teach the robot where to pick up its objects in a easy and user friendly way.

In this example the robot is picking up objects coming from a conveyor line. the objects will then be placed on what is simulated as pallets. (The conveyor is optional and not a part of this instructable, because the robot is made with the teach function that allows the robot to pick up objects from anywhere)

This is a project made at University College Nordjylland, Denmark. The participants in this project is students educating to become Automation Engineers.

See video above for demonstration of the teach function, followed by a run through a full sequence.
Please vote if you like this instructable! ;-) thanks..


Esben Winkel Sigsgaard
Heri Lamhauge Jensen
Andreas Kjær Jellesen
Thai Quang Huy Nguyen

Step 1: Equipment

Robot arm

Color detection camera

  • 1 pcs CMUcam5 Pixy (
  • Software - PixyMon (

Control panel (

  • 1 pcs Robot Geek Large Workbench
  • 3 pcs RobotGeek Pushbutton
  • 1 pcs RobotGeek LED Driver
  • 1 pcs RobotGeek Rotation Knob
  • 5 pcs Electronic Brick - Fully Buckled 3 Wire Cable

Step 2: Arduino and Pixy Setup

Arduino board

Digital input 0 : Push button - Relax servos (input)

Digital input 1 : Push button - Set position (input)

Digital input 2 : Push button - Run (input)

Digital input 3 : LED Driver - LED (output)

Analog input 0 : Rotation Knob - Gripper (input)

ISP PIN : CMUcam5 Camera to arduino (communication)

HLK : Computer - Arduino (communication)

Pixy Camera

J1 : Computer - PixyMon (communication)

J2 : Arduino - Camera (communication)

See second picture which shows PIN text references.

Step 3: Upload Programs

To start the set up, the programs for the camera and the arduino board have to be uploaded.

Connect computer to camera and arduino via USB (See step 2 for instructional links)

To upload to the arduino board:

  1. Unzip the Provided zip folder
  2. Open file name: Robot_Palletizing_Color_Final.ino

  3. Click on : upload
  4. Open : Serial monitor

To set up CMUcam5 board:

  1. Open program : PixyMon
  2. click : File -> load pixy parameters
  3. select : Pixy_parameters.prm
  4. Press "the House" - Default parameters

Step 4: Getting Started With the Robot

When the arduino program file has been uploaded open the serial monitor. (before 6 seconds after upload, because of a delay made in the arduino program)

A guide will now show on the screen and tell the user what to do step by step.. See the image example file.

Getting started without serial monitor - Step by Step

1. wait for the LED on output "D3" to turn on - this means that the arduino board communication and setup is ready
2. Press the Relax button on input "D0" - this will relax all servos and enable the possibility to adjust the gripper at the potentiometer.
3. Now move the robot manually to the position where the pick up should be. the gripper should be adjusted to squeeze tight around the object.
4. Press the "Set pos" button when the robot is in place. This will open the gripper and save all positions for the servo.
5. When ready press the "RUN" button and make sure that the robot is always handed new items to move.
6. When there is placed 2 blue objects and 2 green the robot will stop. It is possible to run the program as many times as you like. Simply just press "RUN" again. - remember to remove the old objects from the drop off positions.

Automation Contest 2016

Participated in the
Automation Contest 2016

3D Printing Contest 2016

Participated in the
3D Printing Contest 2016