## 2 Materials and Methods
### Experimental Evaluations
#### 2.3.1 Proximity Detection and Experiments with Organs  
Proximity calibration was performed using the embedded APDS9960 unit of the Arduino Nano 33 BLE Sense. The path of the IR receive signal begins with the IR detection using four photodiodes, and ends with an 8-bit proximity result (256 values) in the PDATA register. So, we focused on proximity readings, which were based on sensing a tissue on photodiodes, and were then converted to millimeters within the sensor for our use. The board has been programmed to print out simple proximity detections and control the RGB LED accordingly, and to change the colors of the RGB LED according to the proximity of a tissue to the sensor. To take advantage of the functions of the APDS9960 detection unit, the <Arduino_APDS9960.h> library was used. In particular, the LED lights up green if the object is far from the sensor (proximity value >150), blue in the case of intermediate distance (60 < proximity value < 150), and red if the object is very close to the sensor (proximity value < 60). The threshold values shown in parentheses have been implemented in the code. The first test performed concerns the evaluation of the proximity between the tissues and the sensor. This allows the surgeon to work in a safer environment with the sensorization of the instrument, which gives a sound or visual feedback based on the  
Figure 5: Complete prototype of the first version of the detection device connected to the EndoWrist tool of dVRK system. Figure 6: Complete prototype of the second version of the detection device connected to the EndoWrist tool of dVRK system. distance of the instrument to the tissue. This aspect is very important during abdominal surgery procedures, where the various organs are very close to each other. Before getting to the heart of the testing phase, a connection was created between the Arduino Nano 33 BLE Sense board and the Matlab software through a serial communication protocol to manage the data collected by the proximity sensor directly in the Matlab environment. Subsequently, we moved on to the real-time display of the proximity values read by the sensor, which allowed for an instant evaluation of the trend of the data collected in relation to the distance in centimeters. Proximity data acquisition was performed with the MELFA RV3-SB industrial robot. For the execution of the tests, a support for the Arduino board to be fixed to the end effector of the robot was designed and built using a 3D printer. The support was fixed to the robot using two M5 screws, as shown in Figure 7.  
The robot was programmed to perform movements along the z axis, allowing the sensor to move away from and approach the tissue sample. Once we acquired the initial position (minimum distance from the tissue) desired, we decided to make the robotic arm move by 13 cm by making vertical movements of 0.5 mm intervals. All the positions necessary for the desired movement were implemented manually using the robot programming language with a structure that is very simple and intuitive; for example, the command MOV was used to manage the movement of the robot from one position to the next. Slices of tissues with a thickness of about six millimeters were obtained from the organ. Obviously, since these are soft and/or spongy organs, it is not possible to consider a precise and absolute measure of thickness, as the tissue surfaces have protuberances and depressions. This condition was considered relevant for an optimal and faithful representation of the operational reality; therefore, no corrections were made. These slices of tissue were placed on a rigid plate on the workstation below the sensor. As shown in Figure 8, a safety space was left between the sensor and the surface of the tissues to ensure the cleanliness and integrity of the detector. During the testing phase, the same environmental lighting conditions were always maintained.