Introduction

Human exhaled breath can be a useful indicator of a respiratory system problem. It contains inorganic molecules like oxygen, nitric oxide, carbon dioxide, and non-volatile substances like cytokines, leukotrienes, isoprostanes, and H2O2 as volatile organic compounds (VOC). Saturated hydrocarbons may be included in certain VOC. Sulfur, nitrogen, and oxygen are included as unsaturated hydrocarbons. Most breaths contain acetone, isoprene, methanol, ethanol, and other alkanes and alcohols (Lin et al. 2020). An average adult's exhaled breath contains 35,000 to 45,000 parts per million (ppm) of CO2, 100 times greater than what is found in the outside air (OSA) (Geetha et al. 2022). Abnormal CO2 levels could indicate an electrolyte imbalance in the body or difficulty in breathing. CO2 levels in the body that are too high or too low can suggest a range of health problems. In the intensive care unit, surgical room, critical care unit, neonate intensive care unit, and clinical environment, human CO2 helps doctors identify extubation outcomes, spot ventilation derangements, bronchospasm, and therapy effectiveness (Rasera et al. 2015; Jaffe and Orr 2010). To check and diagnose cardiopulmonary diseases like asthma, pulmonary embolism, COPD, pneumonia, and congestive heart failure, CO2 features like EtCO2, time spent at EtCO2, exhalation duration, respiratory rate, Hjorth parameters, area ratio, slope ratio, and end-exhalation slope can be used (Brown et al. 2013; Fabius et al. 2016; Maestri et al. 2013).

Many health issues are related to carbon dioxide (CO2), and hence CO2 detection with high accuracy and quickness is very important (Zhao et al. 2014). For example, end-tidal CO2 (EtCO2), which measures CO2 concentration at the breath ends, provides a non-invasive evaluation of the physical condition and hence a non-invasive method to diagnose chronic obstructive pulmonary disease (COPD), asthma, and cardiovascular disease (Mannino et al. 2002). Yaron et al. (1996) studied the alveolar slope parameter and measured the slope for 5 expired breaths in 18 asthmatic participants in a study for asthmatic patients before and after medication. Since then, it's been clear that the capnogram can be used to track inflammatory states in cardiopulmonary illnesses. Guthrie et al. (2007) used a microcap plus device (Oridion Capnograph, Israel) to measure EtCO2 in 16 asthmatic patients and concluded that non-invasive EtCO2 assessment at the bedside is possible in children with acute asthma. Nagurka et al. (2014) researched the effects of extreme (low and high) EtCO2 on 299 asthmatic patients. They suggested that early EtCO2 measurements might be used as a biomarker for asthmatic symptoms outside of the hospital setting. Furthermore, Kesten et al. (1990) looked at the RR association between 42 non-asthmatic patients and 47 asthmatic patients who were acutely unwell and concluded that during asthma attacks RR rises, consistent with Tidemandsen et al. (2021) and Kassabian et al. (1982).

CO2 in breath is currently measured using infrared detection technologies. While useful, humidity, present in both breath and air, causes significant interference with this technology. Furthermore, the infrared technique necessitates particular sample pre-treatments to minimize humidity, which increases the device's cost and limits its applicability in clinical settings (Zhao et al. 2014). As a result, a low-cost, simple-to-use, compact and accurate CO2 sensor is needed to track CO2 in human breath (Kumar and Krishnamoorthi 2021; Danckwerts et al. 1963). There are numerous CO2 analytical techniques in use today (Humphreys et al. 2021; Ottonello-Briano et al. 2020; Kostenko et al. 2021). To measure CO2, the capnograph instrument is widely used nowadays. A capnograph, or continuous plot of exhaled CO2 over time, uses infrared technology for non-invasive monitoring of CO2 in human respiration. However, because capnography is performed in an offline manner, these capabilities have not been included in capnography in a clinical environment. Furthermore, it is costly and inconvenient and has a poor estimation of lung ventilation and perfusion state (Williams et al. 2021). As a result, a lightweight, low-cost, precise, and quantitative CO2 measurement instrument is urgently needed. So, we present real-time CO2 monitoring equipment for human respiration that can be utilized for cardiorespiratory assessment in a user-friendly setting.

