NXT Color sorter



  

The list of brick sorters is getting longer and longer. The first generation was built years ago, and this is the second NXT implementation, not counting the RCX/ NXT combination sorter. The reason for creating this one is a color sensor I built according to instructions in the Extreme NXT Book. Read more about the book here.

The sensor works by blinking three differently colored leds: red, blue and green. Reflected light of each of the three leds is measured, and the NXT calculates the color. The program is a modified version of the source code that comes with the book.
Below is a close up picture of the sensor.

There's only one new thing when it comes to the construction of the sorter. The grabbing arm is of course used to grab bricks, but it also has another function. While power is supplied to the motor, it will grab not only the brick, but also a few millimeters of the brick slide, causing the grabber to be aligned nicely, right above the brick. This trick might be an interesting feature in future sorters.

Below is a video of the sorter in action. You'll notice that the program is not very efficient, the device rotates only one way, while in some cases it would be smarter, faster, to go the other way round. However, this sorter was only meant to test the sensor so I did not implement that in the program.

With this sensor you can distinguish a lot of colors, but the more you want to detect, the more inaccurate it becomes. Right now it can still work quite well under different light conditions, but the more colors you want to sort, the harder this becomes.