Development of a Portable Multi-Sensor Urine Test and Data Collection Platform for Risk Assessment of Kidney Stone Formation

: In this paper, we present an Internet of things (IoT)-based data collection system for the risk assessment of urinary stone formation, or urolithiasis, by the measurement and storage of four parameters in urine: pH, concentrations of ionized calcium (Ca 2 + ), uric acid and total dissolved solids. The measurements collected by the system from patients and healthy individuals grouped by age and gender will be stored in a cloud database. These will be used in the training phase of an artiﬁcial intelligence (AI) machine learning process utilizing the logistics regression model. The trained model provides a binary risk assessment, indicating if the end user is either a stone-former or not. For system validation, standard chemical solutions were used. Preliminary results indicated a su ﬃ cient measurement range, falling within the physiological range, and resolution for pH (2.0–10.0, +/ − 0.1), Ca 2 + (0.1–3.0 mmol / l, +/ − 0.05), uric acid (20–500 ppm, +/ − 1) and conductivity (1.0–40.0 mS / cm, +/ − 0.1), exhibiting high correlation with standard instruments. We intend to deploy this system in few hospitals in Taiwan to collect the data of patients’ urine, with analysis aided by urologist assessments for the risk of urolithiasis. The modularized design allows future modiﬁcation and expansion to accommodate other sensing analytes.


Introduction
In recent decades, the occurrence rate of urolithiasis (i.e., the formation of urinary stones) is increasing in most countries worldwide [1]. Research in the United States shows a 1.9 time increase in the rate of urolithiasis, according to emergency department visits between 1992 and 2009 [2]. The expenses associated with stone diseases include public health and an economic burden exceeding $10 billion in the United States [3]. Another study in Iceland for a duration of 24 years reported a significant increase in the incidence of kidney stone diseases [4]. In the 2019 report of annual medical expenses from Taiwan National Health Insurance, chronic kidney disease stayed on top of the list, accounting for more than USD 1.7 billion [5].
Kidney stone formation remains asymptomatic until the final stages, when there is the presence of blood in the urine, painful urination or pain in the back or lower abdomen [6]. In this stage, medical imaging such as the conventional X-ray, computed tomography (CT) or multi-detector CT is used for detecting the size and location of the stone. In addition to size and location, the composition on the circuit used in [6] and has the flexibility of measuring the electrical conductivity of a urine sample by a two-electrode or four-electrode conductivity sensor. The measurement of electrical conductivity is used for the detection of the level of total dissolved solids in a urine sample. The relevance between urine sample conductivity and total dissolved solids is shown in [14]. The system also measures the temperature using a semiconductor temperature sensor. The temperature data is used for improving the accuracy of the measurement of other parameters. The digital back end of the system is an ARM ® Cortex-M0+ ® microcontroller with an 8-channel 12-bit analog-to-digital converter (ADC) that has a maximum sampling rate of 1 mega sample per second (MSPS). The microcontroller acts as the brain of the system. It controls the whole process by properly providing the required digital and analog signals for each readout circuit. In addition, the output signals from the readout circuits are conditioned prior to connecting to the microcontroller's embedded ADC. The measured value of the ADC was later calibrated by the pre-stored factors and temporarily saved in the microcontroller's memory. The single board computer, a Raspberry Pi ® Model 3B, communicates with the microcontroller through the serial port to collect the results and store them in the single board computer's local database. Furthermore, Internet connectivity, the access point and the local HTML server, which form the graphic user interface (GUI) and data synchronization in the cloud, are parts of the system handled by the single board computer.
The measurement range of each parameter has been selected to cover the physiological range expected form healthy individuals and from those who are suffering from urolithiasis. The study published in [15] reported that patients who formed uric acid stones most commonly had a persistently low urine pH less than 5.5. Hypercalciuria was diagnosed for calcium excretions exceeding 4 mg/kg/24 h [16]. Meanwhile, urinary pH is the main determinant of uric acid crystallization and precipitation and, in fact, the vast majority of uric acid stones are associated with a low urine pH, rather than the excessive urinary concentration of uric acid due to hyperuricosuria and low urine volume. The risk of uric acid crystallization increases proportionally with a progressive fall in urine pH [17]. Based on the reports from [14], the values of electrical conductivity (EC) ranged from 1.1 to 33.9 mS/cm, the mean value being 21.5 mS/cm. The total dissolved solids (TDS) ranged from 3028 ppm to 18,480 ppm, the mean value being 7012 ppm. The TDS levels corresponded with the EC of urine.
The on-board design and the use of off-the-self commercial components and sensors accelerated the implementation of the overall system concept for immediate practical deployment. Attempts to develop the chips required more time and a relatively bigger budget. However, it has the potential for a smaller form factor, low power and a fully integrated system. A first version of our multi-sensor analog front-end chip for interfacing to multiple sensors is presented in [6].
The IoT-enabled design of the system allows for distributing multiple devices to different locations, then collecting measurement results from multiple samples simultaneously and storing them in a central database. This configuration makes the access to a large amount of data in a short period of time possible. In the first phase, the data will be used in an artificial intelligence machine learning training process. Once a urine sample is supplied to the system for the measurement of four parameters, the urologist, physician or medical personnel assesses whether the individual is a stone-former or not. Their assessment is based on background history, symptoms, their expert analysis of the urine sample and other diagnosis tools. A logistics regression model is selected, since it is more suitable for systems that require only a binary output. The output of the model has two states indicating if the person has a high risk of forming kidney stones or a low risk of urinary stone formation. The model's six inputs are the four measured parameters along with gender and age. Upon validating the trained model, the system will serve as a portable point-of-care device. In this stage, the system will measure the same four parameters from a urine sample and feed them to the trained model, along with the age and gender of the person. The output from the model will indicate if the person is at a high risk of forming kidney stones. Meanwhile, the information in the central database becomes richer, as the data from IoT-enabled point-of-care devices will be saved in database, too. This feature allows for the re-evaluation and improvement of the initial model in the future with a larger data set.

