Internet-of-Things-based Electric Cell-substrate Impedance Sensing System

In this paper, we propose an electric cell-substrate impedance sensing system that can be accessed from the internet. The hardware specification was derived using numerical simulations and culture chamber impedance emulators, and the impedance calculation methods were compared. In addition, we propose server-type software to easily control and monitor the system from the internet. Experimental results show that it is advantageous to use an acquisition device of 50 mega samples per second or more and to calculate the impedance using a sine fitting method rather than the lock-in detection method that is generally used. During experiments, there was no problem accessing the proposed server from the outside with standard computing devices.


Introduction
Electric cell-substrate impedance spectroscopy (ECIS) can be regarded as a kind of electrical impedance spectroscopy that uses the phenomenon of increased impedance between electrodes as cell mobility increases.)(7)(8)(9)(10)(11) These cell studies using ECIS ultimately aim to improve the quality of life.For example, cytotoxicity studies can examine the health effects of workers handling toxic substances. (4)CIS is utilized to investigate the regulation of endothelial permeability, whose malfunction leads to systemic vascular leakage resulting in edema and a loss of organ function. (5,6)It has also been applied to studies on cancer progress (7,11) and on the relationship between mesenchymal stem cells and oxygen tension in mesenchymal stem cell therapy. (10)The latter has great potential for human pathology, including cardiovascular disease, neurodegenerative disease, and osteoarthritis.
In ECIS, the impedance is calculated by measuring the voltage obtained by stimulating the electrode in the cell chamber with a sinusoidal current of several µA.The complex impedance is obtained by calculating the components of the received signal that are inphase and quadrature-phase with the stimulus signal.Typically, analog lock-in amplifiers are used, or two signals are digitally acquired and then calculated using digital signal processing (DSP). (12,13)(16) With DSP, sinusoidal fittings can also be applied to impedance calculations.The calculation method takes much more computation time than the lock-in detection method. (17,18)However, it is difficult to find studies on performance comparisons between the lock-in detection and sine function fitting methods.
Typical versatile impedance measurement instruments, such as lock-in amplifiers and frequency or network analyzers, require considerable space and are not easy to control. (14)In recent years, a number of high-performance USB oscilloscopes have been developed and can be used to address space issues.These USB oscilloscopes also have built-in function generators, making them suitable for ECIS applications.Because software development kits (SDKs) are provided for most computing platforms, significant cost and space can be saved by controlling the oscilloscope with a single-board computer (SBC).SBCs are being actively developed and only cost a few dozens of dollars.Recently released SBCs include flexible networking capabilities, making it easy to implement ECIS in the Internet-of-Things (IoT) format. (19)hen ECIS is implemented in the IoT format, many benefits arise beyond the basic benefits of IoT.The web-based user interface allows the users to control and monitor their system without a standard input/output device such as a monitor or keyboard/mouse.This reduces the system cost as well as the installation space, making it easier to install in the already established laboratory.In addition, it is possible to prevent inadvertent input that could be caused by easy access to the input/output device.Users can monitor and discuss experimental situations on their own or with colleagues anytime and anywhere using standardized computing devices such as PCs and smart devices.These time-saving and convenience advantages are more notable in equipment such as ECIS systems, where experiments are conducted for several days.
In this paper, we propose an IoT-based ECIS system using a USB oscilloscope.System parameters, such as the amplification factor, signal sampling rate, and impedance calculation method, are determined through numerical simulation and experiments with an impedance emulator in cell culture chambers.We also discuss qualitatively the software architecture that can control and monitor the system via the internet.

