## 3 Materials and Methods  
Our research focuses on a case study conducted at a medium-sized textile manufacturing company located in Faisalabad, Pakistan, which is a major hub for the country's textile industry. This location was chosen due to its significant contribution to Pakistan's economy and the pressing need for sustainable practices in this sector. The company was selected based on its openness to integrating IoT technologies and its representation of typical operational and environmental challenges faced by the industry. The case study's context includes the company's size, employing around 350 workers and 50 machines and producing a variety of textile products, including clothing, sheets, bags, and baskets. This context is crucial for understanding the operational factors and challenges, such as energy consumption, surveillance, environmental impact, and quality control requirements, that necessitate IoT-driven solutions. The study's findings, while specific to this company, offer insights that are both unique and generalizable, providing a blueprint for other textile manufacturers aiming to achieve digitalization and sustainability. The flowchart in Figure 2 outlines a structured approach for IoT research in the textile industry, covering key steps from the literature review to future directions and conclusions. The methodology employed in this pilot study aimed to showcase the feasibility of implementing a structured framework for real-time monitoring in Pakistan's textile sector using an integrated approach of smart sensors, as illustrated in Figure 3. Technical assistance, either virtual or physical, was provided to ensure the interconnection of these sensors. Drawing upon previous research highlighting the need for improved implementation of IoT models [48], this study emphasized the importance of data analytics and decentralization in establishing a successful and secure IoT network [49]. This case study is highly relevant to the Pakistani textile industry because it addresses the sector's unique needs and requirements, such as increased efficiency, quality monitoring, cost savings, transparency, and traceability, all of which support the sustainability objectives covered in detail in the paper's application and benefits section. Pakistani textile companies may acquire a competitive edge, follow market trends, and satisfy the demands of both domestic and foreign markets by carrying out this pilot project and demonstrating the effective application of real-time monitoring of numerous indicators. The methodology involved the design and validation of a setup specifically for demonstration purposes in a small-scale project. A visualization of the building blocks of the proposed innovation is shown in Figure 4, depicting the proposed system design. The primary objective was to acquire real-time data wirelessly from sensors placed at a remote distance. A total of ten sensors were utilized to monitor various physical parameters, along with four MATLAB-based sensors. These sensors were strategically placed at a distance of approximately 100 m. The acquired real-time data was  
Figure 3: A flow chart paving the way to a smart system transformation. Figure 2: Structured research methodology for IoT implementation in textile sector. then displayed on a MATLAB graphical user interface (GUI) on a workstation. The process begins with the activation of sensors strategically placed within the textile manufacturing environment. One laptop is connected to an Arduino microcontroller board via a USB cable. The USB connection allows the laptop to program the Arduino and exchange data. Jumper wires connect components (like resistors, LEDs, and sensors) on the breadboard and also link the Arduino pins to the points on the breadboard. Sensors (e.g., temperature, humidity, motion, GPS, joystick, and light sensors) are connected to digital input pins on Arduino I/O pins; LEDs and relays are connected to digital output pins. The USB connection between the laptop and Arduino enables serial communication.