**3. Methodology**

This section demonstrates the design of a complete system describing the main blocks of the smart insole along with illustrations of sensor calibration and insole characterization process.

#### *3.1. Smart Insole Sub-System*

Figure 1 shows the complete block diagram of the system, where the pressure sensor array was placed in a customized shoe above the control circuit. Pressure data were digitized through a microcontroller before they were sent wirelessly to a host computer for post processing and analysis. This subsystem was powered by a battery with the help of a power managemen<sup>t</sup> unit. Pressure data were analyzed to extract various gait characteristics for di fferent gait applications.

**Figure 1.** Smart insole block diagram.

#### 3.1.1. Pressure-Sensing Array

The vGRF during gait cycles can be sensed using one of three alternatives:

A. Force-Sensitive Resistor (FSR)

The FSR exhibits a decrease in resistance as the applied force to the surface of the sensor increases. FSR sensors from Interlink Electronics [20] were used in this study as shown in Figure 2A. The sensors have a flexible round active area of diameter 12.7 mm to detect the applied force, with a two flexible lead wires to connect the sensor to the acquisition circuit. A FSR exhibits a non-linear relation between the applied force and the sensor's resistance. In addition, no direct relationship is provided in the sensor's datasheet. Therefore, proper calibration must be done prior to the sensor usage.

B. Ceramic Piezoelectric Sensor

A piezoelectric element is a sensor that produces an alternating voltage in response to an applied dynamic pressure or vibration. With applications related to dynamic forces, the piezoelectric sensor is highly recommended. When a force applied to the piezoelectric crystal element, the net movement of both positive and negative ions occurs. When there is a constant or zero pressure, the dipole is not formed [38]. It is important to mention that the force plate is originally made of piezoelectric material mounted between two metal plates to produce three-dimensional forces with a special mechanical arrangemen<sup>t</sup> [39]. This comes in different sizes; however, a ceramic piezoelectric element with 12.8 mm electrode diameter would be suitable to obtain a high-resolution pressure map as shown in Figure 2B.

**Figure 2.** (**A**) Force-sensitive resistor (FSR) sensor from Interlink Electronics [20], (**B**) piezo-electric sensor from Murata Manufacturing Co. [38], (**C**) micro-electromechanical systems (MEMS) sensor LDT0-028K from Measurement Specialties Inc. [40].

C. Micro-Electromechanical Systems (MEMS) Sensor

The micro-electromechanical systems (MEMS) sensor is a new member of piezoelectric sensors family (Figure 2C). Similar to ceramic piezo electric sensors, it converts mechanical forces into electrical signals. However, the MEMS sensor can detect forces in x, y or z axes generating electrical impulses with positive or negative amplitudes depending on the force direction on a certain axis [40]. MEMS sensors are useful for detecting human motion sensor due to their flexibility, wide frequency range (0.001 Hz to 10 MHz), low acoustic impedance, high mechanical strengths, and high stability resisting moisture, etc. [40].

#### 3.1.2. Data Acquisition System

## A. Microcontroller (MCU):

A microcontroller (MCU) was used to collect the data from the sensor and to send to the computer for classification. Simblee is a very compact and powerful ARM Cortex-M0 MCU with a six channels 10-bit analog-to-digital converter (ADC). It is featured with an inter-integrated circuit (I2C) and serial peripheral interface (SPI) communication interface, which were required for 9-degree of freedom (DOF) module. Moreover, it has an incorporated Bluetooth low energy (BLE) 4.0 module, which can be utilized to send data to the computer. This MCU operates on a power supply between +2.1 to 3.6 V.

B. Multiplexer (MUX)

Since MCU has a limited number of ADC channels whereas the number of sensors is needed for better spatial resolution of smart insole, it is suggested to use multiplexers (MUX) to reduce the number of required channels in MCU. A MUX allows several inputs in parallel to be routed into a single output depending on the input combinations of the data selectors. Active area of these sensors are close and sixteen sensors were used to create sensors' array for each leg insole to obtain a high-resolution pressure map. Therefore, the CD74HC4067 multiplexer from Texas Instruments with 16 input channels was used in this study [41].

