
Always wanted to sort your LEGO bricks automatically? Now you can build a robot to do it for you! BRICK SORT3R can sort LEGO bricks by color and size. This page provides building and programming instructions to build BRICK SORT3R with your EV3 set.
The sorting mechanism is obscured by the white decoration panels. Can you figure out how the robot is able to detect the color and size of a LEGO brick before you build it using the instructions below? Watch the video of the robot in action to get a better idea of what it does and how it works.




Congratulations, you’ve finished your brick sorting machine! Are you curious to discover more about the design of this robot? Get started by trying some of the Discovery challenges below.
You may be using differently sized sorter buckets than the custom built ones in the video. To ensure that your robot works properly, you’ll have to adjust the program accordingly. In the video, the robot must rotate the Medium Motor by 387 degrees to move the robot from one bucket to the next. You can measure the required amount of degrees with Port View (see Figure 6-4 on page 66) and turning the wheels manually. Once you’ve found the proper value for your setup, adjust your program with this value. To accomplish this, double click on the CalcPosition My Block to open it. You’ll find the 387 degrees value in the most right Math block. Increase or decrease this value as necessary.
The example program can only sort red, yellow, green and blue bricks, but the Color Sensor can also detect black, white, and brown bricks. Can you expand the program to allow the robot to sort bricks with these colors as well?
The example program only distinguishes two sizes of bricks (2×4 and 2×2). Can you expand the program to allow the robot to sort more sizes? To test the program, add 2×3 and 2×6 bricks to your selection of bricks.
The example program does not take any action if the robot runs out of bricks to sort. Can you expand the program to allow the robot to detect an empty chute? When the chute is empty, the robot should stop sorting and play an error sound.
The current design places bricks in different buckets by driving to the left and right. Can you design a turn table base with one Medium motor for the BRICK SORT3R? This lets the robot drop bricks in different buckets placed around it. This would be a more efficient design for a factory, because it takes up less space. Hint: Use the turntable you designed in Design Discovery #18.
