## 2 Materials and Methods
### Design and Implementation of the Sensing Device
#### 2.2.3 IoT and Bluetooth Low Energy Connection  
In recent years, we have seen a significant advance in digital technologies, which contributes to the current concept of the Internet of Things (IoT). At the basis of the IoT, there are \"intelligent\" objects that are interconnected to the exchange information owned, collected, and/or processed. The smart object must first be identifiable; that is, with a unique identifier in the digital world, and then it must be connected to transmit and receive information. These are smart connected devices that process and share all kinds of data with each other, and that can be controlled via the Internet. Into this context fit energy-efficient short-range wireless communication technologies such as Bluetooth Low Energy (BLE) [15].  
Figure 3: The CAD design of the second version of the mechanical support. (**a**) The housing for the electronic board. (**b**) The connection part for the positioning of the device along the EndoWrist tools.  
This section shows how is possible to exchange information between two Arduino Nano 33 BLE Sense boards. With this communication, the various arms of the da Vinci surgical robot can be interconnected.  
When a Bluetooth(r) connection is established, the central device will scan the surrounding devices and \"listen\" for the devices that transmit information, and at the same time, the device will advertise or transmit its data or information to any nearby device. As soon as the central device collects information from the peripheral device, an attempt is made to connect the peripheral device. Once the connection is established, the central device will interact with the available information to the peripheral device. This information exchange takes place using so-called services. By grouping the various device capabilities into services, central devices allow peripheral devices to quickly find, select, and interact with the desired services. Any service has a unique identifier called UUID. This code can be 16 or 32 bits long, for services with Bluetooth specifications. One of the two Arduino Nano BLEs is configured as a central device, while the other as a peripheral device. The information shared between the two boards comes from the proximity sensor of the integrated APDS-9960 unit of the Arduino Nano 33 BLE Sense board.  
For this purpose, the ArduinoBLElibrary library was used, and a service called proximityService was created with a feature called proximity_type, as shown in Figure 4. The central device tries to establish a connection with the peripheral device, and tries to discover the service and the feature that we have specified when implementing the code. If the connection is made successfully, the Nano 33 BLE Sense board's built-in proximity sensor is activated. When a proximity value is detected by the sensor, the central device gives us feedback, through the serial monitor, on the type of distance detected (FAR, MIDDLE, or CLOSE). The value is written to the proximity_type feature of the proximity service in the peripheral device. In addition, the on-board LED in the peripheral device lights up according to the detected value. If a distance is detected that exceeds the threshold set as FAR, the green LED will turn on; in the case of MIDDLE distance, the blue LED will be on; finally, if the object is close to the sensor, the red LED lights up.