3.1.3. Transmission Techniques

Three commonly used transmission techniques for connected biomedical sensors are ZigBee, Bluetooth Low Energy (BLE) and Wi-Fi. ZigBee is a two-way wireless communication technique developed for sensors and control networks, which need a wider range, low latency, low energy consumption at lower data rates. BLE is an alternative to the classical Bluetooth with higher data rate and low power consumption within a limited area with low latency at 2.4 GHz. Wi-Fi makes a good candidate for transmitting data with a data rate of up to 450 Mbps for indoor applications. However, it imposes latency on the system of more than 25 ms and higher power consumption. Table 1 shows a comparison between three di fferent communication interfaces.



Since the smart insole was intended for indoor application, BLE and WiFi both were suitable for communication interface; however, the higher power consumption and latency made WiFi non-suitable for smart insole application. Moreover, Simblee MCU has in-built BLE in its small form factor. Therefore, BLE has been chosen as communication interface.

#### 3.1.4. Power Management Unit (PMU)

Power supplies were chosen depending on the operating voltage of the system components. The microcontroller and multiplexer both can operate at 3.3 V. The power managemen<sup>t</sup> unit (PMU) is LiPo Charger/Booster module MCP73831 [47] and AMS1117 voltage regulator connected to a Lithium Polymer (LiPo) battery of 3.7 V (1000 mAh), which was regulated to 3.3 V. The PMU is not only delivering regulated 3.3 V to the system but also capable to charge LiPo battery.

#### 3.1.5. Host Computer

The acquired data from smart insole can be sent wirelessly to a host computer, where post processing, thereby displaying the vGRF as pressure maps during gait cycle, was carried out. The obtained data can be used in di fferent gait analysis applications such as medical diagnostics, rehabilitation and athlete's performance assessment.

#### *3.2. Sensors' Calibration*

The first step in designing the smart insole is to calibrate the force sensors that are going to be used to detect the vGRF during the gait cycle. Three di fferent force sensors were calibrated: FSR [20], piezo-electric sensor [21] and piezo -vibration sensor [22].

#### 3.2.1. Force-Sensitive Resistor (FSR) Calibration

Firstly, a voltage divider circuit must be used with the sensor to convert the resistance change (due to applied force) of the sensor to a voltage value, which can be acquired by microcontrollers. Secondly, a load cell of 5kg from HT sensor technology company [48], with HX711 amplifier modules [15] was used as a weight reference for FSR calibration (Figure 3). The load cells consist of straight metal bar with two strain gauge sensors and two normal resistors arranged in a Whitestone bridge configuration, a constant excitation voltage (3–5 V) can be applied as an input to the circuit and the balanced configuration of the circuit replicates a zero output voltage in normal conditions when no force is applied. Any force applied to the load cell results in an unbalanced condition of the bridge leading to small voltage values in the output that can be detected and converted to force [48]. The load cell has high sensitivity and can detect as small as 1 gm of weight variation. However, the output voltage from the load cell is very small, with a maximum value of 5 mV. Therefore, a HX711 amplifier module was used. The amplifier module has instrumentational amplifier to amplify the signal with a 24-bit ADC that converts the analog signal from the load cell bridge to digital value that is readable by a microcontroller. The HX711 transmits data to the microcontroller using I2C communication protocol with 10Hz sampling rate [15].

The bar-type load cell was mounted with screws and spacers so that the strain can be measured correctly (refer Figure 3B). The load cell was placed between two plates with only one side screwed into each plate/board. This setup provides a moment of force on the strain gauges rather than just a single compression force, resulting in higher sensitivity to applied forces. The output voltage from the load cell exhibits a linear relationship with the applied force. This can be calibrated easily with any small object of known mass such as a coin that weighs a few grams.

A known weight object (ex. a coin) was placed on load cell plate; the calibration factor was adjusted until the output reading matches the known weight. Once the correct calibration factor is obtained, it was used to convert the load cell voltages to corresponding weights. The calibration factor is the slope of output voltage of load cell vs. real weights' graph. The FSR was attached to adhesive material on the back face of the active area, which was used to fix the FSR on the scale. A cylindrical acrylic of 12.7 mm diameter, matching the active area of FSR, was used to apply force on the sensor only. In addition, a square shaped acrylic plate was glued on top of the cylindrical acrylic to support the weights, as shown in Figure 3. Then, 500 g weights are placed every 4 to 5 s until 5000 g is reached. Readings from load cell and FSR circuit are acquired simultaneously by Arduino, which were saved in a text file in a computer.

