Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

An Arduino candy sorter works by feeding one M&M or Skittle into a repeatable sensing position, identifying its color from sensor readings, and moving a gate, platform, or chute to send it to the right bin. The main design choice is how to illuminate and sense the candy; the feeder and routing mechanism must then be built around that choice.

How an Arduino candy sorter works

A practical sorter has three linked jobs:

  1. Feed: Separate a candy from the supply and present it by itself.
  2. Sense and classify: Illuminate the candy consistently, measure its color response, and map the measurement to a color category.
  3. Route: Move a platform, gate, or chute so the candy falls into the selected bin.

Repeatable positioning matters: readings become harder to compare if candies enter at different distances or orientations, or if more than one piece reaches the sensing area at once.

Documented design options

These published builds demonstrate different architectures, not interchangeable versions of one parts list. Choose a sensor and controller together with the sketch, wiring, feeder, and routing mechanism that support them.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Example Color sensing Controller and motion Feeding and fabrication
Arduino Skittles sorter (2016) TCS3200 color sensor Nano and two hobby servos A plastic tube drops candy onto a servo-mounted platform; the piece moves to the sensor and then falls along a guide rail into a bin. Arduino’s project description.
Arduino M&M sorter (2021) White and RGB LEDs illuminate a candy in a small dark chamber; a photoresistor measures reflected-light intensity Uno and a small servo A hopper and dispenser are 3D-printable. Arduino’s project description.
Skittle Color Sorter repository Color sensor; the calibration instructions concern the project’s readings and setup Controller and motion details are not stated in the cited calibration instructions Provides a calibration workflow for an individual candy-sensing hole. Project repository.
Candy sorting machine repository TCS34725 color sensor; RGB LEDs are controlled by one Arduino Two Arduino devices, two stepper motors for the feed wheel and carousel, and a modified micro servo for mixing Includes SLS-printed nylon parts and printable models. Project repository.

The examples show that both M&Ms and Skittles have been sorted in Arduino projects, but they do not establish that one machine’s calibration values transfer to the other candy. Candy type, sensor, lighting, geometry, and code all affect the result.

#1 Best Overall
ELEGOO UNO R3 Project Most Complete Starter Kit, Compatible with Arduino
  • 30+ Guided Electronics Projects: Start with LEDs and build toward LCD1602 displays, RFID access, motion detection, distance sensing, motor control and environmental monitoring for STEM learning, coding clubs, classrooms and hobby projects
  • 200+ Components Across 63 Types: Includes an ELEGOO UNO R3 controller, LCD1602, RC522 RFID, RTC, HC-SR501 PIR sensor, ultrasonic sensor, DHT11, GY-521, MAX7219, keypad, joystick, relay, SG90 servo, stepper motor, breadboard and more
  • Begin Without Soldering: Pre-soldered modules, a solderless breadboard, organized storage case and small-parts box reduce setup time and help beginners move from lesson to lesson while keeping LEDs, ICs, wires and sensors easy to find
  • Learn, Modify and Create: Program the ELEGOO UNO R3 board with Arduino IDE using the included PDF tutorial and example code, then adjust sensor thresholds, timing, display text and motor behavior to turn guided lessons into original projects
  • Flexible Power and Project Setup: Includes a 9 V, 1 A power supply, breadboard power module, 9 V battery and USB cable to support controller, breadboard and module experiments without sourcing basic setup accessories separately

Choosing a sensor and controller

TCS3200 or TCS34725

The Arduino Skittles example uses a TCS3200; the separate candy-sorting repository uses a TCS34725. There is no cited head-to-head benchmark establishing a best sensor. Favor the module that matches the wiring and code you intend to use, and verify its breakout-board electrical compatibility before connecting it to an Uno or Nano.

LEDs and a photoresistor

The M&M example uses controlled white and RGB illumination with a photoresistor rather than a dedicated color sensor. It infers color by comparing reflected-light intensity under different LED colors. Arduino’s description says the build identifies a red candy when the red-light measurement is highest, then uses a servo to dispense it. This approach depends on keeping the chamber and lighting consistent.

