The story of a commissioned project that I tried to make, but failed. Here is the whole story of the development and why it was not a success.


Some month ago, a Canadian company named Marginally Clever who is specialized in selling and developing solutions using robotics and electronics. They asked me to build a machine for them which was a card sorter. The idea was to have the mechanical device in lego, and then the electrical elements using standard elements from market such as servo motor, motor, camera and so on. The aim of this machine was to sort by type card like Yu-Gi-Oh, Magic, Pokemon using raspberry camera. Each card was read by the camera, and then placed in the correct bins (10 in total + one for rejected card). The thickness of card may vary from 0.2 to 0.35mm, dimensions about 63 x 88, with 500 to 1000 card in dispenser and the average goal of speed was between 1-2s by card which was rather fast for lego.

After searching for idea, testing them and developing solutions, I had to recognize that, lego was not the correct solutions to do this, according to the project and the specs. This article explains why it had not work, and present the solutions I designed. This is not the first commissioned project, but the first since the Stage Trailer that I can talk about, so enjoy !


  • Card of different type (Yu-Gi-Oh, Magic, Pokemen)
  • Average size : 63 x 88 (may be waried for some mm)
  • Average thickness : 0.2 to 0.35
  • Card in dispenser : 500 to 1000 (total height about 30cm to 60cm)
  • Cycle time : 1 to 2s max
  • Number of type : 10 equal to 10 ouput bins
  • Mechanics : Lego
  • Electronic : market (Nema Step Motor, blue tiny 9G servo, Rasberry Camera, wire and software by the customer) – 3D printed parts for attaching the elements to lego
  • Estimation of hours of work 150h composed of 50h for searching ideas, primary building, proof of concept, validation and quotation + 100h for finely developing, building, ordering, final building, check specs, and shipping


The first idea was to develop a machine with the card dispenser, camera on the top, and a moving tray which grabs the card and put in the correct bins. You can see a illustration below (click to enlarge). Obviously this idea has one problem : cycle time. In deed event if the scanning of the card can be done during the displacement of the tray, there is only one tray, so each card has to be read, then moved, and then tray coming back in 2s which is way to fast. But it fixed the first idea in order that the machine will be composed of a card dispenser (giving one card by one card), the camera on top, and then a system to bring the card in correct bin.

Second idea was to use the same principle with the card dispenser and camera, and use a moving drum which can rotate to take each card in tray and pushes the card in front of the correct bin. Therefore the output bin has to be placed in round of the drum. I started to build this version but it was to difficult to obtain correct shape and adjustment of the 10 bins, plus that at final it was not easily upgreadable in term of number of bins.

Therefore, I kept the good idea of rotating drum but transformed it with a linear conveyor with many trays attached to the conveyor. After the card is scanned and placed in a tray, the second card comes to the second tray and etc; and when the first card is face of the correct bin, it is pushed out by a rotating beam on the tray. With that solution, the flow of card is in only way, each 1-2s a card is placed in a tray and other card in same time are push out in the correct bin. It had the huge advantage to by simple, with a number of bin extendable and with scanning and pushing out at the same time. The cycle time was only function of the scanning time and moving time for one tray.


So I started to build more precisely with lego. And started with the most difficult part from me : the card dispenser. In deed, it had to be very reliable, not depending of the size or thickness of the card, neither the number in card dispenser, do not damage them, and of course release card one by one, with easy operating motor (like make 360° of a step motor, or running motor for fixed time)

Prototypes for card dispenser

Note there are not picture for this section, you can see the different prototype in video section. Please read carefully the article and links attached to it, before post a comment / idea on this article.

The first prototype about card dispenser was composed of a box which contains the cards, and a slope with a small gap underneath in order that only one card can go through. Of course the set up of this small gap (arround 0.25mm) was very difficult because the card has thickness which may vary. That is why the first prototype had the slope to be articulated in order to block the card when the motor did not run, and let the card passes when the motor is running. Of course the motor also drives a rubber wheel placed underneath the card in order to move outside the box. But as the slope is articulated and get slightly lifted by the motor, the friction of the wheel on the card hugely depends of the amount of card in the dispenser. That is why it works for 30-100 cards but no more or no less.

The second prototype get rid of the articulated slope, in order to be fixed and not depending of the weight of card. The rubber wheel was also fixed and the gap was precisely calibrated to let pass one card by one card and have minimum friction to engage the card in the gap. It works better, but sometime two card pass instead of one (so need more adjustement) and the card was guided to go through the gap, but not enough to get out the box completely.

Therefore, the third prototype was the same as the second, but with a second moving step after the gap. The box was equipped after the gap with a double roller with friction and powered by the motor in order that when the card start to go through the gap, the continuously motion of the double roller takes the card and take out the box. In that way, the output of the card was controlled by a servo motor, and an other motor powered the rubber wheel and double rollers. The servomotor operates the slope underneath the card in order to make contact with the wheel and the rubber wheels when a card needs to be taken out.