Finally, the FSR output voltage was plotted with respect to the load-cell weight and a mathematical relationship was derived. The equation was used to convert smarts insole FSR readings into the corresponding applied pressure by the foot.

**Figure 3.** FSR calibration setup (**A**) and load-cell scale (**B**).

#### 3.2.2. Piezo-Electric Sensor Calibration

The same load-cell module was used for piezo calibration with some modifications (as shown in Figure 4). Piezo transducers convert the applied mechanical forces into electrical impulses. Therefore, a high sampling frequency (above 50 Hz) is needed to acquire both the piezo output and the applied weights from the load cells. HX711 amplifier module samples the data with a low sampling frequency of 10 Hz. Therefore, the data was acquired directly by the 10-bit ADC of Arduino MCU with a sampling frequency of 1 kHz. However, AD620AN instrumentational amplifiers [39] were used before the acquisition step to amplify the small load cell outputs (maximum of 5 mV).

Firstly, a voltage divider circuit was used to reduce the high piezo voltage outputs, which can go up to 20 V. Secondly, the load cell was calibrated again due to the modification. Three dead weights of known masses were used: 500 kg, 2500 kg 5000 kg (maximum load for load cell). AD620AN instrumentational amplifier gain was adjusted to give an output of voltage when maximum load is applied. This ensures that the full range of the Arduino ADC was utilized. Three dead weights were added one by one on the scale and the output voltage from load cells were acquired by Arduino. A linear relationship was fitted between the load cell voltages and applied weights. This relationship was used to convert the load cell voltage to a corresponding weight.

Unlike the FSR, weights cannot be used to calibrate the piezo sensor, since piezo sensors are sensitive to dynamic forces only. Therefore, a fast finger press and release is suggested as an alternative. The calibration can be done by pressing the active area/ceramic of the sensor with various strengths

and recording the generated electrical signals for each press as shown in Figure 4. Readings from the load cell and piezo voltage divider circuit were acquired simultaneously by the Arduino MCU. Serial terminal software was used to store the data in the computer. Load cell readings were plotted against the piezo output voltage and a linear relationship was derived. The equation was used to convert smarts insole readings into the corresponding applied weight by the foot.

**Figure 4.** Piezoelectric sensor calibration setup.

#### 3.2.3. Micro-Electromechanical Systems (MEMS) Sensor Calibration

MEMS sensors produce alternating current (AC) impulses with both positive and negative peaks. Therefore, little modification was required for the setup of piezo electric vibration sensor, refer to Figure 5. An offset circuit was added for the piezo-electric acquisition circuit. The piezo-vibration output voltage was reduced by a voltage divider circuit to ±1/2 Vcc, then adder amplifier was used to add an offset of +1/2 Vcc, so the new AC signal will be centered around +1/2 Vcc with maximum value of Vcc and minimum of 0 V. After modifying the acquisition circuit, the piezo electric sensors' calibration steps were used to calibrate the piezo-vibration sensor.

**Figure 5.** LDT0-028k MEMS sensor calibration setup.

#### *3.3. Insole Fabrication*

Once the sensors were calibrated, these sensors were separately used to construct the smart insole for vGRF detection during gait cycles. The FSR sensors and piezo-electric sensors were chosen to construct two different insoles. While the piezo-vibration sensor was found not suitable for vGRF detection, the reason of not selecting the piezo-vibration sensor is discussed in a later section. As shown in Figure 6, the most common place of the foot plane, where most of the pressure is exerted during gait are the heel, metatarsal heads, hallux and toe.

**Figure 6.** Area of foot selected for sensors (**A**), and array of pressure sensor (**B**) in those areas.