A detection method based on colorimetry, which recognizes CO2 based on the change in color of a pH-sensitive indicator, is an alternative to infrared sensing (Nakamura and Amao 2003; Elosua et al. 2006; Fernandez-Sanchez et al. 2007; Shivananju et al. 2013; Carvajal et al. 2010; Qamar et al. 2021). The colorimetric technique offers several advantages over infrared CO2 sensors, including simplicity, miniaturization, low cost, and humidity resistance, making colorimetric sensors an appealing technology. These sensors are appealing because they are often inexpensive, and fiber optics can be utilized as remote sensors. This opens the way for developing a new sensor range that can perform various in vivo and in vitro clinical evaluations (Humphreys et al. 2021). We examined a reversible colorimetric sensor based on pH and CO2 determination. The current device employs multi dyes to precisely monitor CO2 levels in humans at varying temperatures. Other than biomedical uses, CO2 detectors can be used for indoor air quality monitoring, landfill control, process control, and controlled environment horticulture.

Materials and methods

Materials required

CO2 gas, benzene (37% w/v), ammonia (25%), formaldehyde (99%w/v), ethanol (99.5%), hydrogen peroxide (30%), neutral red, and phenol red (2%), and m-cresol purple were obtained from Sigma-Aldrich, toluene (36–40% w/v), sodium hydroxide, and hydrochloric acid. All the chemicals used in the experiment were of analytical grade. Purified water for the experiment was supplied by the Millipore Milli-Q water system. A Biochrom UV–vis spectrophotometer carried out UV–vis spectroscopy characterization with a scanning range of 190–1100 nm. The dye samples were scanned at a medium scan speed in the 300–700 nm range. For characterization, a bandwidth of 2 nm and a step input of 1 nm was used.

Methods

Dye preparation and characterization

The studies were carried out using the solutions of 0.02 mM Neutral red, 0.01 mM Phenol red, and 0.07 mM m-Cresol purple. A UV spectrophotometer was used to perform the characterizations at ambient temperature. A graph between absorbance and wavelength was created after characterization and data assessment.

Optimization of kinetic parameters

The dye solutions were adjusted to acidic (4), neutral (7), and basic (10) pH to analyze how pH affected the results after the addition of 50 ppm CO2. After passing CO2, the solutions were heated to 50 °C to see if the dye system could be reused. Different concentrations of CO2 were added to the dye solution at room temperature and a certain pH to optimize the reaction condition. The dye solution was heated at different temperatures, and the temperature effect was also studied at specified pH. For selectivity analysis, 1 mL of 5 ppm ammonia, benzene, ethanol, ammonia, hydrogen peroxide, toluene, and formaldehyde was added to the dye solutions at room temperature and was observed for color change. The difference in absorbance was noted for understanding the concentration of the test solution, the temperature of the dye–biomarker mixture, pH, and the selectivity of the dye solutions.

Development of smartphone-assisted sensor prototype

IoT-based colorimetric sensor prototypes can be easily fabricated at a low cost. Using open-source hardware and software solutions, we developed a 3D printable, open-source colorimeter. Colorimeter detector assemblies are divided into the following three independent regions, namely the light source area, sample area, and color detector area. LEDs were used as the light source, which consisted of the following four different colors: red, blue, white, and green. After the light source area, there were three chambers dedicated to the sample zone. Each section was divided into three sections containing three cuvettes containing individual dye solutions. A 3D-printed protective case protected the sample zone, which was immediately followed by a detector zone with a color detector. To maximize repeatability, the light source, sample zone, and sensor were horizontally aligned, and the prototype was painted black to minimize reflections. Three cuvettes containing dye solution were placed in series one after another and were illuminated by the LED source. The color detector then intercepted the light transmitted from the sample zone. By analyzing the transmitted light, the detector represents the RGB values. When exposed to biomarkers, the dye solution changes color. With the sensor prototype connected to a device (LCD/smartphone) via Bluetooth, the detector identified color changes in dye solutions and displayed unique RGB values.

Results and discussion