Materials and Methods
The system measured four parameters-pH, Ca 2+ , uric acid concentration and conductivity-of the sample from the first void urine in the morning, based on the method performed in [11]. By taking the first void urine in the morning, we could further assess the possibility of stone formation, because such urine has stayed for a relatively longer time in the urinary tract. Moreover, at nighttime, the body is in a relatively dehydrated status.
In the previous approaches of system implementation, the on-board module was designed for single-parameter measurement. Figure 1 shows the on-board implementation from [11], used for the measurement of urine sample conductivity.

Materials and Methods
The system measured four parameters-pH, Ca 2+ , uric acid concentration and conductivity-of the sample from the first void urine in the morning, based on the method performed in [11]. By taking the first void urine in the morning, we could further assess the possibility of stone formation, because such urine has stayed for a relatively longer time in the urinary tract. Moreover, at nighttime, the body is in a relatively dehydrated status.
In the previous approaches of system implementation, the on-board module was designed for single-parameter measurement. Figure 1 shows the on-board implementation from [11], used for the measurement of urine sample conductivity. The on-board implementation of the potentiometric circuit presented in [18] was used for measuring the pH and Ca 2+ in urine samples, as shown in Figure 2. The on-board prototype of the potentiometric readout system [18].
Since in the design of our system flexibility was considered a major feature, modular design was utilized. The sensors were separated and connected to the system using cables. This allowed the electronic circuits to remain inside an enclosure without exposure to the outside environment. Each readout circuit was implemented on an independent printed circuit board (PCB), while the digital controller and single-board computer were independent modules as well. A motherboard with proper sockets and connectors was used for the assembly of the system and connecting different modules to each other, as shown in Figure 3. The on-board implementation of the potentiometric circuit presented in [18] was used for measuring the pH and Ca 2+ in urine samples, as shown in Figure 2.

Materials and Methods
The system measured four parameters-pH, Ca 2+ , uric acid concentration and conductivity-of the sample from the first void urine in the morning, based on the method performed in [11]. By taking the first void urine in the morning, we could further assess the possibility of stone formation, because such urine has stayed for a relatively longer time in the urinary tract. Moreover, at nighttime, the body is in a relatively dehydrated status.
In the previous approaches of system implementation, the on-board module was designed for single-parameter measurement. Figure 1 shows the on-board implementation from [11], used for the measurement of urine sample conductivity. The on-board implementation of the potentiometric circuit presented in [18] was used for measuring the pH and Ca 2+ in urine samples, as shown in Figure 2. The on-board prototype of the potentiometric readout system [18].
Since in the design of our system flexibility was considered a major feature, modular design was utilized. The sensors were separated and connected to the system using cables. This allowed the electronic circuits to remain inside an enclosure without exposure to the outside environment. Each readout circuit was implemented on an independent printed circuit board (PCB), while the digital controller and single-board computer were independent modules as well. A motherboard with proper sockets and connectors was used for the assembly of the system and connecting different modules to each other, as shown in Figure 3. The on-board prototype of the potentiometric readout system [18].
Since in the design of our system flexibility was considered a major feature, modular design was utilized. The sensors were separated and connected to the system using cables. This allowed the electronic circuits to remain inside an enclosure without exposure to the outside environment. Each readout circuit was implemented on an independent printed circuit board (PCB), while the digital controller and single-board computer were independent modules as well. A motherboard with proper Electronics 2020, 9, 2180 5 of 18 sockets and connectors was used for the assembly of the system and connecting different modules to each other, as shown in Figure 3. The block diagram of the system is shown in Figure 4. There were four layers in the system. The sensor layer included an ISFET sensor for pH measurement, an EEGFET sensor for measuring the Ca 2+ concentration, an electrochemical cell formed the uric acid level sensor, a gold-coated four-electrode conductivity sensor and a semiconductor temperature sensor. The measurement of the ambient temperature was required for the calibration process, as most of the measuring parameters were temperature-sensitive.
The readout circuits were the next layer of the system. The potentiometric readout circuit was connected to the pH and Ca 2+ sensors via a selector relay. The uric acid level was measured by an amperometric readout circuit connected to an electrochemical cell. The conductivity sensor was connected to a multi-frequency conductometric readout circuit for the measurement of conductivity.
The digital backend was the next layer of system that controlled the whole system's operation, as well as digitizing the analog output of the readout circuits. Calibration, including temperature compensation and linearization, was performed digitally in the microcontroller.
The last layer, the single-board computer, communicated with the microcontroller to collect the measured data and send the user commands, as well as configuration and setting parameters. It had the local database for the storage of measured data. Its local HTML server provided a GUI that allowed the user to connect with the system via a smart phone, laptop or computer. It also provided Wi-Fi connectivity as an access point in the absence of an Internet connection. The synchronization of data between the local database and the centralized database in the cloud would be executed whenever an Internet connection was available. The block diagram of the system is shown in Figure 4. There were four layers in the system. The sensor layer included an ISFET sensor for pH measurement, an EEGFET sensor for measuring the Ca 2+ concentration, an electrochemical cell formed the uric acid level sensor, a gold-coated four-electrode conductivity sensor and a semiconductor temperature sensor. The measurement of the ambient temperature was required for the calibration process, as most of the measuring parameters were temperature-sensitive.
The readout circuits were the next layer of the system. The potentiometric readout circuit was connected to the pH and Ca 2+ sensors via a selector relay. The uric acid level was measured by an amperometric readout circuit connected to an electrochemical cell. The conductivity sensor was connected to a multi-frequency conductometric readout circuit for the measurement of conductivity.
The digital backend was the next layer of system that controlled the whole system's operation, as well as digitizing the analog output of the readout circuits. Calibration, including temperature compensation and linearization, was performed digitally in the microcontroller. Electronics 2020, 9, x FOR PEER REVIEW 6 of 18 The system was energized by a 5V rechargeable power bank with multiple USB power connectors. The power bank had enough capacity for operation of the whole system during testing, setting, calibration and data synchronization.

