Automatic Lego Sorter - Stage 1

Following on from my first post asking for recommendations on Raspberry Pi sensors and HATs, I’ve finally commenced the early design/development for an Automatic Lego Sorter.

I’ve separated it into 4 stages:

  1. Source bin & feeder
  2. Physical separator (vibrating v-channel)
  3. Part Identification - Tensorflow on network
  4. Exit bin(s) - pivot chute mechanism

Each stage is monitored and controlled by a Raspberry Pi CM4/IO Board combination, however, the intent is that this could be operated by any Pi-compatible platform that uses the same 40-pin GPIO headers and can run Python. I’m using 3 of the Adafruit 2348 Stepper/DC Motor Controller, 2 fitted with stacking headers, to control a series of DC/Stepper/Vibration motors. A series of IR Break Beam sensors are planned for signalling when a part has crossed threshold points, with code activating/deactivating motors in each of the stages.

I’ve been given 3 NEMA17 stepper motors to drive 2 separate conveyor belts and a pivot chute.

Stage 1 - Source bin & Feeder.

Parts: 1x NEMA17 Stepper, 40mm PVC pipe, 3x 8mm x 22mm x 7mm precision bearings, 8mm threaded axle stock, 5mm coupler w perpendicular plate (for NEMA17 spindle), Custom designed/3D printed coupler (connect PVC pipe to form conveyor roller), M8 bolts/nuts, M3 bolts/nuts, grip material (the kind used to line kitchen drawers, to be used for making the conveyor belt), 6mm MDF.

After realising that my woodworking skills hadn’t improved in the 3 decades since high school, I sat down with LibreCAD and designed a series of panels to be lasercut out of 6mm MDF/Ply. Currently awaiting quotes on getting this done, but have also found an interesting online project from V1 Engineering, called the “Lowrider CNC” that I might just end up investing some time and $$ into.

I also needed to find a way to use off-the-shelf PVC pipe as a roller for the conveyor belt, as every option for purchasing a conveyor belt system was a combination of too large and too expensive. I came up with a design for a coupler that connects 40mm pvc pipe, bearing and drive coupler, with an option of a straight through passive axle and a drive/passive combination. I managed to find a local 3D printing studio that refined the design further and has produced the quantity required for this stage. An earlier attempt sent to PCBWay resulted in mixed success, but could easily be used in future once the design is finalised.

The prototype design at this stage mounts all components to the laser cut panels, with some recessing for bolts/nuts and options for thrust bearings if needed. I’ve been able to obtain some v-split rails (2020 and 2040) from some broken 3D printers to test a few different ideas. I had thought of using this for the final project, but the costs may be too restrictive.

The other side of this stage is the electronics, specifically soldering motor HATs, connecting up the Pi, powering everything, and finding the right operating system. I plan on using a common power supply (a 65W 12V off the shelf from Jaycar with a 5A max) with an inline switch followed by a 4 way splitter to connect to the Pi’s IO Board and each of the 3 HATs.

Tasks that remain for this stage:

  1. Software - importing the necessary Adafruit python libraries
  2. Wiring for motor HAT to motor
  3. Testing motor control
  4. Integrating IR break beam sensor & testing
  5. Code for activation - sensor - deactivation logic
  6. Revisions for mechanics/structure - in this area, I’m likely going to have to revise the belt system to allow for adjustment and tensioning.
2 Likes

Hi Troy,

Great to see you’re still working on your Lego sorter. Do you have some photos of how the PVC pipe conveyor roller conversion worked? It sounds cool but I’m having trouble visualising it.

No photos yet, I’m afraid. Essentially, it’s a coupler that has a centre hole for an axle, with a precision bearing mount, recessed slot to slide the pipe into, and on the outside, holes to attach a drive coupler to the NEMA spindle.

I’m learning how to use Solid Edge and Fusion360 to try and create some renders. Attempts at using/learning FreeCAD were frustrating, but I could also use Blender to dummy up something to better illustrate the concept.

I’ve had a spark of inspiration to reduce the footprint of the final build to make better use of internal volume. As soon as I have some schematics and renders, I’ll post them up.

1 Like

Here’s a quick & dirty render of the coupler and the general setup of the first stage.

The coupler is designed to slide onto the end of a piece of PVC pipe, with a variety of connection/carriage options. In the centre is a hole for an M8 bolt or threaded axle +/- a bearing in the recessed space, with the frame recessed slightly for a thrust bearing. Alternatively, an M8 bolt and washer can be fed from the inside and attached to a bearing that is then mounted in the frame, with a similar option for a threaded axle for extra stability and rigidity. This option can also be matched with an external alloy coupler to attach to the spindle of the motor used to drive the conveyor.

For belt tensioning and balancing/alignment, a third rail mounted in a slot can be adjusted, although I’m thinking it may be a better option to have the passive end of the conveyor as a through-axle with internal bearing in a lengthwise slot for the same function.

The plan at this stage is to adapt the exit of the stage 1 conveyor and mount the separator channel on that face, with the image capture and conveyor mounted in the space behind the grey panel.

At present, dimensions are 35cm x 30cm x 60cm, but there will be an additional 15cm added on each the front and rear sides, with a further 70cm x 45cm x 45cm mechanism on the exit of the stage 3 conveyor (final sorting bins).


1 Like

Hi Troy,

For a quick and dirty render that looks pretty good!
Thanks for posting the render, that illustrates the rollers beautifully.