CO2 (concentration ranging from 50 to 120 ppm) was added to dye solutions in an acidic, basic, and neutral medium and examined for any visible color change to create a highly sensitive colorimetric CO2 sensor. Furthermore, the dyes' response time, pH impact, temperature effect, concentration effect, and selective nature were investigated and assessed. Table 1 shows the list of notations that were utilized. P stands for pH, whereas x stands for a specific pH, T stands for temperature, and y stands for a specific temperature. The concentration of the analyte is denoted by the letter Z.

Table 1 List of notations used

Response time and pH effect

For the assay, CO2 (50–120 ppm concentration) was passed to the dye solutions with pH values of 4,7, and 10 at room temperature. The response time for the dyes was estimated by calculating the time from the addition of the CO2 to the corresponding visible color change observed in the dye solution. Neutral red, m-cresol purple, and Phenol red successfully detected CO2 (Table 2) only at pH 10. Moreover, each dye response time decreased with an increase in the CO2 concentration.

Table 2 Colorimetric detection of CO2 using different dyes

The color change in the neutral red dye solution after passing 50 ppm CO2 is shown in Fig. 1a, b. Figure 1a shows that with CO2, the color of the pH 10 neutral red dye solution tends to change from yellow to pink. For CO2 concentrations as low as 50 ppm, the color reaction of neutral red and CO2 was seen to be completed in 15 s. In the UV–vis absorbance spectra, the formation of a new absorption band centred at 533 nm with a.u.0.321 from 452 nm (a.u. 0.199) was detected (Fig. 1b).

Fig. 1
figure 1

CO2 detection using various pH-adjusted dyes at ambient temperature. a Before and after adding CO2 to a neutral red dye solution. b pH 10 neutral red dye solutions UV–vis absorption spectra. c Before and after adding CO2 to phenol red dye solution. d pH 10 phenol red dye solutions UV–visible absorption spectra. e Before and after adding CO2 to the m-cresol purple solution. f pH 10 m-cresol purple dye solutions UV–vis absorption spectra

For the CO2 concentration of 50 ppm, a visible color shift was observed in the pH 10 solution for the CO2 assay in the phenol red solution. The color shift in the phenol red solution after the addition of 50 ppm CO2 is shown in Fig. 1c. In a dye solution with a pH of 10, a visible color change from pink to yellow was noticed. With a rise in CO2 concentration, the response time of CO2 in the phenol red dye solution decreased, and the average response time was calculated to be 15 s. Figure 1d shows a change in the peak of the dye solution during the UV analysis from 558 nm (a.u. 0.688) to 431 nm (a.u. 0.231).

The color shift in the m-cresol purple solution after adding 50 ppm CO2 is shown in Fig. 1e. Within 10 s, a visible color change from purple to yellow was noticed in the dye solution at pH 10, with a peak shift (Fig. 1f) from 577 (0.536 a.u) to 435 nm (0.352a.u). At a concentration of CO2 as low as 50 ppm, the apparent color shift may be identified, providing a simple way to detect CO2 with the naked eye. The following might be the chemical reaction behind the color change in the case of m-cresol purple with CO2 (Elhadd et al. (2020); Rini et al. 2004; Roberts and Danckwerts 1962; Sha et al. 2022).

$${\text{CP}}^{{{2} - }} \left( {{\text{purple}}} \right) \, + {\text{H}}_{{2}} {\text{O}} + {\text{CO}}_{{2}} \leftrightarrow {\text{ CP}}^{{{2} - }} \left( {{\text{purple}}} \right) \, + {\text{H}}_{{2}} {\text{CO}}_{{3}} \leftrightarrow {\text{ CPH}}^{ - } \left( {{\text{yellow}}} \right) + {\text{HCO}}_{{3}}{^{ - }}$$
(1)

At varied pH levels in each dye, data were evaluated both before and after the CO2 was passed to the dyes. After adding CO2 at pH 10, these UV–Vis tests using neutral red revealed a bathochromic effect. The existence of the auxochrome (CO2), which may alter solvent polarity, may be the reason for the change in absorbance to a longer wavelength. The noticeable color shift provides a simple method for detecting CO2 with the naked eye. The UV analysis revealed hypsochromic shift in the cases of phenol red solution and m-cresol purple solution as demonstrated by a change in spectral band position in the absorption spectrum to a shorter wavelength (Geetha et al. 2022). The color of m-cresol purple showed two absorption peaks. This occurrence frequently occurs in highly conjugated systems. Nevertheless, it is frequently solvent-dependent and may result from electronic transitions between the various vibrational energy levels that each potential electronic state can support (Sha et al. 2022).