Potentiometric Readout Circuit
This readout circuit was used for measuring the pH and Ca 2+ concentrations through the ISFET and EEGFET sensors. Such a sensor has an output related to ion activity once it is biased in the linear region, as the voltage and current should remain constant with a predefined value during the test: Equation (1) is the conventional model of a MOSFET device in a linear region, where IDS is the drain-source current, VGS is the gate-source voltage, VDS is the drain-source voltage, µn is the mobility of electron carriers in the semiconductor layer, W and L are the width and length of the channel, respectively and VTH is the threshold voltage. While in the regular MOSFET model the threshold voltage is constant, Equation (2) shows that in the ISFET and EEGFET, the threshold voltage consists of two components: where VTH(ISFET) is overall threshold voltage of the sensor, VTH(MOSFET) is the inherent MOSFET structure threshold voltage and VCHEMICAL is the electrochemically induced voltage, and its value depends on ion activity and other chemical properties. By combining Equations (1) and (2) and rearranging them, we have the formula for VGS, as shown in Equation (3): In order to keep the operation of the sensor in the linear region, we should have had VDS<(VGS − VTH). Furthermore, VDS and IDS should remain constant. Satisfying these conditions allowed for the measurement of ion activities (pH and Ca 2+ concentration) through the VGS voltage variation [12]. The last layer, the single-board computer, communicated with the microcontroller to collect the measured data and send the user commands, as well as configuration and setting parameters. It had the local database for the storage of measured data. Its local HTML server provided a GUI that allowed the user to connect with the system via a smart phone, laptop or computer. It also provided Wi-Fi connectivity as an access point in the absence of an Internet connection. The synchronization of data between the local database and the centralized database in the cloud would be executed whenever an Internet connection was available.
The system was energized by a 5 V rechargeable power bank with multiple USB power connectors. The power bank had enough capacity for operation of the whole system during testing, setting, calibration and data synchronization.

Potentiometric Readout Circuit
This readout circuit was used for measuring the pH and Ca 2+ concentrations through the ISFET and EEGFET sensors. Such a sensor has an output related to ion activity once it is biased in the linear region, as the voltage and current should remain constant with a predefined value during the test: Equation (1) is the conventional model of a MOSFET device in a linear region, where I DS is the drain-source current, V GS is the gate-source voltage, V DS is the drain-source voltage, µ n is the mobility of electron carriers in the semiconductor layer, W and L are the width and length of the channel, respectively and V TH is the threshold voltage. While in the regular MOSFET model the threshold voltage is constant, Equation (2) shows that in the ISFET and EEGFET, the threshold voltage consists of two components: where V TH(ISFET) is overall threshold voltage of the sensor, V TH(MOSFET) is the inherent MOSFET structure threshold voltage and V CHEMICAL is the electrochemically induced voltage, and its value Electronics 2020, 9, 2180 7 of 18 depends on ion activity and other chemical properties. By combining Equations (1) and (2) and rearranging them, we have the formula for V GS , as shown in Equation (3): In order to keep the operation of the sensor in the linear region, we should have had V DS < (V GS − V TH ). Furthermore, V DS and I DS should remain constant. Satisfying these conditions allowed for the measurement of ion activities (pH and Ca 2+ concentration) through the V GS voltage variation [12].
The circuit in Figure 5 acted as a floating bridge, constant-voltage constant-current source. This configuration allowed for the measurement of each ISFET and EEGFET sensor in the array by simply switching to the drain or source while the reference electrode remained connected to the ground. The circuit in Figure 5 acted as a floating bridge, constant-voltage constant-current source. This configuration allowed for the measurement of each ISFET and EEGFET sensor in the array by simply switching to the drain or source while the reference electrode remained connected to the ground. In the circuit of Figure 5, VDS equaled the voltage drop across R2, and IDS equaled the current passing through R3. In order to keep those values constant, a feedback from the output voltage was added to the fixed reference voltage and fed through the V1 point. This configuration kept the voltage difference between V1 and Vout constant and equal to Vref during the measurement.

Amperometric Readout Circuit
The amperometric circuit is shown in Figure 6. In order to measure the uric acid concentration, the uric acid sensor needed to be excited by a predefined oxidation voltage before dropping the urine sample on the strip. Vbias is the voltage applied to the readout circuit for generating the oxidation voltage in the sensor: The relationship between the oxidation voltage Vox and the bias voltage Vbias is shown in Equation (4). The circuit was a simplified version of the work presented in [13]. Refer to the schematic diagram in Figure 6. The op-amp regulated the M3 gate voltage in such a way that the voltage in the reference electrode (RE) became equal to Vbias. The oxidation voltage Vox was applied between the working electrode (WE) and the RE. The presence of a urine sample on sensor strip, combined with the applied oxidation voltage, created the sensor current iSensor. The same In the circuit of Figure 5, V DS equaled the voltage drop across R 2 , and I DS equaled the current passing through R 3 . In order to keep those values constant, a feedback from the output voltage was added to the fixed reference voltage and fed through the V 1 point. This configuration kept the voltage difference between V 1 and V out constant and equal to V ref during the measurement.