The functioning of this prototype was good but not perfect. It used a moving slope in order to choose when the card is going out and a double continuously roller which help to get out the card but nevertheless was dependent of the weight of card. If works with 10-100 cards thanks to a Lego boat weight, but more cards means more weight and there is a time when the rubber wheel can not have enough friction to move a card below 500 cards.

That is why I develop the last prototype which was inspire by automatic card feeder instead of card dispenser. The industrial card dispenser has the same function, which is a main roller and moving platform to grab the card and expulse it, it works fine because the rubber wheel have many friction and the whole assembly is very rigid and precisely set up (see here how a card dispenser works)

An industrial card dispenser

A industrial card feeder

The functioning of a card feeder is different, the cards are placed on conveyor rubber belt and there is a funnel mainly composed of a curvy shaped parts. Sometimes there is a second double rubber belt conveyor to help the card to be grab. You can see the functioning in video here, and watch a patent below :

The idea was to transpose this to the lego world.

Please note also that the alternative grabbing or pushing card by the thickness is impossible here because the thickness is too small (0.2-0.35mm) like that :

Simple and efficient idea but not suitable for small thickness

There is also some other exotic card feeders like vortex machine but not suitable here for small thickness card, or simple off-center rotating rubber wheel machine but the cards has to be bend which was not acceptable for my client.

Therefore, I tried to reproduce the functioning of a card feeder with rubber belt conveyor underneath the cards, and a small gap with funnel. This functioning enables to have a maximum of friction and grab the card easily. But it was also dependent of the weight of the card, meaning that it works with 1-200 cards but more make the rubber belt to come off the pulley, which locks the machine and was very annoying to repair. This is because the rubber belts are composed of many rubber band and not only one and was not enough stable. So I came to the conclusion that to have a correct and reliable functioning, we have to use industrial rubber belt in one piece and therefore we choose to use a CTD dispenser from industrial supplier. Not to make it with lego.

The machine

Therefore, as I was not abble to make the card dispenser in lego, I was in charge to make the mechanical device, such as the chassis, card dispenser holder, main driving conveyor, tray with articulated bottom and bins. The different moving parts were operated by step nema motor with 3D-printed holder in order to adapt the lego to the motor. It was the same for the 9g tiny blue servo. The idea was to have a cheaper machine that with aluminium chassis and more adaptable to the needs.


The machine was composed of a frame which supports the components. First is the adjustable first slope to make the card slip in the tray. It has to be adjustable to set up the height and the tilt angle to be in front of the CTD dispenser and adapts the speed. Then, the Camera is placed on the top of this, using the fixation on the chassis, and has also a adjustable height and tilting angle. After reading the card, the card comes in a tray, which is fixed on a conveyor, and then moves on. On the final machine, there are many trays on the conveyor, and they are placed to equal distance to the bins distance in order to be in front of. The tray has an articulated bottom which is lift by a double lever system when the card is in front of correct bin. Therefore there are one servo motor by bins and would have been operated in same time. There are two motors for driving the conveyor (each on each axle).

You can see the functioning in picture below :

IMG_20180306_224812 IMG_20180306_224824 IMG_20180306_224831 IMG_20180306_224836

After validate the functioning on principle, I started to build virtually the machine on Ldcad to extend the principle to 10 bins. This part of the project was very important because, (you have to know), when I start a project and need a quotation to the client (how it will cost), I have to count my hours which is not very difficult, but I have to know how I will do the project in order to know the parts I will use. And for some project which is small or repetitive or project that I have already done before (like a car, a truck, something known), I can have a good estimation of cost of parts. But for some other commissioned project like this, I need to start designing the machine, make a basic 3D on ldcad to know which parts I will use, how many, and how it will cost. That is why sometime I can know how many it will cost (estimation not far from reality) and sometime I need to work more before to get the financial approval of the customer.

But at the end of this CAD model, there were a problem. I wanted to build a bigger machine that I have already built with 4 bins and test it because I found that the conveyor belt made with lego parts has some play and I wondered if there were a problem. And it was ! Indeed, the conveyor is this part, for arround 2 m long, therefore there were huge play at the end, some cm. The consequence was that when I turned the main sprocket to put the tray in front of the bins theoretically, there were not in front. And even if I also tightened the second sprocket, there were always difference between theoretical position and the existing one. The length of conveyor was simply to big and the parts has to much play. So the machine will need a industrial rubber belt conveyor. Combined with the fact that we need a industrial CTD car dispenser, plus nema motor, plus servo motor, I decided to cancel this project because the lego parts were not suitable for this project, regarding the performance and the specs. And oriented the customer through a industrial solution for the dispenser, and chassis but with reuse the principle of functioning we develop.


So, what to remember about this ? That working with lego on some project is exciting and always fresh and new, but sometime also that the lego was not suitable for machine with high specs and needs. Personally, it is not the first project which fails for company but it has always something to learn about it. Here is the play on lego parts, especially when you build it virtually with Ldcad, you can not verify the exact functioning, always based on mechanical principle. That is why it is important to know your project, know how you will do, and especially build a prototype as closed as the final machine to have a global view of the project.

Pictures and video

You can see picture during the developement of this project plus a video when I try to develop the CTD dispenser.

Related posts: