Home

Group Project

Week 11-12

Something a Bit Different

This week’s a bit different, because we are assigned a group project. The topic is a CNC machine controlled from a computer. Other than that, we were left with no other restrictions. We got assigned a name, Phoenix, and we are an 8-member team.

After brainstorming for a day, we have decided to build a marble machine. The concept is to take marbles of different colors and sort them one by one to create an image. We were inspired by this very same concept posted on YouTube by Engineezy. Every single member picked a part of the machine that they found the most interesting. Each person would build their part, and then all of them would be combined to create the final product.

My Design

I have decided to work on the color sorting section. The basic concept is that colored glass marbles will be fed into this section, then their color will be measured, and based on the result,t they will be sorted into the corresponding bins. I have divided the color sorter into four parts: Color Detection, Control Unit, Ejecting Mechanism, and Color Sorter.

Color Detection

The first step in detecting the color is the marble input. I have designed a universal connector, used in my design, at the start of the device. Other sections can be easily connected by mirroring the connector and bolting it together. The inlet pipe feeds the marbles in front of the color sensor. I placed a black cover so that outside light does not interfere with the measurement.

The sensor itself had to be modified. The 5mm LEDs were removed, and a small, 0603 SMD LED was blue-wired to the LED power supply. This enabled me to move the sensor much closer to the glass ball, while maintaining optimal illumination. The back of the sensor fed into a Raspberry Pi Pico, which processed the data.

Control Unit

This section manages data from and distributes power to all the other boards. The computer responsible for the logic is a Raspberry Pi Pico. Since the entire marble machine will be powered by a 12V 12.5A, I have included onboard regulators to generate voltage for the servo and ejection mechanisms.

control_unit
Control unit electrical wiring.
scheme
Control unit schematic diagram.

Unfortunately, I could not fully finish the color sensor mechanism. Mainly problems with the servomotor took an unexpected amount of time to solve.

Ejection Mechanism

The ejector is used to push the marble into the color sorting unit after its color has been successfully detected. It is powered by a 12V 1A solenoid, which can be powered directly from the power source. Additionally, a MOSFET was added to trigger the flow of current.

A slanted tube feeding the color detector and the ejector proved to be a very clever solution to the problem. The solenoid had enough strength to shoot the marble upwards, effectively eliminating all possibility of two marbles entering the sorter at the same time.



        #include 

        const int solenoidPin = 3;
        const int servoPin = 7;

        const int HOMING_POS = 140;

        const int POS_1 = 105;
        const int POS_2 = 120;
        const int POS_3 = 135;
        const int POS_4 = 150;
        const int POS_5 = 165;
        const int POS_6 = 180;


        Servo servo_sel;

        void setup() {
        pinMode(solenoidPin, OUTPUT);
        pinMode(LED_BUILTIN, OUTPUT);

        servo_sel.attach(servoPin);
        }

        void loop() {
        digitalWrite(solenoidPin, HIGH);


        servo_sel.write(POS_1);
        delay(2000);
        servo_sel.write(POS_2);
        delay(2000);
        servo_sel.write(POS_3);
        delay(2000);
        servo_sel.write(POS_4);
        delay(2000);
        servo_sel.write(POS_5);
        delay(2000);
        servo_sel.write(POS_6);
        delay(2000);
        }

        void blinkSolenoid(int count) {
        for (int i = 0; i < count; i++) {
            digitalWrite(solenoidPin, LOW);
            digitalWrite(LED_BUILTIN, HIGH);
            delay(50);
            digitalWrite(solenoidPin, HIGH);
            digitalWrite(LED_BUILTIN, LOW);
            delay(100);
        }
        }
    
Code for testing the color sorting mechanism.

Color Sorter

The final mechanism is used to direct the falling marble into a desired slot. It is powered by a servomotor, allowing for precise positioning. One unexpected problem I have run into was that 2/3 servos that I have tried rotated continuously. Even ones that were labeled with 180 degrees. I am unsure why this has happened; however, servos from another manufacturer seemed to work the charm!

The sorter worked by tilting a ramp, which moves along different channels. By stopping at one of the channels, the bead can be sorted. Furthermore, a fan-out mechanism was designed to guide the beads into storage hoppers.

I have laser-cut the entire front assembly to show the inner workings of the mechanism.

my_design
Whole color sorting mechanism design.