Sixteen sensors were placed on each insole to record pressure values in these areas. While no sensors were placed on the medial arch area of the foot as most people exert very low/no pressure on that area due to it is arch shape [49]. Smart insole data were collected from 16 FSRs/piezo-electric sensors. Sixteen inputs were multiplexed to one output through a 16-to-1 multiplexer and applied to an ADC input of the microcontroller then sent to host computer. All subjects were asked to place the sensor's insole inside their shoes, then placing another layer of insole on top of it to ensure comfort of the subject while walking. The acquisition and transmission circuit were connected through a conductive pathway that can help in minimizing the size of the wire and avoiding any electrical hazard. The insoles were worn by the subject inside his/her own shoe while the acquisition and transmission circuits were placed inside a 7cm × 7cm box attached to the subject's leg by an adhesive strap belt while acquiring the data. Acquired data were sent via Bluetooth to a computer, where they were plotted and analyzed.

#### 3.3.1. FSR Insole Characterization

Twelve healthy subjects (Table 2) were asked to walk a straight 10 m walkway with self-selected cadence six times with an average walking speed of 3–4 mile per hour (MPH) and data acquired at 60 Hz sampling frequency using the smart insole made up of 16 FSRs (Figure 7). On treadmills, participants are restricted to walk in straight line as direction changes and turning cannot be realized; however, in the proposed study, the user walked freely in a 10-m walkway and they were asked to walk in a corridor which has a length of 10m and width of 1.5 m and they did not need to walk completely in a straight path and the user can walk in self-cadence, which is not possible on a treadmill. Subjects were asked to place the smart insole in their shoe while wearing cotton socks to avoid any sweat leakage that might damage the sensors or affect data acquisition from the sensors. Although walking speed is an important factor in some applications, it is not needed in many gait studies where the main focus is to detect the vertical ground reaction forces and asses the gait variables. The statistical gait variables were the symmetry between both feet, percentage of different phases (stance and swing phase) and sub phases (heel strike, mid-stance, toe off etc.) in a full gait cycle. Those statistical variables were used in various studies including sports or medical applications for gait analysis, without the need for walking speed measurement. However, the walking speed was recorded to see the impact of walking speed in the vGRF for a gait cycle. The FSR data were converted into force values by the relationship obtained in the calibration stage. Then 16 sensors' data were added at each time instance to obtain one value that represents the full force exerted by the body while walking (i.e., vGRF).


**Table 2.** Demographic variables of participants.

**Figure 7.** Smart Insole using FSR sensor: top (**A**) and bottom (**B**).

#### 3.3.2. Piezo-Electric Insole Characterization

A similar test was carried out with the piezo-electric sensor based smart insoles (Figure 8). Three subjects were asked to walk in a 10 m walkway in normal cadence, with three trials carried out by each subject. The data were acquired with a sampling frequency of 60 Hz.

**Figure 8.** (**A**) Piezo insole with 16 piezo sensors, (**B**) additional insole layer placed on top on piezo insole to ensure comfortability.

#### *3.4. Performance Evaluation of the Prototype System*

A commercial F-scan smart insole system (Figure 9A) was used to validate the designed insole. The F-scan system is one of the best insoles currently available on the market. The insole comes with ultra-thin (0.18 mm) flexible printed circuit with 960 sensing nodes. Each sensing element was recorded with 8-bit resolution with a scanning speed up to 750 Hz. However, the overall cost of the system is 13,000 \$ for the wired system and 17,000 \$ for the wireless system. On the other hand, the instrumented insole costs only ~500 \$. Usually, the vGRF peak is around ±10% of the subject's weight. Therefore, using F-scan software, data collected from each subject was calibrated based on subject's weight. The user needs to stand on one foot applying his/her full weight on the insole for 4 to 5 s, then the average applied weight was calculated. If the value obtained was less than the subject's weight, the F-scan software adjusted the output by a multiplication factor. Similar approach was used in the prototyped FSR insole as well. Figure 9B,C show the F-scan and prototyped system worn by the same subject to compare the vGRF signal acquired by the individual system.

**Figure 9.** F-scan commercial system ( **A**), F-scan system worn by Subject 01 (**B**) and FSR-based prototype system worn by Subject 01 ( **C**).
