M&M Sorting Machine
Mechatronics
Spring 2022
Project Outline
The goal of this project was to individually create a module of an M&M sorting machine. Each module should be able to count and sort M&Ms by color, separate metal contaminants, be paused at any time via a start/stop button, and display information about the system during the process. At the end of the semester, teams would put their modules together on the competition day and try to sort as many M&M's as they could in 5 minutes.
Finished Machine
CAD Model of sorter
Completed Module
Video of full individual functionality including start-up, alignment, color sorting, contaminant sorting, and pause functionality.
Design Features
Actuators
DC motor with encoder and PID control to drive main wheel
2 servos used to change sorting configuration
Sensors
Self built color sensor made of an RGB LED and a phototransistor
Self built metal detector made of two Hall-effect sensors, a magnet, and a comparator
Two IR LED's and IR phototransistors for wheel alignment and M&M detection
Reflectance array for counting number of M&Ms in input queue.
Distance sensor to detect if anything is in the workspace and pause if so.
Interface
I2C Display Screen
2 Rocker switches for power and emergency stop
1 button with cap for pause/resume function
Header pins for inter module communication and initial config
Power and Control
Arduino Mega
L298N Motor Driver
Wall adapter and DC power jack
Operation
The main feature of the sorting machine is a rotating plate with six slots that moves the M&M's to each sensor of the sorting machine. A motor with an encoder is used to accurately rotate the plate to each spot. The alignment IR LED is used to correctly initialize the position of the plate and set the encoder.
Input Queue - Reflectance array counts how many M&Ms are in input queue. If number exceeds specified value then a signal is sent to the previous module to pause
M&M Detector - An IR LED shines through the main plate to an IR phototransistor. When an M&M is in the slot the IR LED is blocked and an M&M is detected
Viewpoint / Contaminant Entry - A buffer space used for debugging, viewing, and sometimes putting in contaminants mid line.
Color Sensor - Color sensor gets a reading for R, G, and B values of light levels to determine the color of the M&M
Metal Detector - Two hall effect sensors back to back are placed a specific distance from a small magnet and wired into a comparator to make the signal boolean. When anything metal comes between the sensor and the magnet it amplifies the magnet and triggers the signal.
Exit Chute - M&M's are dropped and follow the path created by the servos based on what color the system determines them to be.