Close

Singulator working!

A project log for Colour sorting machine for Lego

Automatically sort random Lego pieces by colour!

robgRobG 03/14/2026 at 13:160 Comments

After a bit of a wait (I've been busy on other projects) I've finally been able to get back to the V2 feeder or singulator.

First I knocked up some quick code to allow me to tune the frequency and pulse width of the PWM driving the solenoid (model JF-0530B 12V electromagnet driven by half of a DRV8871 H-bridge motor driver). That helped me then tune the solenoid and its plunger - in the end making a new plunger from scratch, using a nylon rod to save weight and permit a bit of lateral movement/flexibility so that it doesn't bind so much. This means the feeder is able to vibrate freely, at resonance, for maximum efficiency.

New plunger on the left, original on the right.

Finally I added a light sensor/beam break arrangement to detect falling pieces and stop the PWM temporarily.

A video of its first test is below: 

The light sensor is a repurposed HW-201 proximity module, fitted into a custom 3d printed housing which directs the IR beam onto a mirror and back.

Frickin' (not) laser beams.

This effectively creates two side-by-side beams, doubling the chance of detecting a Lego piece as it falls off the end of the channel.

Discussions