Amperometric Readout Circuit
The amperometric circuit is shown in Figure 6. In order to measure the uric acid concentration, the uric acid sensor needed to be excited by a predefined oxidation voltage before dropping the urine sample on the strip. V bias is the voltage applied to the readout circuit for generating the oxidation voltage in the sensor: Electronics 2020, 9, x FOR PEER REVIEW 7 of 18 The circuit in Figure 5 acted as a floating bridge, constant-voltage constant-current source. This configuration allowed for the measurement of each ISFET and EEGFET sensor in the array by simply switching to the drain or source while the reference electrode remained connected to the ground. In the circuit of Figure 5, VDS equaled the voltage drop across R2, and IDS equaled the current passing through R3. In order to keep those values constant, a feedback from the output voltage was added to the fixed reference voltage and fed through the V1 point. This configuration kept the voltage difference between V1 and Vout constant and equal to Vref during the measurement.

Amperometric Readout Circuit
The amperometric circuit is shown in Figure 6. In order to measure the uric acid concentration, the uric acid sensor needed to be excited by a predefined oxidation voltage before dropping the urine sample on the strip. Vbias is the voltage applied to the readout circuit for generating the oxidation voltage in the sensor: The relationship between the oxidation voltage Vox and the bias voltage Vbias is shown in Equation (4). The circuit was a simplified version of the work presented in [13]. Refer to the schematic diagram in Figure 6. The op-amp regulated the M3 gate voltage in such a way that the voltage in the reference electrode (RE) became equal to Vbias. The oxidation voltage Vox was applied between the working electrode (WE) and the RE. The presence of a urine sample on sensor strip, combined with the applied oxidation voltage, created the sensor current iSensor. The same current passed through the drain-source M3 and M1. M1 and M2 formed a current mirror. By choosing M1 and M2 values identical the output current, iOUT became equal to iSensor: The relationship between the oxidation voltage V ox and the bias voltage V bias is shown in Equation (4). The circuit was a simplified version of the work presented in [13].
Electronics 2020, 9, 2180 8 of 18 Refer to the schematic diagram in Figure 6. The op-amp regulated the M 3 gate voltage in such a way that the voltage in the reference electrode (RE) became equal to V bias . The oxidation voltage V ox was applied between the working electrode (WE) and the RE. The presence of a urine sample on sensor strip, combined with the applied oxidation voltage, created the sensor current i Sensor . The same current passed through the drain-source M 3 and M 1 . M 1 and M 2 formed a current mirror. By choosing M 1 and M 2 values identical the output current, i OUT became equal to i Sensor : The current passed through R out and created the output voltage proportional to the sensor current, as shown in Equation (5). The measurement of the current was time-sensitive, as the sensor current increased sharply after dropping of the sample and decayed exponentially. The sharp rise of the current, considered as the reference time and actual current measurement, should be performed after a specific delay. There was a trade-off in selecting the delay; a shorter delay caused measuring during an unstable transient time, while a long delay reduced the accuracy due to the decay of the sensor current.
The sensor current measured after a proper delay was proportional to the uric acid concentration in the sample. The complex process of timing and calibration was performed by a digital microcontroller, while the readout circuit applied the oxidation voltage and converted the sensor current to a measurable voltage for the ADC.

Conductometric Readout Circuit
The conductivity readout circuit consisted of three signal conditioning sections, as shown in Figure 7. The first section converted the received digital pulse width modulation (PWM) signal from the microcontroller to a sinusoidal constant current. The second section received the input signal from the sensor voltage electrodes, and it would be connected to the microcontroller ADC input after amplification and filtering. The third section was similar to the second section, except it received its input signal from a shunt resistor in a series with the sensor current feed circuit. The impedance measurement was performed by dividing the root mean square (RMS) value of the voltage by the current.
Electronics 2020, 9, x FOR PEER REVIEW 8 of 18 The current passed through Rout and created the output voltage proportional to the sensor current, as shown in Equation (5). The measurement of the current was time-sensitive, as the sensor current increased sharply after dropping of the sample and decayed exponentially. The sharp rise of the current, considered as the reference time and actual current measurement, should be performed after a specific delay. There was a trade-off in selecting the delay; a shorter delay caused measuring during an unstable transient time, while a long delay reduced the accuracy due to the decay of the sensor current.
The sensor current measured after a proper delay was proportional to the uric acid concentration in the sample. The complex process of timing and calibration was performed by a digital microcontroller, while the readout circuit applied the oxidation voltage and converted the sensor current to a measurable voltage for the ADC.

Conductometric Readout Circuit
The conductivity readout circuit consisted of three signal conditioning sections, as shown in Figure 7. The first section converted the received digital pulse width modulation (PWM) signal from the microcontroller to a sinusoidal constant current. The second section received the input signal from the sensor voltage electrodes, and it would be connected to the microcontroller ADC input after amplification and filtering. The third section was similar to the second section, except it received its input signal from a shunt resistor in a series with the sensor current feed circuit. The impedance measurement was performed by dividing the root mean square (RMS) value of the voltage by the current. The system measured the impedance in several frequencies, and the linear regression line of the impedances in different frequencies was calculated. As shown in Figure 8, the Y-intercept of the linear regression (at zero frequency) was the sample resistance. The conductance was obtained by inversing the resistance, and after multiplying it by the cell constant, the conductivity would be calculated. The system measured the impedance in several frequencies, and the linear regression line of the impedances in different frequencies was calculated. As shown in Figure 8, the Y-intercept of the linear Electronics 2020, 9, 2180 9 of 18 regression (at zero frequency) was the sample resistance. The conductance was obtained by inversing the resistance, and after multiplying it by the cell constant, the conductivity would be calculated.

Digital Control
The digital back end of the system was a 32-bit Cortex-M0+ ARM ® microcontroller. It had an 8-channel 12-bit successive approximation register (SAR) ADC with a conversion rate up to 1 MSPS. It controlled the whole process of measurement, calibration and adjustment while performing communication with the local server to record the results in the database. Figure 9 shows the connection between the digital control module and the readout circuits.

Communication
The digital system used American Standard Code for Information Interchange (ASCII) communication with the local server through universal asynchronous receiver-transmitter (UART) ports. It received a few commands as single-character inputs and sent data out through ASCII messages. Figure 10 shows the communication block of the digital system.

Digital Control
The digital back end of the system was a 32-bit Cortex-M0+ ARM ® microcontroller. It had an 8-channel 12-bit successive approximation register (SAR) ADC with a conversion rate up to 1 MSPS. It controlled the whole process of measurement, calibration and adjustment while performing communication with the local server to record the results in the database. Figure 9 shows the connection between the digital control module and the readout circuits.

Communication
The digital system used American Standard Code for Information Interchange (ASCII) communication with the local server through universal asynchronous receiver-transmitter (UART) ports. It received a few commands as single-character inputs and sent data out through ASCII messages. Figure 10 shows the communication block of the digital system.

Analog-To-Digital Converter (ADC)
Six channels of the ADC were used for measuring different parameters in the system, as shown in Figure 11. Three channels of the ADC were time-insensitive. Measuring the voltage from the temperature sensor and the output of the potentiometric readout circuit for pH and Ca 2+ concentrations was straight forward. The conductivity readout circuit had two sinusoidal outputs proportional to the voltage and current of the conductivity sensor. These sine waves needed to be sampled every 4 uSec alternatively. The amperometric readout circuit output voltage and bias voltage feedback were sampled by the ADC every 100 mSec. The conductivity and amperometric output signal measurements were time-sensitive, so both the timing and the ADC resolution contributed to the accuracy of the measurement.

Adjustable Bias Voltage Generator
The digital system generated a PWM, signal shown in Figure 12, which was used by the amperometric readout circuit as a bias voltage after passing it through a low-pass filter. This bias voltage determined the oxidation voltage applied to the uric acid biosensor. Therefore, it should be adjustable, and this would be applied by the digital system through adjusting the duty cycle of the PWM signal.

Analog-to-Digital Converter (ADC)
Six channels of the ADC were used for measuring different parameters in the system, as shown in Figure 11. Three channels of the ADC were time-insensitive. Measuring the voltage from the temperature sensor and the output of the potentiometric readout circuit for pH and Ca 2+ concentrations was straight forward. The conductivity readout circuit had two sinusoidal outputs proportional to the voltage and current of the conductivity sensor. These sine waves needed to be sampled every 4 us alternatively. The amperometric readout circuit output voltage and bias voltage feedback were sampled by the ADC every 100 ms. The conductivity and amperometric output signal measurements were time-sensitive, so both the timing and the ADC resolution contributed to the accuracy of the measurement.

Analog-To-Digital Converter (ADC)
Six channels of the ADC were used for measuring different parameters in the system, as shown in Figure 11. Three channels of the ADC were time-insensitive. Measuring the voltage from the temperature sensor and the output of the potentiometric readout circuit for pH and Ca 2+ concentrations was straight forward. The conductivity readout circuit had two sinusoidal outputs proportional to the voltage and current of the conductivity sensor. These sine waves needed to be sampled every 4 uSec alternatively. The amperometric readout circuit output voltage and bias voltage feedback were sampled by the ADC every 100 mSec. The conductivity and amperometric output signal measurements were time-sensitive, so both the timing and the ADC resolution contributed to the accuracy of the measurement.

Adjustable Bias Voltage Generator
The digital system generated a PWM, signal shown in Figure 12, which was used by the amperometric readout circuit as a bias voltage after passing it through a low-pass filter. This bias voltage determined the oxidation voltage applied to the uric acid biosensor. Therefore, it should be adjustable, and this would be applied by the digital system through adjusting the duty cycle of the PWM signal.

Adjustable Bias Voltage Generator
The digital system generated a PWM, signal shown in Figure 12, which was used by the amperometric readout circuit as a bias voltage after passing it through a low-pass filter. This bias voltage determined the oxidation voltage applied to the uric acid biosensor. Therefore, it should be adjustable, and this would be applied by the digital system through adjusting the duty cycle of the PWM signal.

Analog-To-Digital Converter (ADC)
Six channels of the ADC were used for measuring different parameters in the system, as shown in Figure 11. Three channels of the ADC were time-insensitive. Measuring the voltage from the temperature sensor and the output of the potentiometric readout circuit for pH and Ca 2+ concentrations was straight forward. The conductivity readout circuit had two sinusoidal outputs proportional to the voltage and current of the conductivity sensor. These sine waves needed to be sampled every 4 uSec alternatively. The amperometric readout circuit output voltage and bias voltage feedback were sampled by the ADC every 100 mSec. The conductivity and amperometric output signal measurements were time-sensitive, so both the timing and the ADC resolution contributed to the accuracy of the measurement.

Adjustable Bias Voltage Generator
The digital system generated a PWM, signal shown in Figure 12, which was used by the amperometric readout circuit as a bias voltage after passing it through a low-pass filter. This bias voltage determined the oxidation voltage applied to the uric acid biosensor. Therefore, it should be adjustable, and this would be applied by the digital system through adjusting the duty cycle of the PWM signal.

Sine Wave Generator
In the conductivity readout circuit, the sine wave was generated by filtering a quasi-square signal. This signal was made from two PWM signals, shown in Figure 13, provided by the digital system. The signals passed through the level shifter, analog filters and V-to-I circuit and became the sinusoidal current applied to the conductivity sensor.

Sine Wave Generator
In the conductivity readout circuit, the sine wave was generated by filtering a quasi-square signal. This signal was made from two PWM signals, shown in Figure 13, provided by the digital system. The signals passed through the level shifter, analog filters and V-to-I circuit and became the sinusoidal current applied to the conductivity sensor. Figure 13. Base PWM signals for generating a sine wave in the conductivity readout circuit.

