The quality of yarn is essential in the control of the fabrics processes. There is some commercial equipment that measures the quality of yarn based on sensors, of different types, used for collecting data about some textile yarn characteristic parameters. The irregularity of the textile thread influences its physical properties/characteristics and there may be a possibility of a break in the textile thread during the fabric manufacturing process. This can contribute to the occurrence of unwanted patterns in fabrics that deteriorate their quality. The existing equipment, for the above-mentioned purpose, is characterized by its high size and cost, and for allowing the analysis of only few yarn quality parameters. The main findings/results of the study are the yarn analysis method as well as the developed algorithm, which allows the analysis of defects in a more precise way. Thus, this paper presents the development and results obtained with the design of a mechatronic prototype integrating a computer vision system that allows, among other parameters, the analysis and classification, in real time, of the hairs of the yarn using artificial intelligence techniques. The system also determines other characteristics inherent to the yarn quality analysis, such as: linear mass, diameter, volume, twist orientation, twist step, average mass deviation, coefficient of variation, hairiness coefficient, average hairiness deviation, and standard hairiness deviation, as well as performing spectral analysis. A comparison of the obtained results with the designed system and a commercial equipment was performed validating the undertaken methodology.