Rank #2
ELEGOO UNO R3 Project Super Starter Kit with PDF Tutorial for Beginners
  • TURN CODE INTO REAL-WORLD RESULTS — Follow 22+ guided lessons to make LEDs blink, read temperature and distance, move servo and stepper motors, control an LCD and respond to joystick or IR input; ideal for a family weekend build, homeschool unit, coding club or STEM classroom
  • MORE PROJECT VARIETY IN ONE ORGANIZED KIT — Includes the UNO R3 controller, LCD1602 with pre-soldered header, breadboard power module, ultrasonic and DHT11 sensors, joystick, IR receiver and remote, SG90 servo, stepper motor, relay, DC motor, fan blade, displays, LEDs, buttons, resistors and jumper wires
  • START WITHOUT SOLDERING — Plug-in modules, a solderless breadboard and the pre-soldered LCD help beginners focus on wiring, code and testing; the illustrated component list makes it easier to find each part and move from one lesson to the next
  • LEARN THE LOGIC, THEN CREATE YOUR OWN — Use Arduino IDE and the included example code to understand digital input and output, analog sensing, timing, motor control and display functions, then change thresholds, speeds and sequences for alarms, environmental monitors, reaction games and motion projects
  • CLEAR SETUP SUPPORT FOR FIRST-TIME BUILDERS — Download the latest tutorial and code, select the UNO board and correct computer port, check component polarity and breadboard rows, and keep power-module input at 9V or below; younger learners should work with an experienced adult

Match the board and mechanics to the build

The cited examples pair a Nano with the TCS3200 and two servos, while the M&M build uses an Uno with LEDs, a photoresistor, and a servo. Another repository uses two Arduino devices with stepper-driven feeding and a carousel. Do not assume their sketches or circuits can be combined unchanged. Select the board for the chosen program and peripherals, then design the feeder and bins around the motion system you can fabricate and control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Calibrate for your setup

Calibration is part of making the sorter work, not a final polish. The Skittle Color Sorter repository identifies lighting and sensor-to-candy distance as factors, and calls for calibrating each candy color for the particular setup. Its workflow records the empty sensing hole first, then calibrates each color separately. It recommends trying at least 10 different Skittles for a color and replacing example values with readings from the builder’s own setup. That is the repository’s procedure, not a measured accuracy guarantee.

Rank #3
Vilros Arduino Uno Starter Kit - Includes Arduino Uno R3 Board, 190+ Electronics Components, Breadboard, Jumper Wires, DC Motor, Servo, Relay, Full-Color 72 Page Manual [190+ Pieces]
  • Complete Arduino Uno R3 Starter Kit for Beginners: Kickstart your electronics projects with the Vilros Arduino Uno R3 kit. Includes over 190 components such as Arduino Uno, breadboard, jumper wires, DC motor, servo, and relay. Perfect for beginners and electronics enthusiasts. Great electronics kit for learning circuit fundamentals.
  • Comprehensive Instruction Manual for Easy Learning: The 72-page full-color instruction manual guides you step-by-step in mastering Arduino programming, perfect for both beginners and experts. Learn the basics of Arduino Uno and electronic circuits, and how to use each component effectively in your own projects.
  • 190+ Electronics Components for Multiple Projects: With over 190 components like resistors, LEDs, transistors, and more, this kit gives you everything you need to build Arduino circuits and projects. From jumper wires to breadboard holders, you’re all set for creating your own innovations in electronics.
  • Value-Packed with $100+ of Components: Save more than 40%! This Arduino starter kit includes a wide variety of components valued over $100. Whether you're a beginner or experienced user, this kit offers exceptional value, providing everything needed for Arduino Uno and electronics accessories & supplies.
  • Versatile & Compatible with Other Kits: In addition to being perfect for Arduino Uno R3 projects, this kit is compatible with Raspberry Pi and other electronics tool kits. Learn to integrate components into various DIY projects and explore endless possibilities in Arduino programming and electronics.

Do not copy numeric thresholds from another build as universal values. A TCS3200 or TCS34725 setup produces different measurements from an LED-and-photoresistor arrangement, so each needs calibration appropriate to its sensor, illumination, geometry, and code.

Troubleshooting misreads and double feeds