Local Server
The local server was a Raspberry Pi ® Model 3B single-board computer. It had a Wi-Fi module that allowed connection to the Internet and served as an access point in the absence of Internet access. Although, in addition to Wi-Fi, the wired Ethernet connection also could be used; however, the Wi-Fi was preferred since it allowed communication while avoiding exposing the internal circuitry to the clinical and hospital environment.

Database
The measurement data and other related information would be stored in a database. Each system kept a copy of database in its local server. Whenever the system connected to the Internet, then it would synchronize the local database with the main database in the cloud. This allowed the simultaneous automatic collection of accurate data and information from a large group of patients and healthy individuals in a wide geographic area. Furthermore, the design of the database considered the privacy of individuals. Although the gender and date of birth of the patients was required, the storage data masked the link between them and the patients' personal information. The database had three tables, as shown in Figure 14. Due to legal requirements and ethical rules for the privacy of patients, storing patients' personal data was not allowed. Each patient would be assigned a unique reference code by authorized personnel to hide their personal data. The patient reference code would be related to the patient ID in this table through a one-to-one relation. The patient ID served as the index and primary key of the patients table. The patients' date of birth (DOB) and gender were also recoded in this table. Although DOB and gender were personal data of patient, since it was recorded anonymously, it would not violate the privacy of the patients. Figure 15 shows the structure of the patient table.

Local Server
The local server was a Raspberry Pi ® Model 3B single-board computer. It had a Wi-Fi module that allowed connection to the Internet and served as an access point in the absence of Internet access. Although, in addition to Wi-Fi, the wired Ethernet connection also could be used; however, the Wi-Fi was preferred since it allowed communication while avoiding exposing the internal circuitry to the clinical and hospital environment.

Database
The measurement data and other related information would be stored in a database. Each system kept a copy of database in its local server. Whenever the system connected to the Internet, then it would synchronize the local database with the main database in the cloud. This allowed the simultaneous automatic collection of accurate data and information from a large group of patients and healthy individuals in a wide geographic area. Furthermore, the design of the database considered the privacy of individuals. Although the gender and date of birth of the patients was required, the storage data masked the link between them and the patients' personal information. The database had three tables, as shown in Figure 14.

Sine Wave Generator
In the conductivity readout circuit, the sine wave was generated by filtering a quasi-square signal. This signal was made from two PWM signals, shown in Figure 13, provided by the digital system. The signals passed through the level shifter, analog filters and V-to-I circuit and became the sinusoidal current applied to the conductivity sensor. Figure 13. Base PWM signals for generating a sine wave in the conductivity readout circuit.

Local Server
The local server was a Raspberry Pi ® Model 3B single-board computer. It had a Wi-Fi module that allowed connection to the Internet and served as an access point in the absence of Internet access. Although, in addition to Wi-Fi, the wired Ethernet connection also could be used; however, the Wi-Fi was preferred since it allowed communication while avoiding exposing the internal circuitry to the clinical and hospital environment.

Database
The measurement data and other related information would be stored in a database. Each system kept a copy of database in its local server. Whenever the system connected to the Internet, then it would synchronize the local database with the main database in the cloud. This allowed the simultaneous automatic collection of accurate data and information from a large group of patients and healthy individuals in a wide geographic area. Furthermore, the design of the database considered the privacy of individuals. Although the gender and date of birth of the patients was required, the storage data masked the link between them and the patients' personal information. The database had three tables, as shown in Figure 14. Due to legal requirements and ethical rules for the privacy of patients, storing patients' personal data was not allowed. Each patient would be assigned a unique reference code by authorized personnel to hide their personal data. The patient reference code would be related to the patient ID in this table through a one-to-one relation. The patient ID served as the index and primary key of the patients table. The patients' date of birth (DOB) and gender were also recoded in this table. Although DOB and gender were personal data of patient, since it was recorded anonymously, it would not violate the privacy of the patients. Figure 15 shows the structure of the patient table. Due to legal requirements and ethical rules for the privacy of patients, storing patients' personal data was not allowed. Each patient would be assigned a unique reference code by authorized personnel to hide their personal data. The patient reference code would be related to the patient ID in this table through a one-to-one relation. The patient ID served as the index and primary key of the patients table. The patients' date of birth (DOB) and gender were also recoded in this table. Although DOB and gender were personal data of patient, since it was recorded anonymously, it would not violate the privacy of the patients. Figure 15 shows the structure of the patient table. Electronics 2020, 9, x FOR PEER REVIEW 12 of 18 The samples table, shown in Figure 16, recorded each measurement of the specific sample from the patient. The measured data would be recorded from the hardware device directly. The temperature was always recorded with each measurement. The sample collection date and measurement time would be stored, too. The brief description of each field in the database samples table is shown in Table 1.

Machine Learning Process
Basically, logistic regression is a typical supervised machine learning classification algorithm. It takes the features as input and calculates the probability that an observation belongs to a certain class by using a logistic function. The theoretical intuition behind this is the maximum likelihood estimation. Compared with other popular classification algorithms such as support vector machines (SVMs), whose classification results only rely on the support vectors, logistic regression is more robust to outliers, because all samples contribute to the classifier to maximize the likelihood. Additionally, logistic regression has the advantage of obtaining the classification probability, being easy to implement and having a low computational cost. However, all machine learning models have the problem of underfitting and overfitting (bias variance trade-off), so they can make mistakes. To solve this problem, we considered adding some regularization terms (L1 reg or L2 reg) to obtain good results in practice. The samples table, shown in Figure 16, recorded each measurement of the specific sample from the patient. The measured data would be recorded from the hardware device directly. The temperature was always recorded with each measurement. The sample collection date and measurement time would be stored, too. The samples table, shown in Figure 16, recorded each measurement of the specific sample from the patient. The measured data would be recorded from the hardware device directly. The temperature was always recorded with each measurement. The sample collection date and measurement time would be stored, too. The brief description of each field in the database samples table is shown in Table 1.

