If you have been following my posts, you would know I am an Electrical Engineering student at BCIT. In my last post, I talked about my course ELEX 4618 (Object Oriented Program Design), and some of the weekly labs I worked on. One of those labs (#8) required us to make a colored ball sorter. It had to be programmed in C++ to run on a Raspberry Pi that uses PiCam and OpenCV to detect colors and the pigpio library to enable us to use the Pi GPIO pins to interact with other hardware. In Lab #9, we added functionality so this device can be controlled and sends a video stream over the network.
For design inspiration for this project, I came across this Skittles sorter built using an Arduino and a color sensor. Luckily, the creator uploaded his STL files to printables.com, which I was able to modify for my 15 mm diameter balls. The original model only has a half-rotating disc as the creator used a servo motor that only sweeps 180°, I used the same servo model (MG995) but I converted the servo to a continuous rotation servo, allowing me to spin it full 360° and making the sorting process much faster. For the second servo, I used an unmodified SG90 servo motor. I have uploaded my remixed files here, feel free to modify or print this model.