Reusability

The most challenging aspects of conventional sensors based on color changes are recyclability and reusability. For cost-effectiveness and environmental safety, the sensor's reusability is crucial. Visual colorimetric sensors based on reusable substrates are well-suited for the on-site detection and monitoring of CO2. After passing CO2, the dye solutions were heated to 50 °C, and color change was observed. It is possible to eliminate the CO2 from the solution by boiling it. As a result, the reusability of the sensor can be tested by heating the dye solution. After 20 to 30 min of heating at 50 °C, neutral red, phenol red, and m-Cresol purple return to their native color, as seen in Fig. 2. The dye-loaded adsorbent was regenerated using microwave heating in a previous study by Arabkhani et al. (2021).

Fig. 2
figure 2

Reusability study of the dye solutions in the order of, at pH 10 (P10), with CO2 (P10 CO2), after heating (P10CO2H), and the corresponding UV–vis absorbance spectra respectively in each row. a Neutral red solution, b phenol red solution, c m-cresol purple solution

Temperature effect

When the temperature of the surrounding medium fluctuates, any biosensor should be able to keep its detecting system stable. The stability of the dye system and the physical dimension of the molecule are affected by temperature. Temperature changes raise vapo pressure while lowering response and sensitivity. As a result, the temperature should have no impact on a reliable sensor system. To study the temperature effect, the dye solutions were heated to different temperatures: 25, 50, 75, and 100 °C, and CO2 (50 ppm) was passed to the dye solutions. The absorption intensity remained almost constant for all dye solutions, regardless of temperature variations (Fig. 3).

Fig. 3
figure 3

Temperature effect of dye solutions at 25, 50, 75, and 100 °C with CO2 (50 ppm)

Phenyl red has an absorbance variance of 0.2327 ± 0.0099, while neutral red has an absorbance variation of 0.1018 ± 0.2185, according to the findings. Cresol purple's absorbance changed similarly, near 0.9302 ± 0.0794. This implies that the multisensor system is extremely stable, which is ideal for the envisioned colorimetric sensor's real-time application. Previously, the same procedure was used to determine the temperature effect of dye-based acetone sensors, and it was discovered that temperature does not affect the dye (Sha et al. 2022).

Sensitivity analysis

Various CO2 concentrations (50–120 ppm) were administered to dye solutions at room temperature to evaluate the concentration effect of dyes (Fig. 4). When the influence of concentration was investigated, it was observed that color change happened more quickly for all dye solutions when the CO2 was in higher concentration. Beer–Lambert law states that absorbance and concentration have a linear relationship, which can be used to predict the concentration of a solution by measuring its absorbance. The absorbance against concentration is plotted on a linear calibration curve (Fig. 4).

Fig. 4
figure 4

CO2 calibration plot for a Neutral Red, b Phenol Red, and c m-cresol purple

The LOD (Limit of Detection) was calculated using the 3σ/m, where m is the slope calibration plot and σ is the intercept's standard deviation which gives the lowest concentration of an analyte that can be reliably detected in a sample.

The peak absorbance of the dye was used to create the calibration curve. Figure 4 displays the CO2 calibration curve. Neutral red's LOD was calculated to be 7.11 ppm [y = (2.52371) x + (0.39962 ± 5.598303); R2 = 0.99998]. The calibration curve for phenol red was plotted from 50 to 120 ppm, precisely like it was for neutral red. The phenol red dye has a LOD of 5.03 ppm for CO2 sensing, according to the linear fit [y = (3.74661) x + (0.2742 ± 6.2796); R2 = 0.9991]. Cresol purple's calculated LOD was 1.98 ppm [y = (6.53794) x + (0.89636 ± 4.32236); R2 = 0.99745]. According to the sensitivity analysis, these three dye systems have a high sensitivity to CO2, with a detection limit as low as 1.98 ppm.