The sorter misreads colors

  • Check that the candy is held at a consistent distance from the sensor and that ambient light is controlled; the Skittle Color Sorter repository specifically flags lighting and distance as sources of variation.
  • Repeat the project’s calibration for the empty sensing position and for each candy color, using candies from the set you intend to sort.
  • For an LED/photoresistor design, compare readings under the intended LED colors with the candy in the same chamber position. A change in chamber lighting or placement can change reflected-light measurements.
  • Use the calibration values generated for your own sensor and setup, rather than treating another project’s example values as general thresholds.

Two candies enter the sensing area

The classifier is meant to measure one piece at a time. If pieces overlap or arrive together, the reading cannot reliably represent one candy’s color. Adjust the tube, hopper, dispenser, feed wheel, or timing so the mechanism releases a single piece and pauses it at the sensing position before classification. The documented builds use different feeding solutions; there is no single feeder adjustment that applies to all of them.

Rank #4
SunFounder Elite Explorer Kit with Original Arduino® UNO™ R4 WiFi, Powered by Arduino, RoHS Compliant, Bluetooth IoT ESP32 LCD1602 OLED, Super Starter Kit, Video Courses for Beginners & Engineers
  • All-in-One Starter Kit for Beginners: Part of the Powered by Arduino program, this kit includes an original Arduino UNO R4 WiFi, 300+ high-quality components, 50+ hands-on projects (30 basic, 13 fun, and 8 IoT), and 100+ free video lessons co-created with renowned educator Paul McWhorter. Designed for beginners ages 8+, it provides a complete, step-by-step path to learn Arduino, electronics, coding, and IoT. RoHS compliant for added safety and quality, it also makes a thoughtful gift for tech enthusiasts, students, and aspiring makers for birthdays, holidays, and special occasions
  • Powerful Arduino Uno R4 WiFi Board: Upgraded from the Arduino Uno R3, the Arduino Uno R4 WiFi features a 32-bit processor, more memory, and built-in WiFi and Bluetooth, enabling connection to third-party apps for more interactive and practical projects.
  • 300+ Components for Endless Possibilities: With 300+ components and sensors, this kit is perfect for portable projects. It features step-by-step tutorials, open-source code, and compatibility with other Arduino boards like Uno R3 and Nano, offering endless customization and learning opportunities.
  • Engaging Projects for Every Skill Level: Featuring 50 projects (30 basic, 13 fun, 8 IoT) with IoT app integration like Arduino IoT Cloud , this kit supports Arduino C++ programming, making it perfect for students, teachers, and engineers to learn, code, and create at any skill level.
  • Dedicated Support for Beginners: Alongside online resources and video tutorials, SunFounder provides technical support and troubleshooting forums to help beginners solve programming challenges with ease.

The candy does not reach the intended bin

Check the sequence between classification and motion: the selected output must correspond to the correct servo position or stepper-controlled route, and the candy must have a clear path off the platform or through the guide. The cited projects do not publish a shared motion map, so use the mapping and mechanical positions from the particular design you are following.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Parts and build planning

A relevant parts list may include an Arduino Uno or Nano, a sensor such as a TCS34725, one or more hobby servos or stepper motors, LEDs and a photoresistor if using that sensing approach, and frame or enclosure material. A printed hopper is optional: a tube, platform, or other frame can work if it presents each candy consistently. Check that the board, sensor breakout, motors, and chosen code are compatible; the documented builds do not establish that one particular product listing has been tested across designs.

Best Value
Sale
Official Arduino Starter Kit [K000007] - 12 DIY Projects with Electronic Components & English Projects Book - Original Kit from Italy
  • Complete DIY Electronics Kit – The Official Arduino Starter Kit includes everything you need to begin exploring the world of electronics and programming, featuring 12 hands-on DIY projects that teach key concepts in coding and circuit design.
  • Comprehensive English Projects Book – Comes with an easy-to-follow, detailed project book in English, guiding you through each project step by step, ideal for beginners learning electronics and microcontroller programming.
  • Ideal for All Skill Levels – Whether you're a complete beginner or looking to refresh your skills, this kit is perfect for anyone interested in learning electronics, coding, and building creative projects.
  • High-Quality, Original Components – Includes a selection of genuine Arduino components sourced from Italy, ensuring durability, reliability, and compatibility with a wide range of Arduino-based projects.
  • Perfect for Learning & Teaching – This kit is designed for educational purposes, making it an excellent tool for classrooms, hobbyists, and anyone interested in STEM learning and innovation through hands-on experimentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.