Introduction: MeArm Color Chip Sorter

Picture of MeArm Color Chip Sorter

In this Instructables, we’ll build an automated color chip sorter using a meArm robot arm and a TCS3200 color sensor. This is part of my intermediate level curriculum for middle and high school students at my robotics workshop. MeArm is an excellent educational tool to teach students about mechatronics and inverse kinematics. Combining MeArm with a TCS3200 color sensor which is an economical solution for detecting color by utilizing red, green, and blue led lights to measure reflected RGB values, we could build an automated color chip sorter that teaches students about automation using a robot.

Step 1: Parts and Tools

  • MeArm laser cut acrylic kit. (Picture shows wood kit. Get acrylic kit as self tapping screws don't really work on wood as well as in acrylic.)
  • 4 servo motors (I used cheap TowerPro SG90 servos)
  • Nano
  • Mini breadboard
  • TCS3200 Color Sensor
  • 4 x AA battery pack for independent power supply to servos
  • A piece of 1x1 wood as a color sensor station
  • A piece of 1x4 wood as a base for MeArm and a breadboard
  • Color chips
  • Color chip dispenser (you can make it with cardboard)
  • Color chip bin (you can make it with cardboard)
  • Dopont cables
  • Wireties
  • Usual tools such as a wire cutter, soldering iron, and glue gun were used in this project.

Step 2: MeArm Assembly

Picture of MeArm Assembly

MeArm is an opensource robot arm designed by Phenoptix and you can either purchase a complete kit directly from https://www.mearm.com or buy individual components from various on-line sources. Since we’re building 10 units in the workshop, I went with latter. If you have a laser cutter, you could cut your own pieces as well.

Build instructions for MeArm v1.0 is already well-documented by Phenoptix on this Instructables so please refer to that documentation when putting together the robot arm. Additionally, I’ve made a larger base using a piece of 1x4 wood to mount both the MeArm and a mini breadboard for Nano.

Step 3: TCS3200 Color Sensor

Picture of TCS3200 Color Sensor

The technical specifications for TCS3200 color sensor is found at http://www.dfrobot.com/wiki/index.php/TCS3200_Color_Sensor_(SKU:SEN0101).

The sensor module I purchased didn’t come with a circular ring to isolate LED lights from the sensing element so I made a circular ring using a Nerf bullet and glued it to the sensor module. (See photo)

Step 4: Electronics

Picture of Electronics

Wire all the components according to the diagram. I’m using 4 x AA batteries as a separate power supply for servos. Nano is powered by USB.

Step 5: Code

Picture of Code

Anyone who tried to manually set servo values in MeArm may have experienced that:

  • servo motors/arm move too fast
  • difficult to visualize the correct angle values for target gripper locations

Well, both problems could be remedied by a library called meArm (https://github.com/yorkhackspace/meArm). The library only requires x,y, and z coordinates of a target position and it does all the hard work of calculating correct angle values for servos. (Perfect for students. They understand Cartesian coordinates.)

You must download and install this meArm library into your Arduino library folder first.

And then, download the attached Arduino IDE code. Comments in the code should explain what’s going on in the code. It was written for Nano but it should work on other Arduino boards with no or little mods.

Step 6: ​Calibration

In order for the code to detect red, yellow, and green chips correctly, we have to supply the correct range of RGB values seen by the color sensor for these chips. I ran the code in DEBUG mode to see what RGB values it sees for red, yellow, and green chips and manually hardcode the range into the code until the code detects correct color 100%. You must do this each time you run the code because the sensor is very sensitive to ambient light.

Step 7: Future Improvements

Calibration and hardcoding RGB values into the code is very arduous process. I think the better way to handle this is to allow the code to learn the color. One way to achieve this learning is by having a self-calibration routine in the setup section to go through several sets of red, yellow, and green chips in prescribed manner and let it figure out the lower and upper limits of the RGB values for red, yellow, and green color chips.

Comments

A.mohammedY (author)2017-04-25

Please sir can i use the arduino uno in this project

botdemy (author)A.mohammedY2017-04-27

yes

amirhosein640 made it! (author)2017-01-11

hi

thank you for share this project

i have a question

i bought a TCS3200 GY31 but you use TCS3200 YL64

how to conect TCS3200 GY31 to nano? thank you

botdemy (author)amirhosein6402017-01-11

Looks similar to YL64. It has S0-S3 for input and OUT for data. Not sure about the LED pin. Could be same as E0. You'll just have to test it out.

MuhammadD1 (author)2016-09-15

Just what I was looking for my ASRS Project, Was having problem co-ordinating color sensor and meArm. Will give it a go.

OMAR19995 (author)2016-07-25

This is a great project .... I wanted my project graduated from college and I want to do a similar project for your project do you help me please ?

mjrovai (author)2016-06-01

Great project. The idea and how you developed. Loved it.

botdemy (author)mjrovai2016-06-01

Thank you! I love your projects as well. Keep up the great work!

gm280 (author)2016-05-31

Very nice project. Would be interesting if the color sensor was also built into the arm so as it picks up any of the color disks, it senses the color and proceeds to place it in the correct bin. Just an idea. But really nice either way. Thumbs up!

botdemy (author)gm2802016-05-31

I thought about that but I am not sure if the mearm is strong enough to have a sensor mounted directly on the gripper. A modular gripper with a built-in sensor would be nice but I think that's beyond the scope of meArm. Maybe uArm could do that.

cobourgdave (author)2016-05-30

An excellent instructable. I am sure your students find it really a fun project with well defined objectives and with results that clearly relate to the current world. On my part, thank you for this instructable.

botdemy (author)cobourgdave2016-05-30

Thank you!

About This Instructable

5,757views

74favorites

License:

Bio: My goal is to captivate, inspire and engage young engineers through intriguing robotics projects. I use Arduino at my robotics workshops since it is the ... More »
More by botdemy:MicroPython IoT Rover Based on WEMOS D1 (ESP-8266EX)Pet Bot (no Coding)Billboard Bot
Add instructable to: