Sorting machine AGH

Machatronic device for sorting colored balls

Similar projects worth following
AGH University of Science and Technology
Mechatronics Engineering

The main goal of the project was to create a mechatronic device for sorting colored balls. The basic assumption was to design and create a fully functioning structure mainly made of Lego bricks. Having physical elements and Lego blocks, our team decided to build a physical model instead of a design the whole system in a CAD program.

Adrian Gębalski
Andrzej Dzierżak
Bartłomiej Bonar
Dominik Draguła
Gaweł Bartosik
Jan Brzyk
Karol Bereźnicki
Maciej Gaudyn
Michał Bełzak
Aleksandra Bechta
Paweł Barcik
Piotr Fryzeł
Radosław Ciupiński
Robert Taube

Sorting proces

At the beginning, balls are located in container before color detecting module, which crucial elements are servomotor, yoke mechanism and RGB color sensor. Connecting yoke mechanism with servomotor allowed not only to prevent balls from moving forward before detecting it’s color but also allowed movement of one ball at a time after taking measurement. Afterwards, ball gets to rotating chute which distributes each ball depending on it’s color. The chute is connected to another servomotor, which depending on ball’s color rotates towards proper container where ball falls into. Following basic sorting mode, described process is repeated continously until there are no more balls  waiting for being detected and distributed. After full sorting sequence, all balls can be piled up together due to moving floor (large, flat lego part) connected with 2 servomotors. Subsequently, balls move to module resposible for transporting them up. Well worked out construction of engine, rolls and strings proved itself by tipping the container with balls at highest point (detected by engine’s limit switch) and allowing balls to get to the initial place where they wait for their’s color to be detected and distributed depending on chosen sorting mode.

Electronics used:


-Raspberry PI

-Color sensor


Bitbucket link:

-codes for arduino/ RPI/ mobile app:


-LEGO Mindstorms and Lego Technic parts

CAD models (Fusion360):

Some parts were made in fusion360:

-Ramp with servomotor that seoarates balls to different containers:

-gear motor crane:

Pinterest account:

-All photos of sorting machine:


-Videos of working model:

Project Management

At the beginning, decisions have been made who is going to work on specific fields concerning lego project. Therefore, 5 main subteams came into operation:

-  Project Management

- Mechanical Team

- Software and electronics

- Documentation

- Report

Shortly afterward, waterfall schedule was instituted. It assumed the execution of our assumptions and targets at designated intervals.

Waterfall schedule of our work and goals:

Means of communication:

Microsoft Teams – regular videoconferences of our whole team, discussing weakly progress of every subteam, discussing completed, present and future tasks, expressing opinions about potential solutions, enhancements.

Facebook conversation -  plentiful discussions, assigning tasks, conducting surveys, sharing ideas.

Trello – virtual kanban board, transparent view of every task assigned to person responsible for it, clear picture of what have already been done, what is in progress, what need enhancements, what will be done in the future and what is optional.

Adobe Portable Document Format - 1.88 MB - 12/14/2020 at 09:24


Adobe Portable Document Format - 305.58 kB - 12/14/2020 at 09:24


  • Videos

    Dominik122612/14/2020 at 09:57 0 comments

    Working prototype

  • Working model- overview

    Dominik122612/14/2020 at 08:56 0 comments

    Pictures of complete working buid:



    Mobile app working :

  • Mobile application development

    Dominik122612/13/2020 at 16:34 0 comments

    Current mobile application view:Brak opisu.

  • Electronics- operating modes

    Dominik122612/12/2020 at 21:28 0 comments


    -View of the console when operating from computer

    Automatic sorting mode:

    -Process of sorting. Pictures shows whole process of automatic sorting with all notifications on screen:

    Manual sorting mode:

    -Process of sorting. Pictures shows whole process of manual sorting with all notifications on screen:

    "pick some" sorting mode:

    -Process of sorting. Pictures shows whole process of "pick some" sorting with all notifications on screen:

  • Update after 3rd week of work

    Dominik122612/09/2020 at 17:55 0 comments

    During week 3 our team managed to make:

    -New endstops in crane

    -New servomotors that help keep the moving floor of balls container shut

    -New module that feeds only one ball at the time

    -Almost entire mechanic build is done

    -Mobile app and the whole electronic setup is almost ready

  • Update after 2nd week of work

    Dominik122612/09/2020 at 17:47 0 comments

    During week 2 our team managed to make:

    -Mobile aplication is in alfa test

    -First codes for Raspberry PI and Arduino are ready

    -Communication between Arduino and Raspberry is established

    -Operating modes are prototyped

    -All parts are connected to the plywood to help moving the whole construction

    -We succesfully made first crane prototypes to move balls up for re-sorting.

    -Color sensor is being tested

    -Colored balls feed mechanism is being prototyped

    - Ball containers were rebuilt and we switched from DC Lego mindstorms motors to servomotors

  • Update after 1st week of work

    Dominik122612/09/2020 at 17:35 1 comment

    During week 1 our team managed to make:

    -Concept of the mechanics of the whole machine

    -Concept of the all electronic components we will be using

    -Concept of machine operate modes

    -BOM list 

    -First elements of the bal container with sorting mechanism and moving floor

View all 7 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates