## 1 Introduction
### System Hardware  
The general block diagram of the designed system is shown in Figure 2. The system basically consists of a data acquisition and control unit, robotic platform, driver unit, user interface and power supplies. A Raspberry Pi 4 mini-computer development board is used as a data acquisition and control unit in the designed robot cell. In this unit, in addition to color-based image processing, three-axis robot handling with G-Codes (RS-274, Geometric Code) and adjustment of the ambient light level using PWM signal are provided. The Raspberry Pi development board has a 1.5 GHz processor frequency, a 2 GB RAM memory, 40 general-purpose pins, hardware PWM outputs and a camera serial interface (CSI) connection. Step motor, motor driver and belt set are used for the three-axis movement of the robot in the robotic platform. In the system, G-Code programming language instructions are generated depending on the position information for the three-axis movement of the computer numerical control (CNC) robot. In order to compile G-Code instructions, the free open-source GRBL firmware installed on the Arduino Uno board is used. With the help of a GRBL-compatible CNC Shield driver card, the motion direction and speed of the stepper motors are determined, and the robot is positioned on the three axes [31; 32; 33]. The robot's motion area is determined by creating a platform with an area of 30 cm \(\times\) 30 cm at the base of the robot cell. In addition, an electromagnet placed on the \(Z\)-axis of the robot is used for handling operations in the system. The cylindrical (r = 2 cm, h = 2 cm) electromagnet, which has the feature of attracting metals with the magnetic field created due to the electric current passing through the coil wound on the core, works at 12 V DC and has a load-carrying capacity of 3 kg [34]. In order to take platform images in the system, an 8 Mp Pi Camera module connected to a Raspberry Pi 4 development board via a 15-pin CSI connector is used. The camera module is placed in the ceiling center of the robot cell at a height of 32 cm from the platform surface and with a bird's eye view from above. For the platform lighting, a white 12V 780 W DC strip LED with a diffuser, driven via adjustment of light intensity with the PWM signal, is used. The U-shaped LED strip lamp is fixed to the robot cell at a height of 28 cm from the platform surface, lighting the platform from the front, under the camera. For the base platform of the robot cell, a non-reflective white matte plastic background used in photography is used. In addition, for experimental studies, the robot cell is covered  
Figure 2: General block diagram of the designed system. with a black fabric, so that ambient lighting is not affected by environmental natural and artificial light sources. In Figure 3, the block diagram of the closed-loop control system for adjusting the platform illuminance level is shown in the designed system. With the feedback, the electrical power level of the system is adjusted by making the necessary corrections depending on the error, and in this way, the illuminance level is obtained at the desired value. In the designed system, control is performed depending on the error rate between the RGBY reference object coordinates and the coordinates obtained as a result of image processing in determining the minimum illuminance level required for color-based image processing. The power of the lighting system is adjusted by reference to RGBY objects, whose actual centroid positions are known before, without the need for an external sensor or device in the system. In the designed robotic system, a MOSFET-based driver circuit controlled by Raspberry Pi is designed (Figure 4). With this driver circuit, the power required for the LED strip lamp and the electromagnet is provided. An electromagnet working at 12 V DC is used for the handling process in the system. With the on/off control for the electromagnet, objects can be held and released.