DIY Beads Sorter

An Open-Source Automatic Perler Bead Sorting Machine for Makers

Anyone who has built pictures from fuse beads knows the problem.

A box may contain thousands of beads in ten different colors, but when you want a specific color, most of the time is spent searching through the pile rather than creating something. I discovered this while building bead mosaics with my granddaughter. The creative part was fun. Looking for the right bead was not.

Like many maker projects, this one started with a simple thought:

"There must be a better way."

So I decided to build a machine that could automatically sort beads by color.

The result is a low-cost DIY bead sorter designed specifically for makers, hobbyists, schools, and families. The goal was not to create a commercial machine, but a project that anybody can build using affordable and easily available components.

Links:

Design Goals

From the beginning, I established a few important rules:

  • Use inexpensive and commonly available components.
  • Avoid rare parts taken from old printers or discarded electronics.
  • Keep the design simple enough for hobbyists to build.
  • Make all mechanical parts suitable for 3D printing.
  • Support at least 10 different bead colors.

The color count was chosen intentionally. The IKEA fuse bead sets that inspired this project contain either 8 or 10 colors, so the sorter needed to handle both.

 

How the Bead Sorter Works

The entire machine consists of four major subsystems:

  1. Feed Mechanism
  2. Color Detection Module
  3. Control Electronics
  4. Sorting and Collection System

The process is simple:

A bead enters the machine, its color is measured, the controller identifies which color it belongs to, and the bead is routed into the correct collection bin.

Although the idea sounds straightforward, making it reliable turned out to be an interesting engineering challenge.

 

Feeding Beads One at a Time

The first task is to separate individual beads from a bulk container.

Many bead sorting projects use bucket elevators, vibrating feeders, or funnel systems. I experimented with several approaches before choosing a rotating disk mechanism.

The feed section consists of a sloped hopper and a rotating disk containing circular holes.

The hole diameter is carefully selected:

  • Large enough for a single bead to enter easily.
  • Small enough to prevent two beads from occupying the same hole.

As the disk rotates, one bead is carried to the measuring chamber. At the correct position, gravity does the rest and the bead drops into the sensor area.

This mechanism proved to be far more reliable than some of the earlier prototypes, especially considering that fuse beads are not manufactured with perfect dimensional accuracy.

 

Color Detection Using the AS7341 Sensor

At the heart of the sorter is the AS7341 spectral color sensor.

Unlike simple RGB sensors, the AS7341 measures multiple wavelength bands across the visible spectrum, allowing much more reliable color identification.

The sensor provides:

  • 8 visible spectrum channels
  • 1 near-infrared channel
  • 1 broadband ("clear") channel

This gives ten useful measurements for every bead.

The measuring chamber includes controlled LED illumination, ensuring that ambient room lighting has minimal influence on the results.

Why Not Use a Simple Light Sensor?

Imagine measuring only the total brightness of reflected light.

You could easily distinguish:

  • White
  • Orange
  • Blue
  • Brown
  • Black

But many colors would overlap, especially under different lighting conditions.

Human eye solves this problem using three different types of cone cells sensitive to red, green, and blue wavelengths. The AS7341 works on a similar principle but with even more spectral information.

The result is substantially better color discrimination.

A Clever Use of Infrared Light

Interesting part of the project is how the machine detects the presence of a bead inside the measuring chamber.

The first prototype used a dedicated infrared beam sensor built from separate LEDs, photodiodes, transistors, resistors, and wiring.

It worked well, but it added complexity.

Then I realized that the AS7341 already contains a near-infrared channel.

By adding a small infrared LED aimed directly at the sensor through a tiny hole, the machine can detect when a bead enters the chamber because the bead blocks the infrared beam.

This eliminated several external components and simplified the design.

Once the bead is detected:

  1. The infrared LED is switched off.
  2. The feed mechanism closes.
  3. The white measurement LED turns on.
  4. The sensor captures multiple samples.
  5. The bead is classified.
  6. The bead is released into the sorting section.

 

Why ESP32?

Many microcontrollers could theoretically run the sorter:

  • 8051 derivatives
  • Arduino boards
  • Raspberry Pi
  • ESP32 modules

The final choice was ESP32 because it offers a very attractive balance between price and capability.

Benefits include:

  • Sufficient processing power
  • I²C support for the color sensor
  • Integrated flash storage
  • Low cost
  • Wi-Fi and Bluetooth capability (not leveraged yet)

The current design uses a simple four-digit seven-segment display and a single button for user interaction, but future versions could easily add web or mobile control.

 

Sorting Through a Binary Tree

Once the machine knows the bead color, it must direct the bead into the correct bin.

Several approaches were considered:

  • Rotating carousels
  • Moving trays
  • Conveyor systems with diverters

The final design uses a binary sorting tree.

Each level contains a pair of linked flaps controlled by a single servo.

At every stage, the bead is sent either left or right.

With four levels of branching, the system can generate sixteen outputs:

2⁴ = 16

This comfortably covers the ten required color channels.

The approach offers several advantages:

  • High sorting speed
  • Low moving mass
  • Simple mechanics
  • Inexpensive actuators

 

Why Servos?

The sorter uses standard 9 g hobby servos.

These servos are:

  • Cheap
  • Widely available
  • Easy to control
  • Common in maker projects

An important software feature is automatic servo power management. Once a servo reaches its final position, power is removed after a short delay to avoid unnecessary stress, heating, and energy consumption.

 

Teaching the Machine Colors

A major challenge was color classification.

First Attempt: Centroids

The initial algorithm stored multiple samples for each color and calculated a centroid, essentially an average point in multidimensional space.

During sorting, the measured bead was compared with the centroid of each color.

While fast, this method produced too many errors.

The Real Problem

The issue was not the sensor.

It was the bead.

A fuse bead is a small cylinder. Depending on its orientation, the sensor may see:

  • A glossy reflection
  • The side wall
  • The central hole

The same bead color can therefore produce noticeably different measurements.

Final Solution

The current firmware stores multiple training samples for every color.

During classification:

  1. The measured bead is compared against every stored sample.
  2. The ten nearest matches are selected.
  3. If at least seven belong to the same color, that color wins.
  4. Otherwise the bead is marked as uncertain and sent to a reject bin.

This approach proved significantly more reliable in real-world testing.

 

Open Source Maker Project

This bead sorter was designed primarily as a maker project.

It combines:

  • 3D printing
  • Electronics
  • Embedded programming
  • Sensors
  • Servo control
  • Data classification

All while solving a real problem in a practical and interesting way.

The project is fully intended for DIY construction using commonly available components and standard fabrication methods.

In the following articles, I will cover:

  • Mechanical assembly
  • 3D printed parts
  • Electronics and PCB design
  • ESP32 firmware
  • Sorting performance and testing

If you have ever wanted to build a machine that can literally see colors and make decisions based on them, this project might be the perfect weekend challenge.

Discussion (0)

Be the first who will post an article to this item!

Only registered users can submit posts. Please log in or sign up.

Do not fill out this field