This study presents the design and development of an automated apple quality classification and sorting system to overcome key limitations of manual grading, such as inconsistency, inaccuracy, and labor dependency. The primary objectives are to detect and classify fruit quality based on visual parameters such as color, shape, and defects, and to employ a robotic arm that autonomously sorts the apples into predefined quality categories based on the classification results. A YOLOv8 segmentation model was trained and deployed on a Raspberry Pi 4 Model B to perform real-time classification of apples as good or bad. Further analysis using OpenCV was applied to good apples by evaluating red color ratio and fruit size (height and width) to determine premium or standard grade. The hardware setup includes a PiCamera for image capture and servo motors for sorting and rotating apples to support both single-side and multiple-side detection modes. The YOLOv8 system achieved a mean average precision (mAP) of 96.56%. Hardware testing demonstrated improved classification accuracy from 97% using single-side detection to 100% using multiple-side detection across 60 apple samples. A Tkinter-based graphical user interface (GUI) was developed to allow users to control detection modes, view classification outcomes, and monitor sorting actions in real time. This system offers a low-cost and scalable solution for automated fruit sorting. Its adaptability to multiple detection angles and integration with physical sorting mechanisms make it a practical option for small-scale agricultural automation and research environments.