Selectivity analysis

To ensure the sensor's selectivity and specificity, additional test solutions representing various biomarkers in breath, like hydrogen peroxide, ammonia, toluene, benzene, formaldehyde, and ethanol were added to the dye solutions. The concentration of the test analyte was 5 ppm, and dye solutions were tested at room temperature before being subjected to UV–vis absorption measurement. All dye solutions were very selective toward CO2, according to the findings. The CO2 selectivity of the dye was confirmed by using the equation below to calculate the relative change in wavelength (∆λ) from UV–vis analysis.

$$\left(\Delta\lambda \right)=\frac{{\lambda_{\text{x}}}-{\lambda_{0}}}{{\lambda_{0}}}\times 10,$$
(2)

where λX is the wavelength of absorbance peak in the presence of the analyte and λ0 is the wavelength of maximum absorbance in the blank solution. At pH 10 the value is estimated for neutral red, m-cresol purple, and phenol red.

Only the matching biomarkers were detected by the dye solutions (Fig. 5). These findings suggest that other interfering chemicals had little or no effect on CO2 colorimetric detection.

Fig. 5
figure 5

Selectivity analysis of biomarkers in different dye solutions: a neutral red dye solutions, b phenol red, and c m-cresol purple

Real-time evaluation and validation of the proposed colorimetric method

A portable prototype device with full CO2 detection capabilities was created (Fig. 6). When exposed to CO2, the sensor prototype revealed unique RGB values using dyes as sensing elements.Three dyes were chosen to detect CO2 at a concentration of 50 ppm in the first method, and the RGB values obtained are shown in Table 3.

Fig. 6
figure 6

a Schematic of the fabricated sensor prototype, illustrating that the dye system triggered a colorimetric array and smartphone-interfaced unit to detect CO2 levels. b Real image of the developed sensor prototype

Table 3 Analysis of CO2-dye mixture using sensor prototype at 50 ppm CO2 concentration (X1 = 50 ppm)

CO2 in various concentrations using the sensor prototype in various dyes was examined in the second approach. The RBG values for various CO2 concentrations in various colors are presented in Table 4.

Table 4 Analysis of CO2 in different concentrations with the dyes using sensor prototype

These tests show that we can create a unique RGB chart for every dye solution in the same way. These tests demonstrated that this sensor prototype could detect the presence and concentration of CO2 and its concentration using RGB values (Table 5).

Table 5 CO2 concentrations and corresponding health status

The proposed colorimetric approach is far more cost effective than traditional detection methods in terms of cost. Our IoT-based prototype is more cost-effective instead of these expensive and heavy-duty devices (Fig. 7).

Fig. 7
figure 7

Comparison of real-time measurement of CO2 concentration in human breath measured at rest using optical fiber probe and colorimetry

A real-time measurement of CO2 concentration in human breath in 1 min shows the concentration in the range of 12,000 to 35,000 ppm in optical fiber probe (Katagiri et al. 2018) and 12,200 to 36,000 ppm in this developed sensor prototype. These figures show that this novel colorimetric CO2 detection and quantification method would be a more precise analysis method. It can take the place of a variety of heavy-duty instruments that serve the same purpose. The sensor prototype is lightweight and may be used with any Bluetooth device (Table 6).

Table 6 Summary of various non-invasive sensors used for the breath CO2 analysis

Conclusions

A non-invasive colorimetric sensor to measure CO2 in exhaled breath was invented for biomedical applications. In terms of pH effect, response time, reusability, concentration impact, and temperature effect, a highly selective dye system for determining CO2 levels was developed. Using dye solutions as sensing elements we constructed a low-cost and portable fully functional IoT-based prototype device for breath biomarker detection was created. We detected CO2 using the suggested multi-dye method with a detection limit of 1.98 ppm. With this apparatus, we can quickly anticipate the CO2 level. This novel method has a great deal of potential as a visual sensor platform in the fields of environmental and biological chemistry. This very sensitive and discriminating colorimetric sensor comes with a smartphone-assisted tool for measuring the concentration of visual biomarkers. Our sensor can also be applied to controlled environment horticulture, landfill monitoring, process control, and interior air quality monitoring, among other things.