Machine Learning Process
Basically, logistic regression is a typical supervised machine learning classification algorithm. It takes the features as input and calculates the probability that an observation belongs to a certain class by using a logistic function. The theoretical intuition behind this is the maximum likelihood estimation. Compared with other popular classification algorithms such as support vector machines (SVMs), whose classification results only rely on the support vectors, logistic regression is more robust to outliers, because all samples contribute to the classifier to maximize the likelihood. Additionally, logistic regression has the advantage of obtaining the classification probability, being easy to implement and having a low computational cost. However, all machine learning models have the problem of underfitting and overfitting (bias variance trade-off), so they can make mistakes. To solve this problem, we considered adding some regularization terms (L1 reg or L2 reg) to obtain good results in practice. The brief description of each field in the database samples table is shown in Table 1.

Machine Learning Process
Basically, logistic regression is a typical supervised machine learning classification algorithm. It takes the features as input and calculates the probability that an observation belongs to a certain class by using a logistic function. The theoretical intuition behind this is the maximum likelihood estimation. Compared with other popular classification algorithms such as support vector machines (SVMs), whose classification results only rely on the support vectors, logistic regression is more robust to outliers, because all samples contribute to the classifier to maximize the likelihood. Additionally, logistic regression has the advantage of obtaining the classification probability, being easy to implement and having a low computational cost. However, all machine learning models have the problem of underfitting and overfitting (bias variance trade-off), so they can make mistakes. To solve this problem, we considered adding some regularization terms (L1 reg or L2 reg) to obtain good results in practice.
The desired output from the system was a binary result, whether the person was a potential stone-former or not. Although the data set from the test results generated by the system could be used with different model development techniques, logistics regression was selected for this work.
Compared with other modeling approaches, logistics regression was more suitable for binary outputs. Four measured parameters in the urine sample of an individual along with age and gender formed the input vector. Figure 17 shows the input and output of the model. The desired output from the system was a binary result, whether the person was a potential stone-former or not. Although the data set from the test results generated by the system could be used with different model development techniques, logistics regression was selected for this work. Compared with other modeling approaches, logistics regression was more suitable for binary outputs. Four measured parameters in the urine sample of an individual along with age and gender formed the input vector. Figure 17 shows the input and output of the model. In logistics regression modeling, the log odds of the output will be the linear combination of the inputs. Equation (6) shows the inputs as a vector column (vector X) with six elements: Where y is the output with a binary value. If the individual is a stone-former, the value of y = 1, and if the individual is not stone-former, y = 0. Then, as shown in Equation (7), the p(X) is the probability of an individual being a stone-former with the urine sample measurement results, gender and age defined by X: In the logistics regression model, the log odds of the output is a linear combination of the input, as in shown in Equation (8) In order to have a vector format while still accommodating the constant β0, an element 1 will be added as the first row of vector X so it becomes a 7 × 1 vector. The goal of the training phase is to find the coefficient β for the maximum likelihood estimation. Equation (9) shows the relationship in vector format: Using the gradient decent method, the coefficient β could be found by an iteration of Equation (10), while α is the learning rate and σ(x) is the sigmoid function: In logistics regression modeling, the log odds of the output will be the linear combination of the inputs. Equation (6) shows the inputs as a vector column (vector X) with six elements: Gender Age (6) where y is the output with a binary value. If the individual is a stone-former, the value of y = 1, and if the individual is not stone-former, y = 0. Then, as shown in Equation (7), the p(X) is the probability of an individual being a stone-former with the urine sample measurement results, gender and age defined by X: p X = prob y = 1 X In the logistics regression model, the log odds of the output is a linear combination of the input, as in shown in Equation (8): In order to have a vector format while still accommodating the constant β 0 , an element 1 will be added as the first row of vector X so it becomes a 7 × 1 vector. The goal of the training phase is to find the coefficient β for the maximum likelihood estimation. Equation (9) shows the relationship in vector format: Using the gradient decent method, the coefficient β could be found by an iteration of Equation (10), while α is the learning rate and σ(x) is the sigmoid function: The iteration would continue until β converged to the final value or until a certain number of iterations. In the testing phase and system operation as point-of-care, the p(X) would be calculated and compared with a threshold, typically 50%. If the p(X) became larger than the threshold, the urine sample under the test was from a potential stone-forming individual. Otherwise, the person had low risk to develop kidney stones.

Testing Materials and Instruments
The validation process was divided into three sections. The potentiometric readout circuit was tested using the commercial buffer solutions from Honeywell Fluka™ (Charlotte, NC, USA). Five buffer solutions-a Honeywell Fluka™ buffer solution of pH 4.0-citric acid/sodium hydroxide/sodium chloride solution with fungicide-, a buffer solution of pH 6.0-citric acid/sodium hydroxide solution with fungicide and traceable to Standard Reference Material (SRM) from National Institute of Standards and Technology (NIST)-, a buffer solution of pH 7.0-potassium dihydrogenphosphate/disodium hydrogen phosphate traceable to SRM from NIST with fungicide-, a buffer solution of pH 8.0-borax/hydrochloric acid, traceable to SRM from NIST-and a buffer solution of pH 10.0-borax/sodium hydroxide--were used for testing the system. The pH-meter model LAQUAtwin pH-11, manufactured by Horiba Ltd. (Kyoto, Japan), was calibrated according to the manufacturer instructions and used for comparing the results of the test.
For validating the performance of the amperometric sensor readout circuit, we prepared several buffer solutions. The 500 ppm (parts per million) uric acid solution was made by mixing 100uL of a pH8.5 (0.1M) NaPB buffer with 50mg of uric acid powder. The 400 ppm uric acid solution was made by diluting 8 uL of a 500 ppm solution and 2 uL of buffer. In a similar approach, the 200 ppm solution was made as a result of the dilution of 4 uL of a 500 ppm solution with 6 uL of buffer. A solution of 100 ppm was made by diluting 2 uL of a 500 ppm solution with 8 uL of buffer. The electrochemical analyzer model CHI 600 E, manufactured by CH Instruments Inc (Austin, TX, USA),was used for validating the measured test results from the amperometric sensor readout circuit.
The performance of the conductivity readout circuit was validated using a commercial conductivity standard solution kit, model 503-S from Horiba Ltd. (Kyoto, Japan). The kit included potassium chloride (KCl) buffer solutions, with a conductivity range between 84 uS/cm and 111.8 mS/cm. The conductivity meter, model LAQUAtwin EC-33, manufactured by Horiba Ltd. (Kyoto, Japan) was used for comparing the results from the conductivity readout circuit.

