# Optimizing Boleaching for Printed Circuit Board Copper Recovery: An AI-Driven RGB-Based Approach
### The Bioleaching Plant
High- and low-level sensors ensure tank volumes remain within safe limits to prevent overflow or underflow. Abnormalities trigger automated responses, such as halting the addition of new waste or activating recirculation pumps. The recirculation system, managed by pump PL1, ensures uniform distribution of bioleaching agents and prevents solid residue sedimentation. Additionally, colorimetric sensors measure the solution's red, green, and blue components to estimate metal ion concentration in real time, providing an indirect measure of the leaching process's efficiency. Electolysis Unit: Commonly referred to as the copper recovery unit, this stage constitutes the final step in the bioleaching process. Here, dissolved copper ions are separated from the solution and deposited as solid copper through the electrospinning technique, enabling efficient metal recovery. In this process, an electric current is applied to precipitate copper onto cathodes. The system includes sensors to monitor voltage, current, and solution composition. Circulation pump PB4 ensures continuous solution flow between the leaching tanks and the recovery unit, maintaining a steady supply of copper ions for deposition. Pressure and level sensors regulate the inflow and outflow of the solution to prevent imbalances that could disrupt the electrospinning process. Anomalies in voltage or current trigger automatic adjustments to operating parameters, ensuring efficient metal recovery and protecting the equipment from potential damage. The bioleaching plant operates through a robust hardware and software system built around an industrial Arduino device integrated into a SCADA framework; further details are available in our previous work [9]. Key components like the ESP32-PLC, Raspberry Pi, and Node-Red form a flexible control structure. The ESP32-PLC serves as the main controller, interfacing with sensors and actuators, managing control loops, and adjusting  
Figure 1: Diagram of the bioleaching plant, highlighting its key components: bioreactor, leaching tanks, and electrolysis unit. parameters such as pH or halting pumps during emergencies. Data collected by the ESP32-PLC are transmitted to a Raspberry Pi running Node-Red, which processes and visualizes the data through a cloud-based Big Data System (BDS). The system uses the MQTT protocol for reliable, low-latency communication. Technicians can monitor and control operations in real time via a touchscreen panel onsite or remotely via the Telegram app, with manual overrides available for intervention when necessary. A key feature of our semi-industrial bioleaching plant is the integration of an advanced RGB digital sensor at the bioreactor station. This non-invasive RGB sensor measures Fe (III) and Cu (II) concentrations by detecting color changes in the solution, eliminating the need for complex sampling and analysis. The application of RGB sensors in bioleaching is an underexplored area, offering potential for monitoring microbial activity. RGB sensors operate without direct contact with the corrosive and aggressive liquids involved in chemical processes, significantly extending their operational lifespan. They are not only cost-effective but also offer a clear and reliable correlation with reaction progress, facilitating rapid data acquisition. Unlike standard models that rely on sample extraction, extended analysis times, and manual result interpretation, these sensors enable real-time monitoring. Their implementation in our bioleaching plant can optimize operations by automatically halting the process at the optimal threshold, leading to substantial savings in time, materials, and labor costs. Its performance has been validated by comparing its readings with conventional methods, such as UV-VIS spectroscopy and atomic absorption, demonstrating its accuracy and reliability in the harsh bioleaching environment, as shown in our previous work [10].