{'fraction_non_alphanumeric': 0.027194469805660624, 'fraction_numerical': 0.01586887526629277, 'mean_word_length': 4.866981252391277, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Development of a Portable, Reliable and Low-Cost Electrical Impedance Tomography System Using an Embedded System

Electrical impedance tomography (EIT) is a useful procedure with applications in industry and medicine, particularly in the lungs and brain area. In this paper, the development of a portable, reliable and low-cost EIT system for image reconstruction by using an embedded system (ES) is introduced herein. The novelty of this article is the hardware development of a complete low-cost EIT system, as well as three simple and efficient algorithms that can be implemented on ES. The proposed EIT system applies the adjacent voltage method, starting with an impedance acquisition stage that sends data to a Raspberry Pi 4 (RPi4) as ES. To perform the image reconstruction, a user interface was developed by using GNU Octave for RPi4 and the EIDORS library. A statistical analysis is performed to determine the best average value from the samples measured by using an analog-to-digital converter (ADC) with a capacity of 30 kSPS and 24-bit resolution. The tests for the proposed EIT system were performed using materials such as metal, glass and an orange to simulate its application in food industry. Experimental results show that the statistical median is more accurate with respect to the real voltage measurement; however, it represents a higher computational cost. Therefore, the mean is calculated and improved by discarding data values in a transitory state, achieving better accuracy than the median to determine the real voltage value, enhancing the quality of the reconstructed images. A performance comparison between a personal computer (PC) and RPi4 is presented. The proposed EIT system offers an excellent cost-benefit ratio with respect to a traditional PC, taking into account precision, accuracy, energy consumption, price, light weight, size, portability and reliability. The proposed EIT system has potential application in mechanical ventilation, food industry and structural health monitoring.


Introduction
Electrical impedance tomography (EIT) is a noninvasive technique that consists in measuring an impedance array through a cross-section. This technology has been applied in many clinical applications [1][2][3], such as detection for breast cancer [4,5], nerve activity in the brain [6][7][8], respiratory disorders [9][10][11], lung function detection [12][13][14], cardiovascular monitoring [15], assessing facial nerve proximity [16]; it also has several industrial applications [17][18][19][20][21][22][23] and structural health monitoring in the construction industry [24][25][26][27][28][29][30]. The food industry also uses electrical or electrochemical impedance spectroscopy (EIS) which in simple terms is a kind of EIT by using multiple frequencies and it is used in food quality assurance to detect adulterated or polluted food, the electrical parameters of food change when they are adulterated, as well when food has a pathogen like bacteria [31][32][33][34]. The impedance of human body tissue is able to provide information about the physiological and pathological properties of the tissue, both of these properties are related to the information of medical applications [1]. EIT can be achieved by using multiple electrodes placed in a cross-section; however, this is not a mandatory and other configurations of EIT can be used. Electrodes are important components of EIT system; they must have good electrical conductivity and must be anticorrosive because an electrical current is applied through them and also used for sensing voltage. There is a research work focused on the study of electrodes, because they can be improved, for example, through sandblasting [35]. The data obtained by measuring all possible impedances is used to reconstruct an image, which may provide qualitative and quantitative information. Images of live tissues and organs can be obtained by placing electrodes on the skin and injecting a small current into the body. EIT could provide a safe and cost-effective alternative to established clinical imaging methods across a wide range of applications. However, the imaging problem is severely ill-posed (inverse problem) and ill-conditioned, which means that even relatively low noise levels in measurements could lead to significant reconstruction artifacts. In other words, the solution is highly sensitive to changes in the final data [36,37] and therefore the resulting image quality is limited [38,39].
The authors in [40] developed a highly versatile ElT system using open-source software and commercial components. The system design was shared under an open-source license and uses electronic modules and a personal computer (PC) interface. Their results can be confirmed by comparing the reconstructed images with well-known literature. Field-programmable gate array (FPGA) devices have been used to develop EIT, as shown in [41,42], basically to control and execute commands for the EIT system, leveraging the advantages they offer as programmable gates. Their complexity enabled the authors to deliver high-speed and high-performance results. Other efforts are being made for EIT algorithms based on back-projection, Fourier, Gauss-Newton and variable splitting (VS) [43]. Other authors have worked on developing an approach to EIT image reconstruction based on machine-learning algorithms, proving that neural networks are useful for EIT [44]. In Reference [45], the authors propose an efficient and high-resolution EIT image reconstruction method in the framework of sparse Bayesian learning. Significant performance improvement is achieved by imposing structure-aware priors on the learning process to incorporate the prior knowledge that practical conductivity distribution maps exhibit clustered sparsity and intracluster continuity. In Reference [46], the authors propose an efficient and high-spatial-resolution algorithm for simultaneously reconstructing multiple fdEIT (Frequency-difference electrical impedance tomography) frames corresponding to inject currents with multiple frequencies. The electrical impedance tomography reconstruction problem is considered within a hierarchical Bayesian framework, where both intratask spatial clustering and intertask dependency are automatically learned and exploited in an unsupervised manner.
Other research efforts have focused on designing nine different circuits for EIT systems and comparing three different solutions using a digital signal processor (DSP) for image reconstruction, resulting in a low-cost system [47]. The use of eight silver electrodes distributed in a ring configuration to make electrical impedance measurements is reported in [48] as a methodology for locating carcinoma, together with a proposed algorithm that is used in breast models. A study employing active electrodes for lung ventilation is reported in [49], which presented an electronic system and experimental results on a human being, proving that active electrodes can be applied for human thoracic EIT. The system communicates through Ethernet to a PC or ventilator and uses an FPGA to control impedance sampling. As can be inferred, one of the many problems with working with humans is placing electrodes in a person, and in addition, electronic noise can be generated by skin, hair or sweat. With some reservations, the authors achieved good results for future medical applications of EIT.
From a hardware viewpoint, the authors in [50] developed a parallel EIT system using multiple microcontroller units (MCUs) to perform measurements and process FFTs at the same time. The system, which reaches speeds of up to 30 frames per second, was compared to a commercial one, and an error rate of only 10% was found. The authors in [51] report the development of an EIT system with an Arduino MCU and the well-known electrical impedance and Diffuse Optical Tomography Reconstruction Software (EIDORS) [52] on a PC, using Matlab to reconstruct images. The system has a resolution of 32 electrodes and each part of the system is developed on separate PCBs. They reconstruct images, but in contrast with this paper, their ADC only has a resolution of 12 Bit, their circuits and algorithms are not described in detail, and they do not perform image reconstruction on an ES. In Reference [53], the authors report an EIT system developed using an Arduino MCU, a Raspberry Pi 3 and 16 electrodes. They show that the system reconstructs images by using Python software instead of the EIDORS [52] library for Matlab. The authors in [54] present a super-resolution imaging model for EIT, with results that show better image quality using different simulated data. On that basis, in this study the EIDORS library was used to perform image reconstruction. In addition, the authors in [55] developed an EIT system that combines the reconstruction of three different images at different frequencies, with the goal of simulating a breast tumor and showing the importance of obtaining images with different frequencies to obtain better information. More recently, the authors in [56] reviewed different studies of imaging techniques, including EIT, and reported that Acute Respiratory Distress Syndrome (ARDS) problems had only been partially resolved. The literature review leads us to assert that EIT can be employed in cases of respiratory conditions [10,[56][57][58][59][60][61]. For this reason, further research and development in EIT lung imaging is crucial.
Accordingly, one can take advantage of ES, which are very useful for solving realworld problems across various fields of application [62][63][64][65][66]. To our knowledge and based on the reviewed literature, only one study reports the use of an Raspberry Pi 3 Model B [53], and one other paper reports using an Arduino MCU [51] for the development of an EIT system. However, there are still open problems to be solved, such as the development of new methods and algorithms to improve EIT systems, because the imaging problem is severely ill-posed and ill-conditioned, which means that even relatively low noise levels in measurements could lead to significant reconstruction artifacts. Thus, in this paper an RPi4 may prove useful in developing a low-cost, portable and reliable EIT system, since it can be coded by using open-source software and is inexpensive, small and lightweight; furthermore, it performs well and offers multiprocessing capabilities and easy scheduling tasks, thus enabling fast technological development. The novelty of this paper is the hardware development of a complete low-cost EIT system, as well as three simple and efficient algorithms that can be implemented on ES. Details of the new electronic circuits, firmware and functions developed in this study are presented herein. The experiments show that the proposed EIT system delivers practically the same results as those obtained with a traditional PC.
The rest of this paper is organized as follows. Section 2 describes the adjacent measurement method, the physical design of the electrical impedance measurement base (test unit), the electronic design of the circuits and the firmware and functions for the proposed EIT system. Section 3 presents the experimental results, including a comparison between a PC and RPi4, calibration and results with different materials, such as steel, glass and an orange, as an example of use in the food industry. Finally, Section 4 summarizes our conclusions. Figure 1 depicts a basic 16-electrode system. The main equation for the voltage field produced by running a current across a material corresponds to (1), where I is the current, σ is the electric impedance of the medium, φ is the electric potential, ω is the angular frequency, and is the electric permittivity. This equation can be reduced to an equation known as the "standard governing equation for EIT" [67], given in (2),
The problem requires the injected current I and the voltage measured V 1 , the values of which are known and obtained from an EIT electronic system, but the impedance distribution σ is unknown; here we cannot easily resolve σ for (2) because the potential distribution φ is a function of the impedance, φ = φ(σ). As mentioned before, here the ill-posed nature of the problem is clear from observing and understanding the diffusive behavior of electricity and the inherent measurement errors. As a tomography technique, EIT basically reconstructs the spatial distribution of electrical conductivity within a body by measuring the voltage that appears on object boundaries due to the flowing electrical current [69]. The basic principle is to use the material's impedance features to characterize its internal structure [70]. Some authors argue that it is an emerging method for imaging the evoked activity of a rat brain [7,71], and it can also be used in human brain injury monitoring, as reported in [72,73].
Nowadays, there are different standard configurations connecting 8, 16, 32 electrodes and also systems with 128 electrodes or more. In this paper, a 16-electrode configuration is used to test and validate the proposed EIT system. An image is generated from a test unit, which consists of a circular vessel with a conductive liquid (water with potassium chloride or sodium chloride), where the object under test is introduced, then 16 electrodes are connected to four multiplexers and to an Arduino MCU, which maps the impedance of the object under test or the body, which is measured and characterized to form an image. All features were considered in the conception of the system as a whole: the electronic design, the data acquisition (DAQ) stage, the instrumentation, the data communication and the software that receives raw data and reconstructs the image in real time.

Adjacent Measurement Method
The adjacent method for EIT consists in applying a known current to a pair of neighbor electrodes. Once the known current is applied through these electrodes, an adjacent voltage measurement is made in all the adjacent connections of the cylinder water tank (vessel). Figure 2 shows the physical appearance of the test unit (vessel) used in this paper to test and validate the proposed EIT system. It is a round plastic vessel, which was used to contain the experiment samples (salty water, metal, plastic objects, fruit etc.), then 16 stainless steel 304-caliber electrodes were placed equidistantly for the proposed EIT system. The screws were introduced into the plastic vessel using nuts and rubber washers to prevent leakage. This vessel was used for all experimental procedures for the proposed system; a shielded cable was attached to each electrode to connect the electronic system and prevent noise. The 16 electrodes of the vessel were numbered clockwise and connected to the four ADG1406 multiplexers. The MCU manages the connections to perform the required measurements. It consists of an impedance acquisition subsystem that sends the impedance measurement values through the USB port to an RPi4, which after receiving the data stream, executes software that uses the EIDORS library [52] for image reconstruction. The shape of the sample measured must be known in order to verify correct image reconstruction; this is also helpful in calibrating the image reconstruction algorithm and therefore in obtaining a better image approximation. Many mathematical models exist, depending on the shape of the test unit (vessel); for this research, a circular shape was used.  Figure 3 shows how a constant current source is applied to two neighbor electrodes, a voltage measurement is performed on the remaining pairs, and afterwards, by means of a multiplexer, the voltage source is connected to the next pair of neighbor electrodes and the adjacent voltage is measured again until all combinations are covered; in this case, for a 16-electrode base, there are 208 measurements.

Current flow lines
Isopotential lines (a) (b) Figure 3. Adjacent measurement method, taken from [74]. (a) First measurement process: the current is injected between electrodes 1 and 2; (b) Second measurement process: the current is injected between electrodes 2 and 3. Figure 4 depicts the block diagram of the proposed EIT system. The hardware consists of a data acquisition (DAQ) subsystem and a user interface. The DAQ subsystem hardware was coded to employ the adjacent measurement method (Section 2.1) on the test unit. The Arduino MCU selects which pair of electrodes is connected to the AC constant current source, and the other pair that is connected to the adjacent electrodes. Then the signal is processed with the help of an instrumentation amplifier configured as a peak detector connected to an ADC that sends the voltage measurement value through an SPI (serial peripheral interface) protocol by receiving commands from the Arduino MCU, which sends the raw data through serial communication at 500,000 bps to a central processing unit (CPU), e.g., the RPi4, as is the case here.    Table 1 shows the system's features, the proposed EIT system works with 110 V AC at 60 Hz, the peak power consumption is 15 W, it has three DC operating voltages, 5 V, 12 V and −12 V, one MCU Arduino Mega 2560 to manage the data acquisition, the communication between MCU and RPi4 is via USB 2.0 port configured at 500,000 bps, the ADC part number is ADS1256 with 24 bit resolution at 30 kSPS, it has four multiplexers ADG1406 to access 16 electrodes, input frequency range 4-80 kHz, the frame rate is 12 per minute and the diameter of test unit is 17.5 cm.

Constant Current Source
To develop the AC constant current source, the ICL8038 precision waveform generator was used. This is because it is a monolithic integrated circuit capable of generating high accuracy sine, square, triangular, sawtooth and pulse waveforms with a minimum of external components. The frequency can be selected externally from 0.001 Hz to more than 300 kHz. In this paper, the constant current source applied to the proposed EIT system consists of an AC voltage source at 2.56 Vpp, with a frequency of 4 kHz and 40 kHz for the reported tests. This AC signal is injected into a circuit that converts the voltage into a constant current source. Figure 5 depicts the proposed circuit of the constant current source, which consists of an array of resistances, a TL084 operational amplifier and the 2N3906 PNP transistor. The voltage in pin number 3 of the operational amplifier remains fixed because of the high impedance, and pin number 2 shares virtually the same voltage value. When any load is connected between pin CSp 1 and CSp 2 , the voltage in pin 2 maintains its value, and the transistor Q1 delivers the necessary current to the load; the maximum current is the voltage in pin number 2 divided by the resistance R 4 . The current Is is calculated by (3) and the value for the experiment is 91.42 µA with V p = 2.59 V.
The pins CSp 1 and CSp 2 are connected to the four analog multiplexers ADG1406. These pins are now an AC constant current source, which is applied on the test unit for the proposed EIT system. The constant current source sensitivity to load changes is shown in Figure 6 and its values in Table 2. The voltage yields to the saturation value in the TL084 op-amp when the load exceeds 120 kΩ; therefore, this is the limit for the fixed current source at the proposed voltage. The load used in the system test is below 120 kΩ and therefore the constant current source works properly.

CMOS Multiplexer
The ADG1406 is a CMOS multiplexer that can be used in biomedical applications like EIT. Internally, it has a decoder that connects input/output pins S 1 to S 16 to an input/output pin D, with a resistance of only 9.5 Ω and a maximum current flux capacity of 300 mA. By using 4 multiplexers, it is possible to connect four different probes to 16 different outputsl; this configuration makes the adjacent current injection and adjacent voltage measurement in the test unit possible. Two probes are used for the AC constant current source and the other two for the voltage measurements. If a higher number of electrodes is required, the number of multiplexers has to increase, i.e., 8 multiplexers are required for a 32-electrode EIT system, as well, minor changes in the hardware and software have to be performed.

High-Precision Peak Detector
A peak detector is a circuit that takes the maximum voltage value of an AC voltage signal (V p ), and it maintains it for a finite time duration; it is composed of a diode connected to a capacitor and a resistance that discharges the capacitor because of the peak variation. For this EIT system, a high-precision peak detector was used. Figure 7 depicts the proposed high-precision peak detector circuit. The pin from the MUX, which corresponds to a voltage measurement on the test unit (vessel), connects to the high-precision instrument amplifier AD620 from Analog Devices. The gain is set to approximate 1.5 and the output is then passed through C 1 , which allows only AC current, thus eliminating the offset signal. The signal is then applied to an operational amplifier LM2903, which is a dual comparator. Pin 7 is connected to a diode and a voltage is applied to the capacitor C 2 and resistances R 12 and R 13 . Then an MCP601 operational amplifier was connected as a voltage follower and was chosen on the basis that its characteristics mean it is very often used for data acquisition. Its feedback goes to the LM2903 comparator and this configuration delivers a peak voltage for the signal input; pin 6 of the MCP601 corresponds to this peak and is connected to the ADC.

Analog-to-Digital Converter (ADC)
Once the signal is conditioned from the test unit (vessel) through the multiplexers and peak detector, the signal is applied to ADS1256, which has very low noise, 30 kSPS of 24-bit resolution and 8 analog input channels. It has several applications including in biomedical, testing and measurement equipment. This ADC is connected through an SPI communication protocol and works as a slave to an Arduino MCU, which controls the voltage measurements.

Firmware and Functions for the Proposed EIT System
The following algorithms are responsible for acquiring data to reconstruct an image. The steps are as follows: data is processed through a statistical algorithm in the MCU and the resulting average data values are received through a serial port from an MCU to Matlab (PC test) or RPi4 (ES test), a complete measurement cycle is continuously received, and after each cycle is received, data is compared with the calibration data file through the comparison algorithm. The final data and the calibration data are processed with the image reconstruction software (EIDORS) [52] and a real-time reconstructed image is created.

Data Acquisition Firmware
The data acquisition firmware enlisted in Algorithm 1 is embedded in the Arduino MCU and may be coded on different MCU devices. Important features include a baud rate of 500,000 bps, the adjacent method routine in the main while loop, the voltage measurement algorithm by means of an ADS1256 and the statistical mean that is calculated to determine the best value of each voltage measurement. In Algorithm 1 the acquisition process is described, the pseudo code used for this algorithm consists in various steps. First the main libraries to make the ADC work are called, then the parameters to control the multiplexers are set, the communication is set to 500,000 bps and the library to communicate through SPI is called and the ADC is initialized. An infinite loop that will be taking cycles of voltage measurements using the adjacent method is started, 250 samples are taken for each voltage measurement. As described, the Algorithm 1 selects the pair of electrodes to inject current, and then the electrodes to make voltage measurements (ADC sends values through SPI communication to MCU), once the 250 samples are taken, the Data Acquisition Algorithm 1 discards the first 130 voltage measurement values that correspond to the transitory state of the voltage measured, then the mean is calculated for the rest of the voltage values, generating a unique average value which is send as raw data through serial communication to RPi4, the process is continuously repeated. The firmware described in Algorithm 2 for data comparison was coded for RPi4 and determines if the data measured in real time differs sufficiently from the calibration data. It calculates if the data collected is different from the calibration data due to the sensibility of the system to noise; even if two data vectors measured from the system look the same, a small difference, even in the order of 1 × 10 −15 , delivers a faulty image reconstruction for the object in the test unit (vessel), owing to the ill-posed nature of the problem [36][37][38][39], as discussed in Section 1. Therefore, the comparison function determines if the acquired data is within a margin of error tolerance. If this is the case, it considers the measured data to be the same as the calibration data; otherwise, it leaves the data without any adjustment for the reconstruction algorithm. An error tolerance of 3% was chosen because while making measurements, we found a systematic error rate of at least 2%, due to noise and other physical limitations. Figure 9 shows three graphs. Graph (a) shows calibration data and data from arbitrary measurement of an object. Graph (b) shows two measurements that are almost the same; one is calibration data and the other is a measurement of the system in the same state as the calibration plane (second round of calibration-plane measurements), which physically means that it is a measurement with the test unit (vessel) with only salty water. It is clear from graph (c), which shows the differences between the two measurements, that they are practically the same. Should the reconstruction algorithm receive this, it will discard the data measured and consider it to be the same as the calibration data. Algorithm 2 describes the pseudocode for this function, the function receives two data vectors, an n tolerance value and a timeouts value to determine whether the vector are or not practically the same, each vector value is compared, and if it outside an n tolerance value, a flag variable is increased and if it overpass the timesout value set, then vectors are not the same, and therefore not changed; however, if it does not overpass the value set, then vector A becomes equal to B meaning that both vectors are practically the same.

Function for Statistical Analysis
The Statistical Function enlisted inside Algorithm 1 performs statistical calculations with the acquired data to be smoothed, due to the ill-posed nature of the problem [36][37][38][39]. This makes it possible to determine which measurement is the best value for use in the image reconstruction process. The adjacent method was described in Section 2.1. It consists in taking measurements using adjacent electrodes in the proposed EIT system. In this paper, 16 electrodes were used, and therefore, 208 different measurements can be obtained from the test unit (vessel). Each measurement is acquired by using an ADS1256 ADC through the acquisition of n = 250 samples, which means that n can be changed in order to improve accuracy in each data acquisition process. Figure 10 depicts four graphics of the 250 samples that are performed for each voltage measurement. A transient behavior can be observed in the measurements. For this reason, the statistics mean, median and mode were calculated for each vector of samples. Several experiments were performed and it was found that the mean and median are similar enough, though the median is more accurate with respect to the actual measured voltage considering all 250 raw value samples, the mean represents a lower computational cost and an acceptable average value, added to this, to improve its accuracy, the first 130 samples are not taking in account. This means that for every voltage measured, the mean is calculated to define the best value for the last 120 samples resulting in an improved mean average value with low computational cost. This process is repeated 208 times to perform a complete adjacent measurement cycle in the proposed EIT system, and it takes 4 s to complete a full voltage scan for 250 samples per measurement.  The firmware for calibration and real-time working enlisted in Algorithm 3 was coded for RPi4 and has two main features. The first one is a calibration routine, which executes an adjacent measurement routine in the test unit (which the intrinsic errors of the electrodes and cables are considered, such as: lift-off, parasitic resistances, inductances, capacitances, corrosion, noise levels, etc.) when it contains only conductive water. Once finished, it creates a file with the raw data from the test unit with only conductive water. This data is the calibration data (data to be applied in the reconstruction algorithm). The second feature is the fact that it performs an adjacent measurement routine in real time for data acquisition for the test unit (vessel). Once a measurement cycle is completed, it performs the reconstruction algorithm for EIT using the EIDORS library [52]. The calibration function uses the acquired data in real time and the calibration data measured in the calibration process, resulting in a real-time reconstructed image from the impedance mapping in the test unit (vessel). Algorithm 3 describes the general pseudocode routine for the calibration and real-time system features. If the user decides to calibrate the system, then a single measured cycle is received from the MCU and stored in a calibration file (file 2), and then it closes the communication. Once the user has a calibration file, the real-time feature can be used by setting the calibration flag to 0, now the system will receive data from the serial communication and will store it in a real-time data file (file 1), the values received are 208, which correspond to a complete voltage measured cycle. Once the real-time file is created, the function reads both real-time and calibration data files, it performs the function for data comparison (Algorithm 2) then the image reconstruction function is called and a real-time reconstructed image is showed on-screen, the process is repeated until the cycles decided by user are finished.

Image Reconstruction
The EIDORS library [52] was used to perform image reconstruction from the collected data. We decide to use EIDORS because we find that its good performance has been proven in the literature [42,51]; furthermore, this works correctly in Matlab or GNU Octave, has a lot of feedback and is easy to implement on EIT systems. According to the library instructions, many configurations are possible; for this research, the settings used were the following: a 2D circle model with 16-electrode configuration, no measurements on current-carrying electrodes, rotation of measurements with stimulation pattern, adjacent current injection, adjacent voltage measurements and the number of rings set to 1 (however, when using 2D reconstruction, this parameter is disregarded by the software). Two vectors of 208 values must be introduced into the reconstruction function-data at earlier time and data at later time-in order for the reconstructed image to be shown on screen. Algorithm 4 describes the image reconstruction function. The function receives parameters of number of electrodes, real-time (data at later time) and calibration data (data at earlier time). The EIDORS library functions are called, the configuration is described in the algorithm and this configuration was chosen according to the system developed, taking into consideration the shape of the vessel, number of rings (which corresponds to 1 ring), the number of layers (this number is disregarded as it is only needed for 3D reconstruction but necessary to make the function work), the number of electrodes (which is 16), the options (no measurement on current carrying electrodes and rotate measurements, this was set according to the adjacent measurement method). The first "{ad}" parameter corresponds to the way of injecting current, which is adjacent current injection, and the second "{ad}" parameter in the algorithm code, corresponds to the way of making the voltage measurements which is adjacent voltage measurement; in other words, these parameters tell the function that the adjacent measurement method is applied to inject the current and to make the voltage measurements. The current parameter may vary and this helps to have different approaches of the reconstructed image and is set to 1, the rest of the code is needed to solve the inverse problem and to finally show the reconstructed image on-screen.

Comparison between the PC and RPi4
This section presents a comparison between the proposed EIT system, developed using GNU Octave for RPi4, and an EIT system developed using Matlab for PC. Both forms of hardware apply EIDORS to verify that all numerical computation and application with the RPi4 for the proposed EIT system is competitive with respect to the PC. To perform this comparison, the raw data used for the PC and RPi4 is the same. Data was acquired from measurements from the test unit (vessel) with several objects to characterize their impedances: for example, conductive water only, to establish the zero state or calibration plane; a round metallic recipient, which has high conductivity; and a glass, which has low conductivity. It is also important to mention that all numerical calculations were performed by both types of hardware, and double-precision variables were used according to the IEEE 754 standard [75]. For a better understanding of the experiments, each configuration with photos is presented to show that the EIT with an RPi4 does not compromise accuracy or effectiveness. Figure 11 shows the test unit (vessel) with only conductive water to perform calibration. First, it was necessary to connect the test unit (vessel) to the proposed EIT system then execute the function for calibration and real-time working. Figure 11. Test unit (vessel) with only conductive water to perform calibration. Figure 12 shows the measurements for image reconstruction of the calibration plane.

Calibration of the Proposed EIT System
The left-hand side shows three graphs processed using Matlab for the PC, representing a cycle measurement, calibration data and the error (difference) between both signals. On the right-hand side, the same measurements are shown using GNU Octave for RPi 4. Figure 13a shows the image reconstruction for the calibration plane obtained using Matlab on the PC. Figure 13b shows the image reconstruction obtained using GNU Octave for RPi4. The reconstructed image achieved is practically the same, and the hardware used was unaffected, proving that RPi4 can be used for EIT.  Figure 13. Comparison of image reconstruction for the calibration plane on the PC versus RPi4: (a) Image reconstruction using a 4 kHz signal, with no object inside the vessel and data processing on the PC, (b) Image reconstruction using a 4 kHz signal, with no object inside the vessel and data processing on RPi4.

Orange as Test Unit
In this paper we use seawater (raw sea water that is naturally polluted) taken from a local beach to inject the orange for the purpose of detecting adulterations in fruits. The seawater conductivity normally goes from 30 mS/cm to 55 mS/cm, this depends on where the seawater was taken. The AC stimulating signal is a sine wave with 2.56 Vpp and a frequency of 40 kHz. To perform this test, first, a cycle of 208 measurements must be performed to obtain the calibration data in the actual state of the orange. Another cycle of 208 measurements is then performed and the result is compared with the calibration-plane measurements. In other words, a complete cycle is performed in the same conditions as the calibration plane. Figure 14a shows the orange as the test unit in the calibration plane. Figure 14b shows the corresponding image reconstruction: a full white circle is observed, meaning the information is the same as is in the zero state or calibration plane. Figure 14c shows the orange as the test unit with seawater injected. Figure 14d shows the image reconstruction of the orange with seawater injected; a navy blue salty spot can be observed, where the conductivity of the seawater is higher than the calibration plane, and therefore the navy blue spot represents less impedance than the calibration plane (white). Other color shades can also be seen, such as aqua-green, which shows low filtration of salty water to other areas of the orange. Even yellow is observed, which represents a minor alteration of electrical impedance with respect to the calibration plane. This test shows a potential application in food industry, for example, to know the fruits maturity process, to know if it is adulterated or to know when it is going into a state of decomposition.

Real-Time Results on RPi4
Figure 15a shows a glass object placed inside the test unit (vessel); dark red colors can be observed in the reconstructed image and represent the high impedance of the glass. Figure 15b shows a metal object placed inside the test unit (vessel); navy blue colors can be observed in the reconstructed image and represent the low impedance of the metal. Figure 15c-e shows a glass and metal object placed inside the test unit (vessel) in different positions; in the reconstructed images, dark red and navy blue shapes can be seen, which represent the impedance of the glass and metal objects, respectively. Furthermore, if the objects move, the colored shapes corresponding to the objects also move. Figure 15f shows an orange placed inside the test unit (vessel); in the reconstructed image, a dark red shape can be observed, which represents the high impedance of the orange. As shown in previous reconstructed images by PC and RPi4, it can be concluded that numerical computation and reconstructed images deliver practically the same results. This is because both types of hardware perform numerical calculations according to the IEEE 754 standard [75]. RPi4 has ample hardware resources for this application; the system requires less than 200 MB of RAM, which accounts for just 4.88% of the total 4 GB on-board RAM. Therefore, RPi4 offers a portable solution that consumes less energy and costs less than a PC, without sacrificing accuracy or reliability.

Performance Comparison between PC and RPi4
This section is presented for the purpose of comparing the performance of the proposed EIT system on different kind of hardware. Table 3  On the other hand, the RPi4 used has the following features: Raspberry Pi 4, 4 GB RAM, Model B with clock working at 1.5 GHz, and a 64-bit Quad Core ARMv8 CPU. In terms of hardware, the PC clock is 65.21% faster than RPi4, and the PC has 16 GB of RAM memory, while RPi4 only has 4 GB. In terms of software, the PC has the operating system Windows 10 Pro and Matlab R2016b, while RPi4 uses Raspbian 4.19 as the operating system, which is a free distribution of GNU/Linux, and GNU Octave 4.4.1 is used as the programming language, under free license. The same EIDORS library and the same firmware developed in this article were used in both types of hardware. Finally, another important factor is the total cost of the EIT system developed. The cost of the PC-based system is $1000.00 U.S. dollars while RPi4 costs only $250.00 U.S. dollars. The PC is therefore four times more expensive than RPi4 (Note: These estimations are an average. In addition, the Matlab license can be disregarded when running GNU Octave on PC). Thus, one of the aims of this paper is to present the development of a portable, reliable and low-cost EIT system without losing any information or quality in the image-forming process. There are some tradeoffs to be consider, as mentioned above and as shown in Table 3, the price of the PC is higher but also the image reconstruction on PC is faster, while in RPi4 is slower; however, RPi4 is lighter and smaller-this allows us an easy transport. For example, some of the applications in geology, require one to go to places where there is no electricity, then a smaller battery will be able to make the proposed EIT system to work in potential EIT applied in soil study. On the other hand, a PC is easier to use; however, RPi4 has already a lot of information available on internet of how to use it. Most people have portable PCs, nevertheless, if the EIT system is used with a PC it will require the user to take his PC dedicated to this task, while if having a portable option, the user may leave the EIT system working separated from his PC, e.g., a PC may play a movie, but some dedicated devices like a Smart TV do the same, without the need of a PC. Many other tradeoffs can be considered as in every system that can be used in a PC or dedicated device, in the end, the user will define whether he prefers to use the EIT system with a PC or with RPI4.  Table 4 shows a comparison between the execution times of the software running on a PC and on RPi4. It can be observed that the results on the PC are executed more quickly across the four processes required to perform the EIT. Furthermore, when the proposed EIT system uses a 4 kHz signal, the average RPi4/PC ratio is 4.35, while with a 40 kHz signal, the average ratio is 5.03; however, the total cost of the PC-based system is 400% higher than the RPi4.

Comparison versus Related Work
Related work of EIT has been studied and compared to our proposed EIT system. Table 5 shows a compendium of features from several revised articles. In Reference [50], the authors report an EIT system with a 12 bit ADC that has 2400 kSPS, for data acquisition they use the MCU STM32F446RE and do not mention the software for image reconstruction used. In [51], the authors use a 16 bit ADC with 0.860 kSPS, which is the lowest sample rate, for data acquisition they use the MCU Arduino UNO and they perform the image reconstruction by using EIDORS running on a PC. In Reference [53], the authors use a 16 bit ADC with 0.860 kSPS, for data acquisition they also use the MCU Arduino UNO and a Raspberry Pi 3 as CPU, the main difference of this related work, is that they use a different software for image reconstruction, i.e., they use the Gauss-Newton for Python. In Reference [41], the authors use a 12 bit ADC with 65,000 kSPS, which is the highest sample rate, for data acquisition they use an FPGA and DSP, and for image reconstruction they use a PC running the GREIT algorithm. In Reference [42], the authors use a 14 bit ADC with 25,000 kSPS, for data acquisition they use an FPGA and the image reconstruction is made on a PC running EIDORS, NETGEN and GREIT algorithm. Finally, as can be seen in the Table 5, the related works do not report details of the designed circuits nor of the algorithms implemented on embedded systems. On the other side, it is also important to note that when one has an ADC with higher sample rate and higher communication speed between the DAQ device and the CPU, one can get more images per minute (frames per minute).

Conclusions
The proposed EIT system showed satisfactory results since the multiple tests performed to verify functionality were very successful. Nonetheless, some stages can be improved to enhance performance, such as ADC sample rate and communication between DAQ device and CPU: the faster the ADC and communication, the sooner a complete cycle can be performed. Special circuits could also be used to reduce noise in the measurements. From the experiments with the PC and RPi4, it can be concluded that the numerical computation and reconstructed images deliver practically the same results, because both types of hardware perform numerical calculations according to the IEEE 754 standard for floating-point operations. Besides the ADC hardware, a software adjustment is necessary to perform statistics on the measurements, as shown in the Algorithm 1 by using 250 samples, a statistical mean was calculated in the last 120 samples to determine the best measured value with the ADC. Another important aspect in the proposed EIT system is the method used to read impedance; in this paper, the adjacent method was used, but other configurations can also be used to read impedance. The algorithms and hardware can be replicated and are open to improvements, for example by using a faster ADC or a DDS signal generator. The main purpose of this research was to develop a complete EIT system, which would enable real-time image reconstruction by using an RPi4. By processing the same raw data obtained from the impedance acquisition stage in both PC and RPi4 hardware, it was showed that ARM architecture can perform the same process with practically the same quantitative results, sacrificing only processing time, while consuming much less power and fewer hardware resources, with open software, fast development and low-cost hardware, just as shown in the cost-benefit analysis in Tables 3 and 4. The use of RPi4 provides the EIT system with portability, offering potential industrial and medical applications. Finally, the proposed system proves that a portable and reliable application on an ES is possible and offers an excellent cost-benefit ratio in comparison with a PC, considering precision, accuracy, resolution, energy consumption, price, size, weight, portability and reliability.
As a future work, the calibration process of the proposed EIT system will be improved in order to measure with more accuracy and precision the impedance, this by using accurate NIST traceable standards. As well, the proposed EIT system with additional upgrades and bioethical compliance could be used in mechanical ventilation, as part of research and characterize the lung impedance in COVID-19 patients and healthy people. It also has potential application in the food industry.