The marble color sorter using a Raspberry Pi controller
The color sorter could sort up to 10 balls accurately into their 4 respective colors.
The Raspberry Pi controlled 2 different servo motors to release the balls, and a stepper motor to move the ramp to the correct location.
The separate components were made together using laser-cut wood boxes, with the base being constructed of scrap wood pieces.
Second iteration of the color sorter box. Future iterations were held together with wood glue and friction fit
Prototype of placements of boxes for marbles to roll down.
The goal of this project was to build a color sorter that can sort balls into 4 separate colors. Inspiration for the ramp color sorter was drawn from magnetic marble toys. The ramp was set to a 5-degree angle to overcome the friction from the wood without causing the marbles to slip off the track. A servo was placed in the middle of the track to allow the color sensor time to scan each ball. Three variations of the box were created, with one to house a servo to only allow one ball to travel to the color sensor at a time, one to give the overall ramp additional space to line up the balls, and one to house a funnel to place the starting balls in. The boxes were originally designed to be modular, so more can easily be created to expand on the color sensor.
The main boxes were designed and built before the base, so the base had to be constructed considering the placement of each box in relation to each other
Timing the first servo proved to be difficult, as the balls would either travel to the sorter two at a time, which impacted calibration, or not have the speed to get past the servo.
The stepper motor did not have enough torque to move the slide to the right angle, so a new slide had to be constructed to minimize the weight on the motor.
Due to the boxes not being fully locked into their locations in the base, motion from the servo motors would move the boxes, causing the ramp to become misaligned.
Circuit Diagram of the Raspberry Pi and Motors
To improve, the servo motors could have been better placed inside the boxes. Initially, the servo motors were placed on the outside of the tracks to give them better access to stop the balls. However, that idea was changed, as there wasn't an easy way to attach the servo without tape or glue. One improvement would be to place the servo closer to the ramp to allow the arm to stop the balls more easily.
Another improvement would be to build a stronger base for the boxes and have each box glued to the base. The boxes were not tied down to the frame, thus allowing for easier access to the boxes if one failed. However fixing the boxes to the base would have prevented several of the challenges, thus allowing for more time with calibration and fixing the servos.
Video of color sorting the balls
CAD Model of the color sorter