IoT-based ECIS system
The proposed IoT-based ECIS system consists of an analog front end (AFE) with a USB oscilloscope and an SBC as shown in Fig. 1.The AFE is connected to the SBC via the USB interface, and the SBC is connected to the internet via a wired or wireless network.The SBC software controls the AFE according to incoming commands through the internet, measures the impedance, and sends it to the requested site.
The AFE generates a 1 V pp sine wave using a function generator built into the USB oscilloscope and stimulates one of the eight cell culture chambers through a 1 MΩ resistor (Fig. 2).Therefore, the current flowing in the chamber is less than 1 μA, enabling noninvasive detection. (3)The USB oscilloscope was adopted after considering the numerical simulation results and system efficiency (Analog Discovery 2, Digilent Inc., USA).In addition to the function generator, the adopted oscilloscope provides a power supply of ±5 V and digital output ports to control the bias voltage of the amplifier and the selection of the analog multiplexer.

Determination of design parameters
The parameters to be determined in the AFE were the type of amplifier, the number of samples per period, and the impedance calculation method.The specifications for the amplifier were determined by a literature review.The number of samples per cycle was an important factor for selecting an oscilloscope.To determine the number of samples, an emulator reproducing the impedances of the culture chambers with resistors and capacitors was fabricated and tested along with a numerical simulation.The impedance of each culture chamber was modeled with a serial connection of one of the resistors with a value ranging from 1 to 8 kΩ and a 10 nF capacitor. (3)Figure 3 shows an example in which a 1 kΩ resistor and a 10 nF capacitor are connected in series and a circuit emulating the impedance of a chamber is connected to the multiplexer in Fig. 2.
The literature was reviewed to determine the specifications of the amplifier.In most studies, the frequency of the stimulation current was no higher than 100 kHz and the culture cell resistance was less than 50 kΩ. (16)The gain was chosen to be 100 so that the amplifier would not saturate when chambers with maximum impedances were measured.On the basis of the maximum frequency and selected gain, we chose an amplifier with a gain bandwidth greater than 10 MHz.We also chose an amplifier with low input offset current and voltage because the stimulus current was less than 1 μA.
If the number of samples per cycle is very small, the measurement error due to noise increases, so the amount of noise is the most important factor for determining the number of samples per cycle.Because the one with the lowest impedance among the chamber emulators had the worst signal-to-noise ratio, the voltage received from that was measured to determine the amount of noise.In previous studies, lock-in detection was mainly used for impedance calculation, but examples using the sine fitting method for measuring DNA concentration or impedance around neurons appeared. (17,18)Figure 4 is a block diagram of culture chambers connected in a certain manner to explain the impedance calculation.In the figure, s(t) and r(t) are the stimulus and received signals, respectively.The received signal is the voltage divided by the series connection of the chamber impedance, which consists of the resistor r and the capacitor c, and the resistor R (1 MΩ) to limit the current.That is, the following equation is satisfied: where z, g, j, and ω are the complex gain, the amplifier gain, the imaginary unit, and the angular frequency, respectively.The chamber impedance can be derived from Eq. (1) by measuring the complex gain z.The complex gain is usually measured by the lock-in detection method described by 0 Re( ) ( ) ( ) where Re(•) and Im(•) are the real and imaginary parts of the complex gain z, respectively, and 2π ω T = .
On the other hand, complex gains can be obtained by fitting sine functions to both s(t) and r(t).Using the nonlinear least squares method, we can obtain the amplitude and phase that minimize Eq. (3).For example, to estimate the amplitude and phase of the stimulus signal, the following equation can be minimized: Fig. 3. Emulation circuit for a culture chamber connected to the multiplexer shown in Fig. 2.
where e, A, and ϕ are the fitting error, the estimated amplitude, and the estimated phase, respectively.
The amplitude and phase of the complex gain can be obtained by taking the difference between the ratio of the amplitudes obtained and the phases as shown in the following equation: where A s and A r , and ϕ s and ϕ r are the estimated amplitudes and phases of s(t) and r(t), respectively.
Even if the frequency of the signal is known, the fitting method requires much more computation time than the lock-in detection method.However, because the calculation period of the ECIS system is several minutes and the IoT-based system needs only to perform basic functions, i.e., impedance estimation, the computation is not a big issue.Therefore, if there is a difference in noise performance, it would be advantageous to choose a noise-robust method regardless of the computational burden.