Results and Discussion
The details of the chemical buffer solutions and instruments which were used for validating the system measurement results were discussed in Section 2. Figure 18 shows the comparison of the measurement results between our system and the commercial conductivity measurement instrument. The Horiba ® EC-33 instrument and the KCl buffer solutions were used as a reference to evaluate the conductivity measurement.
The potentiometric readout circuit was tested by measuring its output voltage and comparing it with the pH measurement from the commercial instrument, the Horiba ® pH-11. The Honeywell Fluka ® commercial buffer solutions were tested. The results curve is shown in Figure 19. Electronics 2020, 9,   The potentiometric readout circuit was tested by measuring its output voltage and comparing it with the pH measurement from the commercial instrument, the Horiba ® pH-11. The Honeywell Fluka ® commercial buffer solutions were tested. The results curve is shown in Figure 19. The uric acid concentration measurement had more complexity. A disposable sensor strip provided by Bioptik Technology Inc. was used for this measurement. A specific oxidation voltage should be provided for the sensor, and later the sample would be dropped on the strip. A sharp increase in current would be the time zero for the measurement. After a certain period of time, the measured current was proportional to the uric acid concentration in the sample.
The CH Instruments 600E electrochemical analyzer and the NaPB buffer solution were used for the comparison of measurements from the amperometric readout circuit. Figure 20 shows the sensor The potentiometric readout circuit was tested by measuring its output voltage and comparing it with the pH measurement from the commercial instrument, the Horiba ® pH-11. The Honeywell Fluka ® commercial buffer solutions were tested. The results curve is shown in Figure 19. The uric acid concentration measurement had more complexity. A disposable sensor strip provided by Bioptik Technology Inc. was used for this measurement. A specific oxidation voltage should be provided for the sensor, and later the sample would be dropped on the strip. A sharp increase in current would be the time zero for the measurement. After a certain period of time, the measured current was proportional to the uric acid concentration in the sample.
The CH Instruments 600E electrochemical analyzer and the NaPB buffer solution were used for the comparison of measurements from the amperometric readout circuit. Figure 20 shows the sensor The uric acid concentration measurement had more complexity. A disposable sensor strip provided by Bioptik Technology Inc. was used for this measurement. A specific oxidation voltage should be provided for the sensor, and later the sample would be dropped on the strip. A sharp increase in current would be the time zero for the measurement. After a certain period of time, the measured current was proportional to the uric acid concentration in the sample.
The CH Instruments 600E electrochemical analyzer and the NaPB buffer solution were used for the comparison of measurements from the amperometric readout circuit. Figure 20 shows the sensor output current versus time. The measurement of the current was time-sensitive, as the sensor current increased sharply after dropping the sample and decayed exponentially. output current versus time. The measurement of the current was time-sensitive, as the sensor current increased sharply after dropping the sample and decayed exponentially. The sharp rise of the current considered the reference of time, and actual current measurement should be performed after a specific delay. The test results of measuring the sensor current 4 s after the time reference is shown in Figure 21. Uric acid buffer solutions were used for this test.  Table 2 shows the summary of the testing range of the system compared with the typical human urine range for the same parameter. The last column shows if that parameter has the capability to be used as indicator for assessing the risk of forming kidney stones. In general, the system achieved a sensing range to accommodate the physiological range of such measurands in urine. The sharp rise of the current considered the reference of time, and actual current measurement should be performed after a specific delay. The test results of measuring the sensor current 4 s after the time reference is shown in Figure 21. Uric acid buffer solutions were used for this test.  The sharp rise of the current considered the reference of time, and actual current measurement should be performed after a specific delay. The test results of measuring the sensor current 4 s after the time reference is shown in Figure 21. Uric acid buffer solutions were used for this test.  Table 2 shows the summary of the testing range of the system compared with the typical human urine range for the same parameter. The last column shows if that parameter has the capability to be used as indicator for assessing the risk of forming kidney stones. In general, the system achieved a sensing range to accommodate the physiological range of such measurands in urine.  Table 2 shows the summary of the testing range of the system compared with the typical human urine range for the same parameter. The last column shows if that parameter has the capability to be used as indicator for assessing the risk of forming kidney stones. In general, the system achieved a sensing range to accommodate the physiological range of such measurands in urine. The next phase of our research is the utilization of actual urine samples collected from stone and non-stone formers. By using a multi-sensing approach in tandem with machine learning capability, we infer that we will achieve good correspondence with actual clinical diagnosis in the assessment of stone formation. Thus, our system can be a potent piece of technology for rapid screening and point-of-care testing application.

Conclusions
This paper presented the design and implementation of a multi-sensor platform for the measurement and data collection of four key parameters in urine samples to evaluate the risk of urolithiasis in its early stages. Verification with standard solutions has shown that our system correlates well with measurements from standard instruments. It also exhibited a sufficient sensing range to accommodate the physiological range in human urine. The fabricated on-board system will be distributed to different locations to collect the data. As a future work, the system design will be adapted for the development of low cost, low power consumption, compact on-chip application to be used as a point-of-care or personal care instrument.