Real-Time Machine Vision for Pill Sorting

Description
The goal of this project was to develop an affordable, functional, and reliable automated pill sorting system using Raspberry Pi and computer vision. The prototype was designed to assist individuals with physical or cognitive impairments in managing their daily medications

The goal of this project was to develop an affordable, functional, and reliable automated pill sorting system using Raspberry Pi and computer vision. The prototype was designed to assist individuals with physical or cognitive impairments in managing their daily medications more efficiently. For demonstration and testing purposes, candies with different shapes and colors were used to simulate pills. The system uses a Raspberry Pi 5, a camera module, and servo motors controlled through a PCA9685 driver to identify and sort candies based on their color and shape. A conveyor belt moves each candy under the camera where images are captured, processed in real time using OpenCV, and classified using HSV color filtering and contour analysis. Classified items are then routed to the correct compartments using servos. Testing was conducted under both bright and dim lighting conditions to evaluate system robustness, yielding classification accuracies of 95.9% and 100% respectively. The total build cost was $264.03, significantly less than commercial alternatives. The system proved effective in demonstrating low-cost, high-accuracy automated sorting. Future improvements include adding a feeder mechanism, enhancing the user interface, integrating a pill database, and potentially training a custom machine learning model for improved classification and real-world deployment.

Downloads

One or more components are restricted to ASU affiliates. Please sign in to view the rest.
Restrictions Statement

Barrett Honors College theses and creative projects are restricted to ASU community members.

Details

Contributors
Date Created
2025-05
Topical Subject
Additional Information
English
Series
  • Academic Year 2024-2025
Extent
  • 23 pages
Open Access
Peer-reviewed