Introduction
The scientific community is constantly working to develop highly efficient, accessible, and stable glucose sensors to monitor glucose levels. However, those based on enzymes are not very stable since, in some cases, they are susceptible to pH and temperature[1],[2],[3]. With the advent of nanoscience and nanotechnology, scientists have developed and fabricated advanced nanostructured materials over the past two decades to develop glucose sensors with high sensitivity and selectivity [4], [5]. Carbon nanotubes (CNT), metal nanoclusters, and nanoparticles are among the nanostructured materials used. CNT and transition metal nanoclusters have had numerous applications as sensors and biosensors [6]. Nanostructured carbon systems such as CNT, graphene, and mesoporous carbon are the most studied materials for glucose detection thanks to their different properties, such as large surface area, better conductivity, biocompatibility, and chemical stability [7], [8]. For their part, smaller metal clusters have shown catalytic activity not exhibited by their massive analog or nanoparticles (NP); this generates excellent promise for their possible application as catalysts [9].
Additionally, several metallic clusters have been revealed to have tremendous and selective catalytic activity when deposited on suitable support [10], [11]. Hybrids based on the combination of metal and CNT have been positioned as the new trend to produce a synergistic effect in glucose detection due to the outstanding catalytic activity of the metal and the exceptional properties of carbon materials, such as the large surface area, exceptional electrical conductivity and excellent chemical resistance [12]. For example, copper (Cu) is one of the widely investigated metal catalysts, and its electrodeposition has been studied on various carbon nanostructures [13], [14], [15]. Cu-based nanomaterials are among the most studied nanostructures in sensor and biosensor applications due to their high efficiency, low toxicity, low cost, long-term stability, and high catalytic activity. In [16], the synthesis of nanostructures with different morphologies of copper oxide (CuO) for the detection of glucose; however, the synthesis is complex to carry out. In [17], a nanocomposite formed from Cu and CNT (Cu-CNT) exhibits high sensitivity and stability, fast response with a wide linear range, a low detection limit, and exemplary performance detecting glucose in blood serum. This process is developed by synthesizing carbon nanotubes grown on a Tantalum (Ta) substrate from chemical vapor deposition (CVD) and electrochemically depositing Cu nanocubes on the CNT using a simple cathodic potentiostatic technique. In [18], a non-enzymatic glucose sensor with catalytic oxidation through the electrodeposition of Cu nanoclusters on an electrode modified with carbon nanotubes solubilized with Nafion (Nf). This sensor is applied for glucose analysis in blood samples and provides high sensitivity and stability, fast response, good reproducibility, and selectivity. These qualities make the Cu-CNT nanocomposite-based electrode a promising candidate for enzyme-free glucose detection.
Implementing artificial intelligence (AI) algorithms in systems based on nanostructured biosensors is of great help because it can estimate expected values quickly, accurately, automatically, and in real time. Additionally, an adequate database can train algorithms to estimate particular variables. Machine learning can efficiently process large amounts of messy or low-resolution data and discriminate overlapping signals from each other [19]. In [20], a method based on using artificial intelligence algorithms to process the interference between the oxidation currents of insulin and glucose using cyclic voltammetry with a Ni(OH)2 electrode. The method allows for separating and providing insulin and glucose concentrations, obtaining high precision (at the mmol level) and correlation, with prediction errors of 6.515 % for insulin and 4.36 % for glucose. In [21], an application of an electronic tongue formed by several electrodes modified with nanoparticles for the detection and electrochemical quantification of carbohydrates in sugarcane waste samples. It uses an artificial neural network to process the data and predict carbohydrate concentrations with high precision and correlation.
This article presents the design and implementation of glucose measurement in real-time of a system in aqueous media based on machine learning algorithms embedded in an ESP32 SoC. The instrument is made up of two main blocks: i) the electrochemical stage, where an oxidation-reduction process of an aqueous medium with glucose is carried out and ii) the information processing stage and the estimation of the glucose level, based on machine learning algorithms implemented in an ESP32 SoC. The first block's main contribution is designing, synthesizing, and implementing a non-enzymatic sensor built from a glassy carbon electrode functionalized with CNT and copper nanoparticles. Considering that the synergy between copper nanoparticles and CNT increases the amperometric response, the resolution and sensitivity of the sensor are improved. The second block estimates the level of glucose present in an aqueous medium. The main contribution at this stage is the method to estimate glucose levels in the solution. It is from current data obtained in real-time in the oxidation-reduction stage of the aqueous medium with glucose, which is fed to the embedded machine-learning algorithm. The embedded algorithm based on an ANN with MLP architecture determines the corresponding glucose level. Therefore, the implemented measurement system incorporates the advantages of nanotechnology through a nanostructured MWCNT-Cu sensor (Multi-Walled Carbon Nanotubes with Copper nanoparticles), the benefits of AI through the training of machine learning algorithms based ANN-MLP (artificial neural network multilayer perceptron) and the potential of digital electronic by the ANN-MLP algorithms, embedded in an ESP32 system-on-chip (SoC). The integration of these elements makes a robust system that estimates the glucose level in real-time of an aqueous medium in an oxidation-reduction process under cyclic voltammetry.
The article is structured as follows: The Materials and Methods Section presents the design, synthesis, implementation, and validation of a non-enzymatic MWCNT-Cu electrochemical sensor. The type of architecture of the ANN-MLP implemented is also presented, as well as the mathematical model of the embedded algorithm in an ESP32 SoC. Finally, the experimental setup is shown. In the Results and Discussion Section, the behavior of the nanostructured sensor in obtaining experimental data on glucose concentration in aqueous measurements using cyclic voltammetry is presented. Implementing the machine learning algorithm is validated through two training processes, one for the current data set corresponding to the voltage level of 1.3 V and another for the voltage level of -0.455 V, both for different glucose concentrations. Finally, the Conclusions of this work are presented.
Materials and methods
The first stage is the design, synthesis, implementation, and validation of a non-enzymatic glucose sensor manufactured with electrodeposition of Cu nanoclusters on the film of a glassy carbon electrode modified with MWCNT solubilized with Nafion (CNT-Nf). The manufacturing of the sensor begins with the synthesis of MWCNT using the spray pyrolysis method; subsequently, they are functionalized, and their composition is validated by X-ray diffraction (XRD). Based on a glassy carbon electrode, MWCNT are added, and the proposed sensor is structured under Cu electrodeposition.
MWCNT Synthesis
Figure 1 shows the process used to obtain the MWCNT. Initially, a solution composed of 572 mg of ferrocene (C10H10Fe) with 26 mL of toluene (C6H5CH3) is prepared and subjected to an ultrasonic bath for 10 min. This solution is fed to a nebulizer that uses argon (Ar) as a purge gas. This arrangement is placed in a tubular oven where the nebulization is passed through a small quartz tube (SiO2), bringing it to 850 oC and cooling it to room temperature.
MWCNT Functionalization
Figure 2 shows the process used to functionalize the MWCNT. Initially, 340 mg of CNT are calcined at 400 oC for 30 min. These MWCNT are suspended in 60 mL of 6 M hydrochloric acid (HCl), subjected to an ultrasonic bath for 4 h, and allowed to rest for 12 h. Taking 170 mg of MWCNT, they are suspended in 20 mL of nitric acid (HNO₃) with 40 mL of sulfuric acid (H₂SO₄) and subjected to an ultrasonic bath for 4 h. Finally, filtration is done using a vacuum pump with a cellulose and water (H2O) filter.
Characterization of MWCNT
The crystalline nature of MWCNT is validated by X-ray diffraction. Figure 3a shows the diffractograms of the pristine carbon nanotubes, which show the typical peaks at 26.3° and 43.7°, corresponding to the reflections of the graphite in (002) y (100) (Joint Committee of Powder Diffraction Standards (JCPDS) # 96-101-1061) [21]. Figure 3b shows the synthesized and functionalized MWCNT diffractogram obtained with the D2 Phaser X-ray diffractometer. It is observed that the characteristic peaks of pristine MWCNT are also present (Figure 3a). It can be seen that functionalized MWCNT have a lower intensity than pristine nanotubes motivated by the formation of carboxylic groups on the MWCNT. A slight peak at 30° is also observed due to the functionalization process.
Sensor manufacturing
The proposed sensor is fabricated in two main stages: i) adhesion of the functionalized MWCNT on a glassy carbon electrode and ii) electrodeposition of Cu. Figure 4 shows the first stage of the proposed electrode preparation process. Initially, a glassy carbon electrode (GCE) is taken as a base, and its free end is polished with titanium oxide TiO2. A 10-minute ultrasonic bath is applied in 15 mL of a solution of nitric acid (HNO₃), ethanol (C₂H₆O), and double-distilled water (1:1 v/v) left to dry at room temperature. In parallel, 1.0 mg of functionalized MWCNT are dispersed in 65 µL of 0.5% Nafion (C7HF13O5S·C2F4). 15 µL of the CNT solution with Nafion (NTC-Nf) are taken and deposited on the polished surface of the glassy carbon electrode, allowing it to dry at room temperature.
Figure 5 shows the second stage in the preparation of the proposed electrode. First, an electrolyte composed of 35.6 mg of sodium sulfate (Na₂SO₄) and 8 mg of copper sulfate (CuSO₄) dissolved in 25 mL of deionized water is prepared, applying a sonic bath for 10 min. The electrodeposition of Cu is carried out in an electrochemical cell connected to the CHI920C Scanning Electrochemical Microscope. The electrochemical cell comprises three electrodes immersed in the electrolyte prepared for this purpose. The reference electrode (RE) is a silver/silver chloride (Ag/AgCl (3M KCl)) electrode, the counter electrode (CE) is platinum, and the working electrode (WE) is the glassy carbon electrode (GCE) with MWCNT-Nf. Cyclic voltammetry is applied with a potential window of between -0.6 to 0.6 V for 30 cycles at a scanning speed of 100 mVs-1. Under this cyclic electrodeposition process, Cu nanoclusters adhere to the WE (MWCNT-Cu). The prepared work electrode (WE) is rinsed with distilled water, allowed to dry at room temperature, and refrigerated.
Machine learning algorithm and embedded system proposed
The estimation of the glucose value is based on a machine learning or ANN algorithm based on the MLP architecture embedded in an ESP32 SoC that integrates a 32-bit core RISC-V microcontroller with a maximum clock speed of 160 MHz, programmed in Python. The data that feed the ANN for training and validation are obtained from the experimental results, to which data augmentation is applied by estimating the mathematical model of the sensor's behavior. The data obtained correlates the molar concentration and the electrical current obtained from the sensor. Figure 6 shows a block diagram of the main stages of the implementation of the ANN in the ESP32 SoC. The training of the ANN is carried out with the data from the experimental arrangement through a potentiostat. Once the MLP model is trained, it is optimized to obtain the weights required to fit the corresponding mathematical model. The optimized and trained algorithm is embedded in the ESP32 SoC.
Figure 7 shows the general architecture of the ANN-MLP. For each of the implemented models, various hyperparameter values are used until the appropriate adjustment to the behavior of the sensor is found. Each model is designed with a ReLu-type activation function and presents a sequential architecture with different hidden layers, epochs, and learning rates.
The mathematical model used for each ANN model is given by Equation (1).
Where:
|
is the expected value of glucose concentration, |
|
is the limiting function or activation function, |
|
corresponds to the associated weight matrices in each layer, |
x | is the input data vector, and |
|
is a bias convention from the processing node. |
Algorithm 1 shows the pseudocode embedded in the ESP32 SoC, based on the ANN-MLP model trained in Python, about the mathematical model described by Equation 1.
Figure 8 shows the proposed experimental setup for real-time glucose measurement for aqueous media based on an ESP32 SoC with an embedded machine-learning algorithm. From the electrochemical cell where the oxidation-reduction process of the glucose solution is carried out, a current value is obtained that feeds the ESP32 SoC. The algorithm based on an ANN-MLP estimates the value of glucose in the solution.
Experimental data on glucose concentration are obtained by cyclic voltammetry in an electrochemical cell connected to the CHI920C Scanning Electrochemical Microscope as is illustrated in Figure 8. In the electrochemical cell, three electrodes are immersed in the aqueous solution with a specific concentration of glucose (electrolyte) prepared for this purpose: i) the working electrode (WE) corresponds to the MWCNT-Cu electrode proposed in this work, ii) the reference electrode (RE) is silver/silver chloride (Ag/AgCl), and iii) the counter electrode (CE) of Platinum (Pt). The CHI920C Scanning Electrochemical Microscope supplies voltage to the WE and RE electrodes and collects current data between the WE and CE electrodes. The applied voltage is 50 mVs-1 from -1.3 V to 1.3 V, in a 20 mM alkaline solution of Sodium Hydroxide (NaOH). An electric current flows through the electrolyte in the electrochemical cell (aqueous solution with glucose) in response to the applied potential range. The electric current that flows depends on the concentration of glucose present and the voltage applied at the moment. Therefore, an electric current corresponding to each voltage value is generated when executing a potential sweep. A cyclic voltammogram (CV) is generated by graphing the applied voltage range and the obtained current (Figure 8). Therefore, each solution with a particular glucose concentration has its specific CV. Figure 9 shows how the CV is formed in three segments. In the first segment (from 0 to 1.3 V), the glucose oxidation process occurs from 0.4 to 1.3 V, corresponding to the change of oxidation state from Cu(II) to Cu(III). The second segment (from 1.3 to -1.3 V) is where the copper reduction process occurs from 1.3 to 0.23 V, corresponding to the change from Cu (III) to Cu(II), the peak at -0.455 V corresponds to the change of Cu(II) to Cu(I), where glucose is reduced, allowing its concentration to be measured. Finally, in the third segment (from -1.3V to 0 V), it is reduced from Cu(I) to Cu(0) at the -1.3V peak, Cu(0) to Cu(I) at the peak -0.34V, and Cu(I) to Cu(II) at the -0.1V peak. This oxidation-reduction process of Cu and glucose in an alkaline medium is well reported in [22] and [6]. Figure 9 shows the behavior of the MWCNT-Cu work electrode in a cyclic voltammogram (CV) oxidation-reduction process of Cu and glucose at 100µM in an alkaline médium, in the potential range from -1.3 V to 1.3 V.
This methodology allows the same CV to have 2 points of interest to compare and measure the glucose concentration in real-time, at -0.455 V and 1.3 V.
Thus, a database is formed for each aqueous solution with a certain glucose concentration, with the experimental voltage and current data obtained. These database are used to train the machine learning algorithm embedded in the ESP32 Soc.
Results and discussion
Figure 10 shows the oxidation-reduction behavior of the MWCNT-Cu sensor fabricated for glucose measurement in aqueous media.
Figure 10 shows results for solutions with different concentrations of D-glucose: 1, 5, 10, 15, 25, 50, 100, and 250 µM in 20 mM an alkaline medium. The curves are obtained in the potential range from -1.3 V to 1.3 V and a scanning speed of 50 mVs-1. The amount of glucose in a solution is directly proportional to its oxidation (amount of oxygen consumed), manifesting in an increase in current, as evidenced. In this case, oxidation for different glucose concentrations can be observed within the potential range of 0.4 V to 1.3 V. For the voltage level of 1.3 V, a clear separation is presented between the current vs. voltage curves, for the different glucose concentrations, which allow us to distinguish up to the concentration of 250 µM; this condition is attributed to the synthesized MWCNT-Cu sensor. For a voltage of -0.455 V, the curves for different glucose concentrations are more concentrated, which reduces the sensitivity of glucose measurement to a maximum of 100 µM.
The second stage in developing and implementing a glucose measurement system in aqueous media is determining the glucose level in real time. The proposed method uses current data in the oxidation-reduction stage of the glucose solution to feed a machine-learning algorithm embedded in the ESP232 SoC. The algorithm based on an ANN-MLP finally estimates the corresponding glucose level. The design of the algorithm and its training are developed in Python 3.8, using various libraries for machine learning. Each solution with a particular glucose concentration has a database formed with the experimental voltage and current data obtained. These data used to train the ANN model are obtained from the experimental values shown in Figure 10 relative to the behavior of the MWCNT-Cu sensor. Two training sessions are carried out to validate the machine learning algorithm, one for the current data set corresponding to the voltage level of 1.3 V and another for the voltage level of -0.455 V for different glucose concentrations. The proposed ANN-MLP architecture has two input layers for the two case training: the electric current and the molar concentration. For the voltage level of 1.3 V it comprises four hidden layers of 16, 20, 20, and 1 neurons and an output layer corresponding to the glucose level estimation, as shown in Table 1. The activation function of the input layer is a Relu function, the learning rate of the classifier is defined as a constant equal to 0.018.
Input Layer | Hidden Layers | Output Layer |
---|---|---|
Current Measure, Molar Concentration | 16-20-20-1 | Molar Concentration Estimated |
For the current data set corresponding to the 1.3 V voltage level, Table 2 provides hyperparameter information for this model.
Hyperparameters | Proposed ANN-MLP |
---|---|
Kernel | Linear |
Optimizer | Adam |
Activation Function | Relu |
Error | MAE |
Epoch | 8500 |
Degree | 1 |
Learning Rate | 0.018 |
Bias | Boolean |
The experimental value of glucose concentration is obtained by feeding the ANN-MLP algorithm trained in real-time with a current value obtained from the electrochemical cell for a specific voltage value while performing cyclic voltammetry (Figure 8). For the 1.3 V case, Table 3 shows the molar concentration data used for the first training of the proposed ANN-MLP at 1.3 V and the results obtained by the algorithm after training. It is observed that there is an average error of 0.0138 between the glucose concentration and the estimated value.
Experimental currents x 10-7 (A) |
Glucose concentrations (µM) |
Glucose concentration obtained with ANN-MLP (µM) |
---|---|---|
1.94 | 1 | 0.979088 |
2.95 | 5 | 4.98703 |
4.41 | 10 | 9.99455 |
5.31 | 15 | 14.9987 |
6.73 | 25 | 25.0102 |
7.83 | 50 | 50.0158 |
9.39 | 100 | 100.023 |
10.0 | 250 | 250.021 |
Figure 11 shows the final correlation between the proposed ANN-MLP training results and the experimental data. It is observed that the red curve corresponding to the results obtained by the RN tends to fit well with the blue curve corresponding to the input values, which indicates adequate algorithm training. These results are obtained with a sequential architecture with four hidden layers of 16, 20, 20, 1, a learning rate of 0.018, and a ReLu-type activation function.
The training in the proposed ANN-MLP is adjusted for different epochs, and the error trend is evaluated. Figure 12 shows that the error tends to zero for 8500 epochs.
The procedure is similar to estimating glucose considering the current data set corresponding to the voltage level of -0.455 V. The proposed ANN-MLP architecture has two input layers: the electric current and the molar concentration. For the voltage level of -0.445 V it comprises four hidden layers of 12, 10, 10, and 1 neurons and an output layer corresponding to the glucose level estimation, as shown in Table 4. The activation function of the input layer is a Relu function, the learning rate of the classifier are defined as a constant equal to 0.018.
Input Layer | Hidden Layers | Output Layer |
---|---|---|
Current Measure, Molar Concentration | 12-10-10-1 | Molar Concentration Estimated |
The experimental value of glucose concentration is obtained by feeding the proposed ANN-MLP algorithm trained in real-time with a current value obtained from the electrochemical cell for a specific voltage value while performing cyclic voltammetry (Figure 8). Table 5 provides hyperparameter information for this model.
Hyperparameters | Proposed ANN-MLP |
---|---|
Kernel | Linear |
Optimizer | Adam |
Activation Function | Relu |
Error | MAE |
Epoch | 4500 |
Degree | 1 |
Learning Rate | 0.018 |
Bias | Boolean |
For the -0.445 V case, Table 6 shows the molar concentration data used for the second training of the proposed ANN-MLP at -0.455 V and the results obtained by the algorithm after training. It is observed that there is an average error of 0.0341 between the glucose concentration and the estimated value.
Experimental currents x10-8 (A) |
Glucose concentrations (µM) |
Glucose concentration obtained with ANN-MLP (µM) |
---|---|---|
-4.10 | 1 | 1.01725 |
-4.64 | 5 | 5.01976 |
-5.76 | 10 | 10.0197 |
-6.32 | 15 | 15.0241 |
-7.50 | 25 | 25.0483 |
-7.90 | 50 | 50.0492 |
-8.92 | 100 | 100.061 |
The results for this second training are similar to the previous ones. Figure 13 shows the final correlation between the proposed ANN-MLP training results and the experimental data. It is observed again that the red curve corresponding to the results obtained by the ANN tends to have a good fit with the blue curve corresponding to the input values, which indicates adequate algorithm training.
For this second training, the proposed ANN-MLP architecture changes to 10 hidden layers, a learning rate of 0.018, and the limit of the error that tends to zero reached its minimum value of 0.017 at 4500 epochs, as shown in Figure 14.
We can deduce the great advantage of incorporating machine learning algorithms into complex experimental systems from the results obtained. About Figure 10, to validate the machine learning algorithm, the two training sessions of the proposed ANN-MLP are compared, one for the set of current data corresponding to the voltage level of 1.3 V and another for the voltage level of -0.455 V for different glucose concentrations. It is observed that for the case of the voltage at 1.3 V, the current data are relatively easy to identify, unlike those presented for the voltage level of -0.455 V. For the obtained data at the point -0.455 V, the algorithm automatic learning is fed by two current values, one referring to the oxidation and the other to the reduction of glucose, eliminating the one with the lowest magnitude of current, because it is in the middle of the cyclic voltammetry. The increase in glucose presents a more significant negative current. On the other hand, the implementation acquisition and processing of the data at the 1.3 V point appears directly proportional to the positive current and the glucose concentration through a single current value, this being the maximum value, making the implementation of the algorithm more straightforward. The contribution of the system based on the training of the ANN-MLP is independent of the experimental conditions in which the information is found. Therefore, obtaining an ANN architecture according to the experimental system is feasible to facilitate manipulating information and obtaining results. In this experiment, an accuracy of 96.7 % is obtained for the model with 20 hidden layers and 97.8 % for the model with ten hidden layers, which indicates a good level of training of the proposed algorithms.
Conclusions
It is concluded that it is feasible to synthesize a higher resolution nanostructured sensor for glucose measurement in real-time in aqueous media, aided by machine learning algorithms. The implemented measurement system incorporates nanotechnology through an MWCNT-Cu nanostructured sensor, AI through the training of machine learning algorithms based on ANN-MLP, and digital electronics through ANN-MLP algorithms embedded in an ESP32 SoC . With these elements, a robust system that estimates the glucose level in real time of an aqueous medium in an oxidation-reduction process under cyclic voltammetry is integrated. The proposed method based on the current obtained by cyclic voltammetry saves time in data processing and increases its accuracy, therefore getting glucose concentrations more efficiently. This methodology allows the same CV to have two points of interest to compare and measure the glucose concentration in real-time, at -0.455V and 1.3V. The training of the ANN at the 1.3 V point resulted in an accuracy of 96.7 %, and the model implemented at -0.455 V reached an accuracy of 97.8 %. However, its operating and glucose measurement range was a maximum of 100 µM. For its part, with the data provided from the sensor at 1.3 V, it is possible to distinguish up to 250 µM, which validates the increased resolution of the synthesized sensor. This experimental system based on ANN-MLP training can consider other input variables, such as temperature or voltage scanning speed. Therefore, it is feasible to obtain an ANN architecture according to the experimental system to facilitate the manipulation of information and obtaining results.
From the point of view of technological development, future work considers optimizing the sensor proposed in this work (MWCNT-Cu) without considering the glass carbon electrode as a base. The goal is to develop a more compact and high-accuracy device. From the point of view of basic research, it is considered to improve the machine learning algorithm by including algorithms of the Echo State Network (ESN) type, which is one the most used methods in machine learning to predict complex dynamics, such as chaotic time series [23]. Implementing these algorithms with different topologies can help us predict the experimental behavior of some physical phenomenon in an experimental study under other circumstances.
Ethical statement
The authors declare no potential conflicts of interest with respect to the research, authorship, and / or publication of this article.
Author contributions
U.J.T.P. conceptualized and led the research, oversaw the experiments. X.A.A.G. carried out experiments and analyses, O.R.L.B. carried out analyses and validated the results. O.A.A.C. contributed to the design and implementation of A.I. algorithms and validated the results. E.V.V. interpreted and visualized the resulting data and participated in the reviewing and editing of the final manuscript. E.E.G.G. participated in the designed and development of methodology, carried out formal analyses and wrote the original draft. All authors reviewed and approved the final version of the manuscript.