Software architecture
The oscilloscope adopted in this study provides a SDK for Windows and Linux operating systems.Therefore, it can be operated using an SBC with either of the two operating systems.As the Python SDK, which is a platform independent language, is also provided, we developed the program in Python on a relatively inexpensive Linux SBC.The program was developed in the form of a server so that control and monitoring could be done over the internet.We use RPyC, a Python library for distributed computing, for internet access.
The ECIS system should be capable of measuring and recording the impedance at the user's request.The user's primary concern is to see the change in current impedance or the impedance change recorded in the previous experiment.The recorded and visualized data will be stored and analyzed in the cloud in the future, so it is better to implement the system in an independent program rather than in the server.Because the proposed system was of the IoT type, it focused only on impedance measurements.
Figure 5 shows the functions and data flow.All functions can be accessed independently via the internet.We also implemented both methods for impedance calculations.Even the lowest level functions can be accessed on the internet, enabling remote monitoring, maintenance, and upgrades, which are basic functions of IoT.This system was accessed and tested using Jupyter Notebook and applied to the experiments to obtain the design parameters discussed in the previous section.

Determination of the number of samples per cycle by numerical simulation
Using Matlab, the standard deviation of the Gaussian noise mixed with a sine function of amplitude "1" was increased and the estimation error according to the number of samples per cycle was analyzed.Because the fitting and lock-in detection methods showed similar performance characteristics, simulations were carried out using the fitting method.Figure 6 shows the trend in the mean absolute error of the estimated amplitude of the received signal according to the number of samples per cycle.The phase error was negligible compared with the amplitude error.Note that the mean absolute error is the same as the mean relative absolute error because the signal amplitude is unity.From the lower curve, the standard deviations of the Gaussian noise are 0.1, 0.2, and 0.3, respectively.For the mean absolute error to be less than 1%, about 500 samples/cycle should be taken when the standard deviation is 0.2, and more than 1000 samples/cycle when it is 0.3.
We measured the amount of noise in the chamber with the smallest resistance in the emulator (chamber with a 1 kΩ resistor and a 10 nF capacitor in series), because the chamber  with the lowest impedance has the largest amount of noise compared with the signal amplitude.

Lock-in detection
Figure 7 shows the difference between the received signal and the fitted sine function.The amplitude of the fitted sine function was 0.10 and the standard deviation of the error signal was 0.019.Therefore, the relative standard deviation was 0.19.Considering this amount of noise, 500 samples/cycle were sufficient.However, it is expected that noise will be higher when the actual cell is loaded.Therefore, it is advantageous that the number of samples per cycle is much larger.In the experiment comparing the fitting and locking-in detection methods, the number of samples per cycle was fixed at 1024.Because the maximum impedance measurement frequency is 100 kHz, an acquisition system that provides more than 50 mega samples/s should be adopted to obtain 500 samples/cycle.The oscilloscope employed in this study can handle 100 mega samples/s.

