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.
cool project, and I love the extra discoveries
Just built the Brick Sorter, it’s quite brilliant! I use my EV3 kit with my two grandsons and they love it though they are slightly too young to program it yet. I have had my EV3 Home kit and Expansion Pack for a couple of weeks only so I am also quite new to it all. Your own Discovery Book is excellent and should be on everyone’s shelf. I have both the printed and Kindle versions of the book. I fully intend to crack your extra “discoveries” for the Brick Sorter but are the answers hidden anywhere on your website should I fail?
The first design I built from the book was the Robot on the front cover, this went down very well with my grandsons especially as I had added some speech sounds using the Sound Editor to enable the Robot to call them by their names. The latter impressed all who heard it! Keep up the good work Lauren’s and thank you for all your efforts.
Hi John,
Thanks a lot for your response. I’m glad to hear you and your grandsons are having fun with the projects from the book.
I didn’t prepare the solutions to these final Discoveries yet, but I may do so at a later time. (Feel free to use thise space to ask here for tips when you’re ready to tackle them though!)
If you’re interested, it would be great if you shared your experiences with the book in a review on Amazon. I’ve found that reviews help other MINDSTORMS builders decide which books to get, since there are quite a few MINDSTORMS books out there.
Thanks,
Laurens
Hi. I finished building it, but i dont know where to dowload the code.
Hi Laurens.
I have bought your book for my ev3 education version.
I’m very interesting on your brick sort program.
Is that available for education version for building? I find some pieces is not in education set.
Thanks for your reply
Robin
Hi Robin,
You will need some additional pieces to build it with the Education edition, or you’ll need to modify the design to account for pieces you do not have.
To see which pieces you’ll need, compare the parts list in the Brick Sorter page above, and this parts list of the Education set (LINK).
|Coooooooooooooooool
Great robot!
Is there a way to get the details of the mybricks modules which are used in the program?
Re: Discovery #134: More Colors
I got more colors of Lego Bricks so can I scan more bricks?
Re: Discovery #134: More Colors
Hi Laurens.
I got more colors of Lego Bricks so can I scan more bricks?
Thank you for responses and reply.
Casey Liew
Hello!
Can’t open files via Mac. Any ideas? many thanks!
Very useful robot….Good job!
But I think it would be more efficent if the robot sorts bricks around hin. That will cost less time. I have build it on a fixed position and changed some parts in the program Now he is sorting bricks in a circle around him.
how did you do that
Cool project only I don’t like the reset part.
I cannot open the program since it is in a ZIP file. May you please give instructions for this project?
Never mind, I got it. Instead, can you please give the answers to discovery #134? Thanks 🙂
I use this to teach my “student” about color in mother tongue… Very good project!
not working false colours please improve the program
Hi, I love your idea, but the bricks really get out of place without the container you have in your video! Can you add instructions for your piece holder as shown in your video! It will really help! Thanks, Noah.
Maybe you can use small cups, like disposable paper or plastic cups that you can cut to the right height?
Do you need to reset every 5 blocks.
You can increase it to reset only every 10 blocks, or even 20. You need to reset occasionally because when the wheels slip slightly, it has no way of knowing where to put each brick.
How will you change the program so it only determines the color and not size?
There are various ways to do this, and I encourage you to explore EV3 programming throughout the book and try again afterwards 🙂
I don’t have the right bins. can you add instructions for doing it with paper cups please?
The instructions will remain the same. Without the bins, it will just drop them at a different spot on the floor.
You can just put the cups underneath.
Could you please give a hint for Discovery #136.
My first though:
Asking for the color black (the ground of the chute is visibly and therefore no brick is in the chute) does not work. Because than I can’t sort black bricks anymore and the color sensor interpreted this kind of black as blue sometimes.
My second thought:
Does it have to do with the rotation of motor C? When it is over e.g. 2500 than it is not an extra big brick but empty? But it doesn’t seem to work either.
Any hints?
Am I on the right way or totaly wrong?
Thanks for an answer in advanced.
Ulrike
I have a problem. When the robot has scanned the brick and starts to move towards the right position, it doesn’t stop to eject the brick. It just continues to move in the same direction, and i need to stop the program to stop the robot. I have no idea, what i’m doing wrong, but i hope someone can help me..?
Frederik
Dear Laurens,
We love your book. We use it every evening. We have one question. Our brick sorter doesn’t work. It only finds small blue bricks. Do you know how to fix that?
From
Ciaron age 9 and Christopher age 7
Hi Laurens,
has this been tested with the latest brick firmware (1.09)? We have built this, downloaded the programming and uploaded it to the robot, but the robot only stops, utters “green”, opens to release a brick but does not really transport a brick further down the chute.
We are investigating if we built something wrong but wanted to rule out any programming issues first.
Dominik
This can occur when the motors are not plugged in as described. Could you check that?
Same here. The robot does everything except moving bricks down the chute.
@Ciaron and Christopher: The robot sees the light from the color sensor and recognizes it directly as a color (blue and green also sometimes). Since it is programmed to turn on the motor which moves the lego pieces downwards only until it recognizes a colour, this step will actually never happen (since it already recognizes a color even without any lego brick). Remove blue and green from the possible colors (white works fine instead) and give it a try again.
Then it says “yellow” but there is no yellow
It keeps detecting bricks that aren’t there. What’s wrong?
Then it says “yellow” but there is no yellow
Then it says “yellow” but there is no yellow
Then it says “yellow” but there is no yellow
Then it says “yellow” but there is no yellow
How do I build Ev3storm
I don’t know
Shutting off my side and I am not going back home tomorrow morning and then we can get back home from the office and get some rest before the day I can get to you and then we will be back in a bit and I can get some rest and I can do some dinner tonight I haven’t talk yet I will call him later if I need anything else let you go get some lunch or tomorrow morning let you go and get it and I can
Shutting off my side and I am not going back home tomorrow morningchcixgkxgmzgmznfxngxxmghchvlhvkg oh him and then we can get back home from the office and get some rest before the day I can get to you and then we will be back in a bit and I can get some rest and I can do some dinner tonight I haven’t talk yet I will call him later if I need anything else let you go get some lunch or tomorrow morning let you go and get it and I can
,
My boss hates EV3
Can you program this robot with the programmer app?
How do I modify it to sort 1×1, 1×2, 1×3, 1×4, 1×6, 1×8 and all those other wonderful sizes(2×2, 2×3, 2×4, 2×6, 2×8, 2×10) in ONE(yes, one) brick sorter
How do I modify it to sort 1×1, 1×2, 1×3, 1×4, 1×6, 1×8 and all those other wonderful sizes(2×2, 2×3, 2×4, 2×6, 2×8, 2×10) in ONE(yes, one) brick sorter thank you very much and please reply HERE AND EMAIL
Last sentence: …and please reply here(must) and email if you can
Hello to ev3 world* That is for you to figure out. Laurens is giving you a challenge, not all of the answers.
You probably can’t sort the 1×2, 1×4, etc. with this design, but the others you might. Maybe adding a module using the touch sensor to determine the length…
I have just made the brick sorter, and downloaded the program, but it keeps getting both the size and colour of bricks wrong 🙁 Sometimes it does not move bricks forward enough, and then it seems to ‘guess’ a colour. It is only getting about half of the bricks right. Any ideas what I may have done wrong, please?
My robot drives back and forth saying green! It is seeming to have trouble with the feeding mechanism for the bricks.