## 2 Methods
### Wireless Component  
The wireless component is an electronic system composed of two sensor modules and a base station which collects data and relays it to a PC through a serial connection. A sensor module is presented in Figure 3. Each module is composed of two boards. One of them includes a CC2530 microcontroller from Texas Instruments (Dallas, TX, USA), which integrates an IEEE 802.15.4-compliant transceiver operating in the 2.4 GHz frequency band and supports wireless communication protocols such as Zigbee (see Figure 3a). The other board has the sensors (one three-axis accelerometer and one three-axis magnetometer) and a rechargeable battery to power the system (see Figure 3b). The microcontroller board connects to the sensor board through two 20-pin header connectors. The sensor board incorporates the LIS331 DLH accelerometer, a three-axis MEMS sensor manufactured by STMicroelectronics (Milan, Italy). This device offers 12-bit digital output resolution, with a sensitivity of 1 mg, and supports a selectable output data rate ranging from 0.5 Hz to 1 kHz. The magnetometer used is the XEN-1210, a high-precision three-axis Hall-effect magnetic field sensor developed by Sensixs Design (Delfgauw, The Netherlands). It provides nanotesla-level resolution for magnetic field measurements along the X, Y, and Z axes. The data output is 24 bits with a sensitivity of 15 nT, allowing a sample rate of up to 5 kHz. The sensor module collects data from the onboard sensors and transmits it to the base station (Figure 3c) using a customized medium access control (MAC) protocol, known as eLPRT (enhanced Low-Power Real-Time) [32]. This protocol is specifically designed to support low-latency and energy-efficient wireless communication, which is critical for battery-operated systems. Because the modules are  
Figure 3: Photographs of the modules with the sensors: (**a**) the radio module with the PCB antenna, (**b**) the PCB containing the accelerometer and magnetometer sensors, and (**c**) the base station of the wireless electronic system. compact, wireless, and battery-powered, they can be unobtrusively placed on various parts of the user's body, enabling unrestricted movement and seamless monitoring. The base station controls the wireless network performing coordination functions. Such functions include the registering of sensor modules in the network, maintaining synchronization with the help of transmitted periodic beacons, and allocating slots of time for data transmission and retransmission every time an error occurs. The synchronous nature of the implemented MAC layer protocol makes the messages arrive at specific points in time. The hardware generates an interrupt signal to handle the packet every time a message arrives. Then, the MAC header of the message is removed, and the payload of the message is sent using the RS232 serial port to the PC. The block diagram of the electronic component in the proposed system is represented in Figure 4.  
The acquisition of data from the accelerometer (LIS331 DLH) and magnetometer (XEN1210) is achieved through the SPI bus, and the sensor module utilizes the DMA subsystem to control the USART and radio peripherals. The obtained data is transmitted to the base station via the eLPRT protocol. The wireless sensing modules were attached to the leg with a generic 25 mm white Velcro straps onto the lower thigh (femur) and upper leg (tibia), as shown in Figure 5. Using the foil with the attached FBG as a reference and directly covering the patella, the top sensorial module was strapped on top of the foil (due to the existence of the antenna), and the bottom sensorial module was strapped behind the foil. This type of sensor placement aligns the two electronic modules with the FBG sensor. The base station used for the wireless communication was placed a few meters away in order to reduce data loss during the tests. As demonstrated in Figure 5, the angle calculated for each sensorial module is the lowest angle between the system's z-axis and the module's z-axis when in that position.