Comparison of impedance calculation methods
To compare the two methods with the numerical simulation, the number of samples per cycle was fixed at 1024 as described in the previous section.Because the stimulus signal was barely influenced by noise, the standard deviation of the noise mixed in this signal was set to 0.1%.The received signal was tested 1000 times with noise with a standard deviation of 0.2.
The second and third columns in Table 1 show the averages of relative absolute errors for the fitting and lock-in detection methods, respectively.The average of the relative absolute errors was calculated using the following equation: where e r , N, Â, and A are the relative absolute error, the number of experiments, the estimated amplitude, and the true amplitude, respectively.Regardless of the method used, the average relative error was less than 1%.The last column shows the average of the relative differences between the two estimates, which is negligible.
Next, to compare the two methods using the emulator, the impedance of chamber 1 was measured 10 times with fitting and lock-in detection for each frequency selected between 2 and 100 kHz.The average of the phase differences was excluded from the analysis because it was within 1/1000 radians at all frequencies.The relative difference was calculated by subtracting the estimate obtained by fitting from that obtained by lock-in detection and dividing by their averages.The relative differences according to the frequencies are shown in Table 2.As shown in the table, the difference is always positive and the estimates obtained by the lock-in detection method are always larger; the higher the frequency, the larger the difference.This observation suggests that the two methods show different results, unlike the numerical simulation results, because the noise seems to be neither stationary nor completely random, as can be inferred from Fig. 7.
To infer which method is more accurate, the real part of the estimate obtained by each method is compared with the real part of the actual impedance.A simple instrument can measure the resistance more accurately than the capacitance, and the higher the frequency, the smaller the reactance of the capacitance.The real part of the impedance remains to consist only of resistive components.That is, if the real part of the estimate at high frequencies is close to that of the actual impedance, it can be inferred that the method is more accurate.This logic can be seen by interpreting Eq. (1).If the frequency is high, the reactance of the capacitance becomes relatively small, so the complex gain shown in Eq. ( 1) can be approximated as follows (the reactance of the capacitor is reduced to within 1% of the resistance of 1 MΩ above 16 kHz): As shown in Eq. ( 6), the real part of the complex gain consists only of resistors and the gain of the amplifier.Because the gain of the amplifier can be known accurately by measuring only the resistance, the real part can be detected with a relatively simple resistance measurement.
The curve shown as ʻideal' in Fig. 8 is the result of calculating the real part of the complex gain by measuring resistances and substituting 10 nF for the capacitor value.The real parts calculated by the fitting and lock-in detection methods are marked ʻ○' and ʻ+', respectively.At low frequencies (<16 kHz), it is difficult to determine which method is more accurate because the reactance of the capacitance is marked.At high frequencies, however, the closer to the ʻideal' curve, the closer to the true value.From this observation, it can be inferred that the fitting method is more accurate than the lock-in detection method.

Verification of server operation
The experiment using the emulator was performed by installing the server on a Windows PC and controlling the server with Jupyter Notebook.To verify all the functions, data was taken by the sampling function, which is a lower-level function, impedance calculations were performed with Python and Matlab, and the results were compared with the value of the impedance calculation by the server.
The server access experiments using Jupyter Notebook were performed using a PC or smartphone outside the area where the system was installed.Experimental results show that there is no problem connecting, controlling, and monitoring the system.

Conclusions
In this paper, we propose an ECIS system that can control and monitor experiments remotely via the internet.Numerical simulations and experiments with the emulator of culture chambers were used to determine the hardware specifications and to compare impedance calculation methods.Experimental results show that the acquisition system requires more than 50 mega samples/s and that the fitting method is more advantageous than the lock-in detection method generally used.The proposed system can be accessed anywhere using standard computing devices such as a PC or a smart device.Because the ECIS system has a long measurement interval and requires a long time, there are various advantages when it is converted into the IoT form.It can be installed in the laboratory and can monitor experiments anytime and anywhere, and the information can be shared with colleagues.In addition, because there is no monitor or keyboard/mouse to be installed in the laboratory as the user interface, the space required for the device can be reduced and inadvertent input can be prevented.The proposed system can be applied to other measurement systems of similar characteristics.

Fig. 5 .
Fig. 5. Software functions and data flow.Fig.6. (Color online) Mean absolute error of the amplitude estimate according to the number of samples per cycle.

Fig. 6 .
Fig. 5. Software functions and data flow.Fig.6. (Color online) Mean absolute error of the amplitude estimate according to the number of samples per cycle.

Fig. 7 .
Fig. 7. (Color online) Error signal when the sine function is fitted to the signal received in the chamber with the smallest impedance in the emulator.

Fig. 8 .
Fig. 8. (Color online) Variation of the real part of the impedance with frequency.

Table 1
Averages of relative absolute errors for fitting and lock-in detection, and the relative estimation difference between both methods.

Table 2
Average relative difference between amplitude estimates of the fitting and lock-in detection methods.