Open Access Article
This Open Access Article is licensed under a
Creative Commons Attribution 3.0 Unported Licence

A highly sensitive and reliable pH sensor based on a polyaniline-nickel hydroxide modified nickel foam electrode: electrochemical and DFT investigations

Mirazul Islam a, Md. Sanwar Hossain a, N. Padmanathan b, Kafil M. Razeeb *b and Mamun Jamal *a
aDepartment of Chemistry, Khulna University of Engineering & Technology, Khulna 9203, Bangladesh. E-mail: mamun.jamal@chem.kuet.ac.bd
bMicro-NanoSystems Centre, Tyndall National Institute, University College Cork, Dyke Parade, Lee Maltings, Cork T12 R5CP, Ireland. E-mail: kafil.mahmood@tyndall.ie

Received 1st August 2025 , Accepted 10th September 2025

First published on 24th September 2025


Abstract

In this study, a highly porous three-dimensional (3D) pH sensor was developed using polyaniline (PANI)-modified nickel hydroxide-coated nickel foam (NF/Ni(OH)2/PANI). The fabrication process involved the electrodeposition of nickel hydroxide onto nickel foam, followed by heat treatment and subsequent electropolymerisation of aniline at a constant current. The structural and morphological properties of the NF/Ni(OH)2/PANI electrode were analysed using field emission scanning electron microscopy (FSEM), X-ray photoelectron spectroscopy (XPS), Fourier transform infrared spectroscopy, and Raman spectroscopy. FESEM images show oblate and spherical particles of NF/Ni(OH)2/PANI, while XPS analysis confirms the elemental composition and the presence of different chemical bonds. The pH response was evaluated via open-circuit potential measurements, revealing a sensitivity of 46.00 mV per pH (R2 = 0.99) over the pH range of 3 to 11. The sensor demonstrated excellent stability, reproducibility, and minimal drift, ensuring reliability for practical applications. Real sample analysis using vinegar, orange juice, and baking soda solutions confirmed the sensor's accuracy, showing strong correlation with commercial pH meters. Additionally, density functional theory calculations were performed to investigate the interaction energy between PANI and H3O+ ions, revealing increasing binding affinity with longer PANI chain lengths (−68.01, −159.72, and −682.78 kJ mol−1 for 1PANI, 2PANI, and 4PANI, respectively). HOMO–LUMO energy gap analysis further supported the electronic interactions governing the sensing mechanism. This combined experimental and theoretical approach confirms the potential of the NF/Ni(OH)2/PANI sensor for real-time assessment in food safety, environmental monitoring, and biomedical analysis.


1. Introduction

Three-dimensional (3D) pH sensors represent a great advancement in electrochemical pH sensing, offering superior sensitivity, precision and responsiveness in complex environments compared to traditional 2D sensors.1 After incorporating porous or nanostructured materials, 3D sensors maximise the surface area and ion accessibility, thereby further improving the responsiveness and accuracy of the sensor.2 These sensors are increasingly vital in biotechnology, environmental monitoring, and industrial processes where accurate and real-time pH measurement is critical.3 It is essential to monitor and maintain the pH level in the food industry, as it directly affects flavor, shelf life, and microbial activity.4–6 Accurate pH monitoring ensures consistency and safety, particularly in fermented items like cheese, yoghurt, beverages, and various other processed foods.7,8 Conventional pH sensors including glass electrodes suited to liquid only,9 solid-state sensors like ISFETs,10,11 and optical pH sensors for non-invasive detection are being used widely.12,13 However, these technologies often face challenges such as fragility, high cost, or limited adaptability in dynamic environments.14,15

Conductive polymers, especially polyaniline (PANI), have emerged as attractive alternatives for pH sensing due to their protonation–deprotonation responsiveness, chemical stability, and ease of synthesis.2,16 In addition, PANI-based sensors offer fast response, high sensitivity, and wide detection ranges. Despite their advantages, PANI-modified sensors may require regular calibration and maintenance to account for environmental sensitivities and potential degradation over time.17 Nevertheless, their cost-effectiveness and versatility make them a valuable tool in a variety of applications. In 2019, Jamal et al. developed a flexible pH sensor using tungsten oxide nanoparticle-modified carbon fibre cloth, achieving a linear response over the pH range of 3–10 with a sensitivity of 41.38 mV per pH.18 Another scientist, Zhao et al. developed a PANI-based 3D pH sensor, which exhibited a sensitivity of 69.33 mV per pH within the physiological pH range of 4 to 9 in a sweat sample.19 N. Padmanathan et al. reported a 3D nickel phosphate nano/microflake electrode for energy storage and sweat pH sensing, demonstrating high sensitivity and multifunctional performance.20 Also, Najafi Khoshnoo et al. introduced a 3D wireless pH sensor system for health monitoring, which shows 51.76 mV per pH sensitivity.21 Kim et al. developed a pH sensor for real-time sweat monitoring on the human body based on a polyaniline/graphene (PANi–Gr) electrode, demonstrating a Nernstian sensitivity of 61.91 mV per pH.22 Wang et al. introduced an ultra-flexible nanofibre pH sensor that was developed by electrodepositing PANI onto gold fibres, achieving a sensitivity of 60.6 mV per pH within a pH range of 4 to 8.23 These developments highlight the potential of polyaniline-based pH sensors for flexible, affordable, and highly sensitive applications in healthcare and environmental monitoring.

Nickel foam (NF) is widely used in advanced pH sensors due to its 3D porous structure, high conductivity, and durability, making it ideal for harsh environments and long-term food monitoring.24 Its large surface area significantly improves sensitivity and enhances the response time. In food applications, NF provides mechanical strength, flexibility, and minimal electrical interference.25 Surface modifications improve stability and detection limits.26–28 However, traditional noble metal coatings can lead to Ni(OH)2 formation and electrode poisoning, reducing the active surface area and sensor performance. On the other hand, Ni(OH)2-based pH sensors provide high sensitivity and stability in alkaline environments but suffer from limitations like acidic instability and surface fouling, which can be mitigated by incorporating conductive polymers or carbon-based materials.29,30

Density functional theory (DFT) is a powerful quantum mechanical modelling tool that helps understand the electronic structure and properties of materials at the atomic level.31 In pH sensing, DFT enables the evaluation of charge distribution, energy levels, and proton interaction mechanisms, particularly the effect of protonation on conductive polymers like PANI. Such theoretical insights are critical for optimising electrode design and correlating experimental performance with molecular-level behaviour.32

In this work, we introduce a novel 3D pH sensor based on NF/Ni(OH)2/PANI, fabricated via a two-step method—electrodeposition of Ni(OH)2 and electropolymerisation of aniline. The sensor showed a reliable performance over a wide pH range, with strong alignment with commercial sensors in real sample analysis. DFT simulations elucidated the electronic interactions governing the sensitivity and selectivity, offering a robust, low-cost solution for real-world pH monitoring in environmental and food quality applications.

2. Experimental section

2.1 Reagents and materials

Aniline (C6H5–NH2), sodium sulfate (Na2SO4), and hydrochloric acid (HCl) were purchased from E-Merck, Germany. Ammonium chloride (NH4Cl), nickel chloride (NiCl2), and potassium hydroxide (KOH) pellets were purchased from Sigma Aldrich, USA. Sodium dihydrogen phosphate (NaH2PO4·2H2O), disodium hydrogen phosphate (Na2HPO4), sodium bicarbonate (NaHCO3), sodium carbonate (Na2CO3), and sodium hydroxide (NaOH) pellets were purchased from Junsei, Japan. Conducting wire was purchased from Khulna Hardware Store, Bangladesh. Nickel foam (NF) and the conducting glue were purchased from Sigma Aldrich, Ireland. A variety of buffer solutions including phosphate, carbonate, and acetate were prepared. All chemicals were of analytical grade with high purity and were used as received. Ultrapure millipore water (∼18.2 MΩ cm) was employed in all experiments.

2.2 Modification of NF/Ni(OH)2

First, NF was cut into a size of 1 cm × 0.5 cm and sonicated in 6 M HCl for 5–10 minutes to remove the surface oxide layer. Furthermore, NFs were washed with deionised water and ethanol to remove ionic and organic contaminants, followed by air drying. The NF was connected to the copper wire using conducting silver glue, and the connecting part of the electrode was covered in an inert insulating polymer. A two-electrode cell was used, with NF as the working electrode and platinum wire as the counter electrode to deposit nickel hydroxide on NF. A steady current of 10 mA was applied for 700 s in a solution comprising 1 M NH4Cl and 0.05 M NiCl2. The nickel hydroxide-modified nickel foam (NF/Ni(OH)2 electrode) was then rinsed with deionised water multiple times to eliminate any unreacted ionic compounds before being dried in an oven at 45–50 °C for 60 minutes to obtain NF/Ni(OH)2.

2.3 Electropolymerisation of PANI on NF/Ni(OH)2

To modify the NF/Ni(OH)2 electrode with polyaniline, a three-electrode cell was used, with NF/Ni(OH)2 as the working electrode, Ag/AgCl as the reference electrode, and platinum wire as the counter electrode. Polyaniline was electropolymerized by applying a constant current of 5 mA to NF/Ni(OH)2 against an Ag/AgCl electrode in a solution of 0.1 M aniline and 0.5 M Na2SO4 for 1400 s. The polyaniline modified electrode NF/Ni(OH)2/PANI was rinsed several times with deionised water, and then air dried for 2 hours.
image file: d5ma00830a-s1.tif
Scheme 1 Modification process of NF/Ni(OH)2/PANI and its application to determine pH.

2.4 Characterization

The morphology of the electrode materials was studied using a field-emission scanning electron microscope (model: FEI QUANTA 650) equipped with energy-dispersive X-ray spectroscopy (EDX Oxford Instruments INCA energy system). Fourier transform infrared (FT-IR) spectra were recorded with an IRTracer-100 (SHIMADZU) and Raman spectra were recorded using a Renishaw (RA100) via a confocal Raman microscope at an excitation laser wavelength of 514.5 nm. X-ray photoelectron spectroscopy (XPS) (Kratos AXIS ULTRA) was used to investigate the elemental content and oxidation state.

2.5 Electrochemical study

All electrochemical measurements were performed with a BioLogic potentiostat/galvanostat (model: SP-300). A typical electrochemical cell was assembled with an NF/Ni(OH)2/PANI electrode as the working electrode, Ag/AgCl (3 M KCl) as the reference electrode and Pt wire as the counter electrode in a 1 M KOH solution.

2.6 Computational method

Computational studies were carried out using Gaussian 9, Revision C.01 series of programs.34 The energy of geometries, Mulliken charge and IR were calculated using the DFT-PBEPBE/6-311+G(d,p) level of theory. The structure of PANI was fully optimized and molecular orbital analysis (i.e. HOMO and LUMO) was done using DFT-B3LYP/6-311+G(d,p).

3. Results and discussion

3.1 Field emission scanning electron microscopy (FESEM) study

A schematic diagram shows the overall fabrication process of NF/Ni(OH)2/PANI electrode and its application to determine pH (Scheme 1). The FESEM images of NF, NF/Ni(OH)2, and NF/Ni(OH)2/PANI are shown in Fig. 1. The porous and 3D structure of bare NF is depicted at different magnifications in Fig. 1(a) and (b). These images show that the surface of the bare foam is smooth. After modifying NF with Ni(OH)2, the FESEM images of the NF/Ni(OH)2 composite are presented in Fig. 1(c) and (d). In Fig. 1(d), sphere-like particles can be seen growing on the NF surface, with their average particle size measured as 83.4 nm. Following the electropolymerisation of aniline on the NF/Ni(OH)2 surface, the FESEM images of the modified NF/Ni(OH)2/PANI are shown at lower and higher magnifications in Fig. 1(e) and (f). Oblate and spherical particles are observed on the NF/Ni(OH)2 surface, distinctly different from the structures of bare NF and NF/Ni(OH)2. The average size of the oblate particles is approximately 67 nm, while the spherical particles are around 70 nm in diameter.
image file: d5ma00830a-f1.tif
Fig. 1 FESEM images of (a) and (b) NF, (c) and (d) NF/Ni(OH)2, (e) and (f) NF/Ni(OH)2/PANI and EDAX spectrum of (g) NF, (h) NF/Ni(OH)2 and (i) NF/Ni(OH)2/PANI, respectively.

The EDX spectra of bare NF, NF/Ni(OH)2, and NF/Ni(OH)2/PANI are shown in Fig. 1(g)–(i). The EDX spectrum of Fig. 1(g) shows that nickel (Ni) is the primary element present, consistent with the composition of NF. In Fig. 1(h), the presence of both nickel (Ni) and oxygen (O) atoms indicates the successful growth of Ni(OH)2 nanoparticles on the NF surface. In Fig. 1(i), the EDX spectrum of the NF/Ni(OH)2/PANI electrode shows key elements such as carbon (C), oxygen (O), nickel (Ni), and nitrogen (N), confirming the presence of both PANI and Ni(OH)2. This suggests that Ni(OH)2 and PANI are sequentially deposited on the NF surface, forming a bilayer membrane. Further analysis through FT-IR, Raman, and XPS supports this conclusion.

3.2 Functional group analysis by FT-IR & Raman spectroscopy

The functional groups of the molecular structures of NF/Ni(OH)2 and NF/Ni(OH)2/PANI were investigated using FT-IR spectroscopy (Fig. 2(a)). The sharp band at 3200–3600 cm−1 corresponds to the stretching mode of hydrogen-bonded hydroxyl groups in Ni(OH)2, while the broad band at 1614 cm−1 reflects the bending vibration of interlayer water or the C[double bond, length as m-dash]C stretching of the quinoid or benzenoid rings. A strong band at 1120 cm−1 is due to surface-adsorbed nitrate ions (NO3).33,34 The M–O bond vibrations occur below 1000 cm−1, with a sharp band at 623 cm−1 attributed to the Ni–O and Ni–O–Ni vibrations in the layered structure.35 Furthermore, the C[double bond, length as m-dash]C stretching of the quinoid ring, the C[double bond, length as m-dash]C stretching of the benzenoid ring, and the C–N stretching of the benzenoid unit correspond to the significant peaks of the PANI-based electrode at 1624, 1475, and 1292 cm−1 respectively, in NF/Ni(OH)2/PANI.36 PANI-modified NF/Ni(OH)2 peaks at 1097 cm−1 correspond to the C–N stretching of the quinoid unit and the C–H out-of-plane bending vibration (Fig. 2(a)). There were further bands at 3435 cm−1 that demonstrated hydrogen bonding.15 The stretching vibration band of aromatic C–H was observed at 2910 cm−1.37 The FT-IR analysis confirms the presence of Ni(OH)2, surface-adsorbed nitrate ions, and distinct PANI-related functional groups in the NF/Ni(OH)2/PANI structure, indicating successful modification and interaction between the components.
image file: d5ma00830a-f2.tif
Fig. 2 (a) FT-IR spectrum of NF/Ni(OH)2/PANI and (b) Raman spectrum of NF/Ni(OH)2/PANI.

The Raman spectra of the NF/Ni(OH)2 and NF/Ni(OH)2/PANI electrodes were recorded by applying 514.5 nm excitation (Fig. 2(b)). The stretching modes of various bonds are shown by the bands that emerged in the Raman shift range of 1300–1600 cm−1. The C–C stretching vibration of the benzene ring is allocated to the Raman band at 1583 cm−1. N–H deformation vibrations are ascribed to the band at 1558 cm−1. The band at 1338–1350 cm−1 offers information regarding carrier vibrations in the C–N polaronic structure of PANI.38 Furthermore, a weaker Ni–OH peak at 540 cm−1 demonstrates the presence of Ni(OH)2 in the NF/Ni(OH)2/PANI electrode.39 The result further proves that NF has been successfully modified with the PANI/Ni(OH)2 composite membrane.

3.3 X-ray photoelectron spectroscopy (XPS) analysis

The XPS survey spectrum of NF, NF/Ni(OH)2 and NF/Ni(OH)2/PANI are shown in Fig. 3(a). This survey depicted the core level spectrum of Ni 2p, O 1s, C 1s, and N 1s, indicating the presence of the following elements. The core level spectra of the Ni 2p orbital are illustrated in Fig. 3(b) of NF/Ni(OH)2/PANI which consists of two spin–orbit doublets at binding energy (BE) values of 856.5 and 874.3 eV, with a spin energy separation of 17.8 eV, that can be assigned to Ni 2p3/2 and Ni 2p1/2 components, respectively.20,40 A careful peak fitting was made for the Ni 2p3/2 component, which indicates that it can be deconvoluted from peaks located at 856.3, the BE value reported for Ni2+. The presence of Ni2+ on the surface of NF might arise from the surface oxidation of Ni(OH)2 during electrodeposition. In addition, the O 1s spectra of PANI/Ni(OH)2/NF is shown in Fig. 3(c). The peaks the binding energies of 531.6 eV and 532.2 eV correspond to the presence of lattice oxygen and the C–O functional group. Furthermore, 532.6 eV is assigned to the typical band of oxygen in metal oxides (M–O), whereas the peak at 533.3 eV corresponds to hydroxides (M–OH), consistent with previous reports on Ni(OH)2.41 In the core level spectra of C 1s, the peak at 284.6 eV corresponds to the C–C/C[double bond, length as m-dash]C bonds of the aromatic ring of PANI, whereas the peak at 285.7 eV is due to the C–N/C–NH groups, which confirm nitrogen incorporation. Additional peaks at 286.6 and 288.7 eV are caused by C–O and C[double bond, length as m-dash]O groups, which are most likely from the polymer oxidation or surface oxygen species. Additionally, a weak π–π* shake-up peak around 291 eV indicates that the conjugated structure is intact.42 With binding energies of 398.1, 399.5, and 400.9 eV, the high-resolution N 1s spectra of NF/Ni(OH)2/PANI indicate the existence of [double bond, length as m-dash]N–, –NH–, and N+ groups, respectively (Fig. 3(e)).43 Thus, the elemental composition of polymers on NF is confirmed by XPS.
image file: d5ma00830a-f3.tif
Fig. 3 (a) XPS survey spectrum of NF, NF/Ni(OH)2, NF/Ni(OH)2/PANI, and the high-resolution spectrum of (b) C 1s, (c) N 1s, (d) Ni 2p, and (e) O 1s.

3.4 pH sensitivity and reproducibility

The pH sensitivity of the NF/Ni(OH)2/PANI electrode was investigated by measuring the open-circuit voltage (OCV) across various buffer solutions with pH values from 3 to 11 (Fig. 4(a)). The sensor demonstrated a stable and effective response to H3O+ ions, attributed to the amino (–NH2) groups in the polymeric structure of polyaniline (PANI), which interact efficiently with protons.
image file: d5ma00830a-f4.tif
Fig. 4 (a) Potential response of NF/Ni(OH)2/PANI at different pH values (3–11) in 0.1 M buffer solution, and (b) the corresponding linear relation plot of pH (3–11), (c) reproducibility, and (d) potential drift measurements.

The relationship between pH and OCV is defined by the Nernst equation, which connects both pH and the concentration of H3O+ ions in a solution and, consequently, to the electrode's oxidation–reduction potential. In this equation, E0 represents the standard electrode potential, R represents the gas constant, T represents the absolute temperature, and F represents the Faraday constant:

image file: d5ma00830a-t1.tif

Simplifying with base-10 logarithms at standard conditions, we get:

E1 = E0 + 0.0591[thin space (1/6-em)]log[H3O+]

Phosphate buffer solution (0.1 M) was employed to study the pH response of the NF/Ni(OH)2/PANI electrode. The OCV measurement of NF/Ni(OH)2/PANI is demonstrated at a pH range of 3–11, which revealed that the equilibrium potential of the sensor stabilized within 160 seconds over the pH range, as shown in Fig. 4(a). The NF/Ni(OH)2/PANI electrode maintained a sensitivity of 46 mV per pH with a high correlation (R2 = 0.99), equivalent to 77.7% of the theoretical Nernst response (59.2 mV per pH), as illustrated in Fig. 4(b). This close-to-linear response verifies the consistency of the sensor functionality in response to H3O+ ion concentrations across a range of pH levels. To evaluate the stability of the NF/Ni(OH)2/PANI electrode, drift measurements were performed in buffer solutions with pH values of 5, 7, and 10, with OCV readings taken over one hour at 10-minute intervals (Fig. 4(c)). The electrode stabilized within the first 10 minutes and subsequently maintained a steady potential. Drift values recorded were 2.34 mV in a neutral buffer (pH 7), 2.71 mV in an acidic buffer, and 2.90 mV in a basic buffer, demonstrating excellent stability across different pH environments. Fig. 4(d) demonstrates the reproducibility of two sensors, showing a consistent response range from pH 3 to 11 and a sensitivity range between 46 and 47 mV per pH. The sensors exhibit a low relative standard deviation (RSD) of 2.65%, yielding an average sensitivity of 46.5 mV per pH, indicating that the NF/Ni(OH)2/PANI electrode provides stable performance regardless of potential variations.

We also measured the pH sensitivity of bare NF, Ni(OH)2/NF, and PANI/NF electrodes within the same pH range using 0.1 M phosphate buffer solutions (Fig. S1–S3). Notably, these electrodes did not exhibit a linear response or follow the Nernst equation, suggesting the inability to detect H3O+ ions (Fig. S1b). We have developed a reproducible and precise NF/Ni(OH)2/PANI-based pH sensor and demonstrated its robust OCV response across a wide pH range, as well as its high sensitivity, stability, and linear response, positioning it as a promising candidate for practical pH sensing applications.

3.5 Real sample analysis

To assess the real-sample applicability of the NF/Ni(OH)2/PANI electrode, the pH of vinegar, orange juice, and a baking powder solution was measured and compared with the values obtained from a standard glass pH sensor. The commercial sensor recorded pH values of 3.0, 4.4, and 8.1 for vinegar, orange juice, and baking powder, respectively, while the NF/Ni(OH)2/PANI electrode produced values of 2.8, 3.8, and 8.0 (Fig. 5(a)). These findings confirm that the results from the NF/Ni(OH)2/PANI electrode closely align with those of the conventional glass electrode (Fig. 5(b)). To further validate the sensor's functionality, the open-circuit voltage (OCV) of the NF/Ni(OH)2/PANI electrode was recorded in a neutral buffer (pH 7) across a temperature range of 28–36 °C (Fig. S4). The results showed minimal influence of temperature variations on sensor performance, indicating that the electrode provides reliable readings under typical laboratory conditions.
image file: d5ma00830a-f5.tif
Fig. 5 OCV of the real sample test of vinegar, orange, and baking powder and (b) comparison of an NF/Ni(OH)2/PANI pH sensor with the commercial pH sensor. Image of the real sample test (d) vinegar, (e) orange and (f) baking powder.

Images of the experimental setup for the pH measurements of the orange juice, vinegar, and baking powder solutions are shown in Fig. 5(c)–(e). In each setup, the NF/Ni(OH)2/PANI working electrode and an Ag/AgCl reference electrode were connected to a multimeter to record the OCVs. The potential differences measured were 176.3, 87.6, and −46.6 mV for vinegar, orange juice, and baking powder, respectively. For comparison, the commercial glass pH meter recorded pH values of 3.1, 4.4, and 8.1, aligning closely with the value of the NF/Ni(OH)2/PANI electrode. The NF/Ni(OH)2/PANI electrode demonstrates reliable and accurate pH measurements across a range of sample types, comparable to a commercial pH sensor. Additionally, its minimal sensitivity to temperature fluctuations confirms its suitability for routine pH measurements in laboratory settings. In Table 1, the NF/Ni(OH)2/PANI pH sensor is compared with recently developed pH sensors.

Table 1 Sensing performance of different pH sensors
Electrode/sensing material pH range Sensitivity (mV) Ref.
PANI/H2SO4 + CTAB 3–8 41.3 44
PANI-NWs-ITO 3–9 48 45
LBL/(PANI-GA)/GO 2–7 35.1 46
PANI + carbon nanofibre membrane 6.3–8.3 76.2 47
Gold/CuO NFs 2–11 28 48
AQ sulfonate/GCE 2–10 38 49
Thick film/RuO2 4–10 30 48
IrO2/G 3–8 79 50
PANI/Ni(OH)2/NF 3–11 47 This work


3.6 Optimized geometry and interaction energy calculation

Optimized structures of polyaniline (PANI) and its protonated form (PANI–H3O+) were obtained through density functional theory (DFT) calculations at the B3LYP/6-311+G(d,p) level.51,52 The smallest oligomers, containing 1, 2, and 4 repeating PANI units, were optimized, as shown in Fig. S4. Interaction energies were calculated for each PANI oligomer in complex with H3O+, using the method outlined in eqn (2).6,53 The computed interaction energies were −68.010, −159.721, and −682.785 kcal mol−1 for the PANI–H3O+, 2PANI–H3O+, and 4PANI–2H3O+ systems, respectively. These results reveal that as the polymer size increases, the interaction energy values become more negative, indicating stronger binding interactions with H3O+. This trend is consistent with the experimental findings, which highlight the enhanced selectivity of the conducting PANI polymer for H3O+ ions. The decrease in interaction energy values with an increase in polymer size also suggests potential hydrogen bonding between the PANI structure and H3O+ ions, facilitated by proton transfer from H3O+. This strong interaction supports the effectiveness of PANI as a selective sensor material for H3O+ detection. As summarized in Table S2, these interaction energy trends further confirm the theoretical prediction that larger PANI models exhibit enhanced affinity for H3O+ ions (eqn (1) and (2)).
 
PANI + nproton = protonated PANI(1)
 
ΔEint = Eproduct − (Ereactant1 + Ereactant2)(2)

The optimized geometries of PANI oligomers, including structures with 1, 2, and 4 repeating units, are illustrated in Table S2 and Fig. S5. These optimizations provide detailed geometrical parameters, such as bond lengths, bond angles, and dihedral angles. During the pH sensing process, significant structural changes occur in key bond lengths and angles near the reaction site, indicating the areas most affected by interactions with H3O+ ions.

One prominent structural feature is the C31–N42 bond length in the pure aniline oligomer, which systematically shortens as the polymer chain length increases, an effect also observed in PANI and 2PANI. This gradual reduction in bond length is due to the fluctuating partially positive and partially negative charges on the hydrogen and nitrogen atoms involved in the bond. As protons from H3O+ ions associate with the polymer, the polarities of these covalent bonds increase, leading to gradual bond length reduction. This enhanced polarity supports a more stable proton interaction, which is critical for pH sensing. The proposed sensing mechanism, involving protonation and deprotonation of the PANI oligomers, is shown in Fig. 6. Protonation alters the local charge distribution, enhancing the polymer's affinity for H3O+ and reinforcing the structural integrity of the sensing site. This bond length and charge redistribution align with the expected behaviour of conducting polymers in the presence of H3O+, enabling the NF/Ni(OH)2/PANI electrode to selectively detect pH changes.


image file: d5ma00830a-f6.tif
Fig. 6 Sensing mechanism analysis at the DFT B3LYP/6-311G+(d,p) level of theory.

The Mulliken charge data for PANI and PANI–H3O+ support the observed structural changes in the PANI oligomers during complexation. For 4PANI, a significant bond length increase was detected for C1–N12, N22–C1, N47–C4, C5–C6, and C28–N42, while a decrease was observed in C1–C2, C1–C6, N47–H48, N44–C21, and C31–N42, as shown in Fig. S4 and Table S2. The interaction between PANI and H3O+ weakens specific bonds (C1–N12, N22–C1, N47–C4, C5–C6, and C28–N42), indicating strong attraction of PANI to H3O+ ions. In larger PANI oligomers, the structure shifts from planar to a zigzag conformation, resulting in a steady decrease in bridging angles. Notably, in 4PANI–H3O+, an increase in bridging angles (C1–N12–H14, C3–C4–N47, and C13–C11–N46) and decreases in others (C6–C1–N12, H23–N22–C1, and C5–C4–N47) were recorded (Table S2). Dihedral angles, such as N47–C4–C3–C2 and C13–C16–C18–N44, also decrease with H3O+ complexation, highlighting the structural rearrangements induced by analyte interaction. This geometric reconfiguration, supported by Mulliken charge analysis and vibrational studies, underscores the sensor's sensitivity and selectivity for H3O+.

3.7 Molecular orbital analysis

According to quantum mechanics, interactions between the sensor and analyte molecules are facilitated by the engagement of their frontier molecular orbitals (HOMO and LUMO).54,55 The nature and strength of these interactions can be evaluated by examining changes in the HOMO–LUMO energy gap (H–L gap) upon complexation. Higher HOMO energy generally correlates with increased reactivity, while a decrease in HOMO energy upon interaction signifies increased stability of the complex. Calculations showed a reduction in HOMO energy upon complexation of PANI, 2PANI, and 4PANI with H3O+, indicating stable complexes. The HOMO energies of unreacted PANI oligomers were found to be −6.96, −5.10, and −4.80 eV for PANI, 2PANI, and 4PANI, respectively, with corresponding values of −4.68, −3.68, and −0.37 eV for the PANI–H3O+ complexes (Table 2 and Fig. 7). This reduction confirms the stability and affinity of the PANI sensor for H3O+.
Table 2 Band gaps in terms of the difference between the HOMO and LUMO of PANI and PANI–H3O+
Species HOMO (eV) LUMO (eV) Band gap (eV)
PANI −6.960 −5.741 1.219
PANI–H3O+ −11.1436 −4.678 6.4656
2PANI −5.100 −0.5684 4.5316
2PANI–H3O+ −8.5528 −3.6759 4.8769
4PANI −4.800 −2.5350 2.265
4PANI–2H3O+ −4.3638 −0.3665 3.9973



image file: d5ma00830a-f7.tif
Fig. 7 Frontier orbitals of PANI and PANI–H3O+ at the DFT B3LYP/6-311G+(d,p) level of theory.

The H–L gap, which correlates inversely with electronic conductivity, also decreases upon complexation, as seen in Table 2. For the protonated complexes, the gap reduction leads to increased conductivity, aligning with the expected selectivity of the PANI sensor for H3O+. This decrease in the H–L gap indicates efficient intermolecular charge transfer, confirming enhanced conductivity upon interaction with H3O+.

In quantum theory, the mixing of ground and excited-state wave functions influences electron density, with higher excitation energy leading to less overlap and reduced charge transfer. This is consistent with the “hardness” of a molecule, as molecules with large H–L gaps are less reactive (“hard”) compared to those with smaller H–L gaps (“soft”). The smaller gap in complexed PANI makes it a “softer” molecule, facilitating greater reactivity and charge transfer, crucial for effective pH sensing in H3O+-rich environments.

4. Conclusion

We successfully constructed a three-dimensional pH sensor utilising polyaniline and nickel hydroxide-coated nickel foam by integrating both electrodeposition and electropolymerisation methods. After a thorough structural and elemental analysis, successful integration of components has been observed, while electrochemical assessment shows significant linearity and sensitivity (−46 mV per pH) across the pH range of 3 to 11. The sensor exhibited excellent reproducibility and long-term stability, maintaining up to 97% of its initial sensitivity after one week and showing negligible potential drift during continuous operation. Comparative research utilising real food samples such as vinegar, orange juice, and baking soda confirmed the sensor's efficacy against standard glass electrode-based pH meters.

Furthermore, we have examined the sensor's selectivity and response mechanisms using density functional theory simulations. Theoretical examination of molecular geometry, Mulliken charges, interaction energies, and vibrational spectra demonstrated consistent charge transfer behaviour and a significant binding affinity between H3O+ ions and PANI chains. These findings conclude the observed experimental trends and emphasise the sensor's capability to operate reliably under varying environmental conditions. Minor deviations at extreme pH levels indicate potential pathways for further improvements. This integrated electrochemical-DFT methodology offers a promising, low-cost platform for real-time monitoring in food, environment, and healthcare applications.

Author contributions

Mirazul Islam: investigation, methodology, and writing – original draft. Md. Sanwar Hossain: investigation (equal), methodology (equal), and writing – original draft. N. Padmanathan: writing – characterization and review & editing. Kafil M. Razeeb: conceptualization (supporting), and writing – review & editing (equal). Mamun Jamal: conceptualization (lead), supervision, writing – original draft (lead), and writing – review & editing (lead).

Conflicts of interest

There are no conflicts to declare.

Data availability

Supplementary information is available. See DOI: https://doi.org/10.1039/d5ma00830a.

Acknowledgements

This research was supported by the University Grants Commission of Bangladesh (Phy-38-2023-20250128).

References

  1. X. Zhu, Y. Zhang, H. Li, J. Wang, Y. Zhou and Y. Liu, RSC Adv., 2024, 14, 5627–5637,  10.1039/D3RA07878G.
  2. N. N. Song, Y. Z. Wang, X. Y. Yang, H. L. Zong, Y. X. Chen, Z. Ma and C. X. Chen, J. Electroanal. Chem., 2020, 873, 114352,  DOI:10.1016/j.jelechem.2020.114352.
  3. M. F. Farooqui, M. A. Karimi, K. N. Salama and A. Shamim, Adv. Mater. Technol., 2017, 2, 1700051,  DOI:10.1002/admt.201700051.
  4. M. Alizadeh-Sani, E. Mohammadian, J.-W. Rhim and S. M. Jafari, Trends Food Sci. Technol., 2020, 105, 93–144,  DOI:10.1016/j.tifs.2020.08.014.
  5. A. Andrés-Bello, V. Barreto-Palacios, P. García-Segovia, J. Mir-Bel and J. Martínez-Monzó, Food Eng. Rev., 2013, 5, 158–170,  DOI:10.1007/s12393-013-9067-2.
  6. M. S. Hossain, N. Padmanathan, M. M. R. Badal, K. M. Razeeb and M. Jamal, ACS Omega, 2024, 9, 40122–40133,  DOI:10.1021/acsomega.4c06090.
  7. R. Riesute, J. Salomskiene, D. S. Moreno and S. Gustiene, Trends Food Sci. Technol., 2021, 108, 1–10,  DOI:10.1016/j.tifs.2020.11.022.
  8. L. Devlin, M. Jamal and K. M. Razeeb, Anal. Methods, 2013, 5, 880–884,  10.1039/C2AY26264A.
  9. L. Manjakkal, D. Szwagierczak and R. Dahiya, Prog. Mater. Sci., 2020, 109, 100635,  DOI:10.1016/j.pmatsci.2019.100635.
  10. S. Casans, D. R. Muñoz, A. E. Navarro and A. Salazar, Sens. Actuators, B, 2004, 99, 42–49,  DOI:10.1016/j.snb.2003.09.015.
  11. M. Jamal, T. K. Dey, T. Nasrin, A. Khosla and K. M. Razeeb, J. Electrochem. Soc., 2022, 169, 057517,  DOI:10.1149/1945-7111/ac6982.
  12. J. Werner, M. Belz, K.-F. Klein, T. Sun and K. T. V. Grattan, Measurement, 2021, 178, 109323,  DOI:10.1016/j.measurement.2021.109323.
  13. E. J. Fratz-Berilla, C. Kohnhorst, N. Trunfio, X. Bush, A. Gyorgypal and C. Agarabi, Heliyon, 2024, 10, e25512,  DOI:10.1016/j.heliyon.2024.e25512.
  14. P. Zou, B. Zhang, C. Wu, H. Zhang, Z. Gan, F. Liu, H. L. Zong, S. Yuan, G. Chen and C. Chen, J. Energy Storage, 2025, 129, 117342,  DOI:10.1016/j.est.2025.117342.
  15. M. S. Hossain, M. H. Kabir, M. A. A. Shaikh, M. Y. Pabel and S. Yasmin, Mater. Chem. Phys., 2024, 322, 129586,  DOI:10.1016/j.matchemphys.2024.129586.
  16. B. Zhang, C. Wu, Y. Bao, P. Zou, X. Wang, S. Yuan, G. Chen and C. Chen, J. Colloid Interface Sci., 2025, 677, 151–160,  DOI:10.1016/j.jcis.2024.08.049.
  17. J. Wang, Y. Li, H. Zhang, X. Chen, L. Zhao, M. Liu, Z. Xu and S. Yang, Int. Soil Water Conserv. Res., 2023, 11, 429–454,  DOI:10.1016/j.iswcr.2023.03.002.
  18. M. Jamal, K. M. Razeeb, H. Shao, J. Islam, I. Akhter, H. Furukawa and A. Khosla, Sci. Rep., 2019, 9, 4659,  DOI:10.1038/s41598-019-41208-3.
  19. Y. Zhao, Y. Yu, S. Zhao, R. Zhu, J. Zhao and G. Cui, Microchem. J., 2023, 185, 108092,  DOI:10.1016/j.microc.2022.108092.
  20. N. Padmanathan, H. Shao and K. M. Razeeb, ACS Appl. Mater. Interfaces, 2018, 10, 8599–8610,  DOI:10.1021/acsami.7b17187.
  21. S. N. Khoshnoo, T. Kim, J. A. Tavares-Negrete, X. Pei, P. Das, S. W. Lee, J. Rajendran and R. Esfandyarpour, Adv. Mater. Technol., 2023, 8, 2201655,  DOI:10.1002/admt.202201655.
  22. S. J. Kim, H. J. Park, G. Kim, J. Kim, K. G. Lee and B. G. Choi, Mater. Today Commun., 2024, 39, 109224,  DOI:10.1016/j.mtcomm.2024.109224.
  23. R. Wang, X. Zhang, L. Chen, Y. Zhao, Q. Liu, Y. Sun and H. Wu, J. Mater. Chem. B, 2020, 8, 3655–3660,  10.1039/c9tb02477h.
  24. B. Niu, S. Yang, T. Hua, X. Tian and M. Koo, Nano Res., 2021, 14, 1043–1052,  DOI:10.1007/s12274-020-3148-3.
  25. J. Islam, H. Shao, M. R. Badal, K. M. Razeeb and M. Jamal, PLoS One, 2021, 16, e0248142,  DOI:10.1371/journal.pone.0248142.
  26. M. P. Browne, P. Smith, A. Johnson, Y. Li, M. Liu, J. Kelly and R. Dawson, Sustainable Energy Fuels, 2017, 1, 207–216,  10.1039/C6SE00032K.
  27. M. Motshakeri, B. Angoro, A. R. Phillips, D. Svirskis, P. A. Kilmartin and M. Sharma, Sensors, 2025, 25(5), 1474,  DOI:10.3390/s25051474.
  28. Y. Pabel, H. Kabir, S. Hossain and S. Yasmin, Mater. Adv., 2025, 6, 2243–2252,  10.1039/d5ma00001g.
  29. Y. Bao, G. Chen, X. Zhu, P. Zou, Q. Yang, S. Yuan and C. Chen, J. Colloid Interface Sci., 2025, 697, 137975,  DOI:10.1016/j.jcis.2025.137975.
  30. B. Jafari, M. Muthuvel and G. G. Botte, J. Electroanal. Chem., 2021, 895, 115547,  DOI:10.1016/j.jelechem.2021.115547.
  31. T. Okamura, T. Ueda, S. Asakura, M. Mizutani, M. Matsumoto, H. Matsuda and Y. Nishiyama, Energy Environ. Sci., 2018, 11, 2552–2562,  10.1039/C8EE00975D.
  32. H. Bai, J. Xiong, H. Tong, Z. Li and J. Li, Nano Energy, 2018, 53, 769–775,  DOI:10.1016/j.nanoen.2018.09.003.
  33. C. P. Cho, Y. H. Hsu, Y. T. Huang, H. Y. Liao, C. H. Hung, C. W. Chu, M. C. Tsai and Y. F. Chen, ACS Appl. Mater. Interfaces, 2020, 12, 48102–48111,  DOI:10.1021/acsami.0c15392.
  34. Z. Chen, Y. Zhao, J. Xu, H. Li, S. Zhang, X. Wang and F. Pan, Energy Storage Mater., 2020, 26, 353–361,  DOI:10.1016/j.ensm.2019.12.015.
  35. L. Yu, L. Guo, Y. Cao, X. Li, Q. Wang, C. Wang, J. Liang and G. Li, Nano Energy, 2019, 62, 617–624,  DOI:10.1016/j.nanoen.2019.05.004.
  36. J. Xie, Y. Li, C. Fang, L. Yang, Z. Wen and Y. Li, ACS Appl. Energy Mater., 2019, 2, 2812–2820,  DOI:10.1021/acsaem.9b00277.
  37. C. Tang, Y. Jiao, X. Chen, J. Li, W. Zhou, S. Wang and Z. Zhu, Energy Environ. Sci., 2016, 9, 1609–1618,  10.1039/C6EE00309A.
  38. Y. Wu, H. Zhang, J. Wang, M. Zhou, Y. Wang and X. Zhang, Chem. Eng. J., 2019, 360, 317–325,  DOI:10.1016/j.cej.2018.11.171.
  39. K. Zhao, Y. Wang, H. Mao, J. Zheng, L. Zou, J. He, C. Yang and J. Xu, J. Power Sources, 2018, 396, 19–27,  DOI:10.1016/j.jpowsour.2018.05.048.
  40. Y. Sun, X. Hu, J. Li, M. Hu, J. Liu and J. Ma, Electrochim. Acta, 2019, 327, 135007,  DOI:10.1016/j.electacta.2019.135007.
  41. M. Toupin, T. Brousse and D. Bélanger, Chem. Mater., 2002, 14, 3946–3952,  DOI:10.1021/cm020305h.
  42. M. E. Scofield, C. Koenigsmann, L. Wang and S. S. Wong, J. Am. Chem. Soc., 2015, 137, 5687–5696,  DOI:10.1021/jacs.5b01646.
  43. G. Zhou, F. Li and H. M. Cheng, Energy Environ. Sci., 2014, 7, 1307–1338,  10.1039/C3EE43182G.
  44. H. Wang, C. Zhu, D. Chao, Q. Yan, H. J. Fan and C. Chen, Adv. Mater., 2017, 29, 1702093,  DOI:10.1002/adma.201702093.
  45. Y. Gogotsi and P. Simon, Science, 2011, 334, 917–918,  DOI:10.1126/science.1214317.
  46. X. Xie, K. Kretschmer, R. H. Dong, C. C. Tang, Z. P. Cano and Z. Chen, Nat. Commun., 2020, 11, 1519,  DOI:10.1038/s41467-020-15357-5.
  47. D. Yu, L. Dai, D. J. Srolovitz, T. Zhai, F. Yang, J. Wu and H. Fan, J. Mater. Chem. A, 2016, 4, 17209–17217,  10.1039/C6TA06477E.
  48. B. Conway, Electrochim. Acta, 1993, 38, 1249–1258,  DOI:10.1016/0013-4686(93)80081-G.
  49. P. Simon, Y. Gogotsi and B. Dunn, Science, 2014, 343, 1210–1211,  DOI:10.1126/science.1249625.
  50. L. L. Zhang and X. S. Zhao, Chem. Soc. Rev., 2009, 38, 2520–2531,  10.1039/B813846J.
  51. J. R. Miller and P. Simon, Science, 2008, 321, 651–652,  DOI:10.1126/science.1158736.
  52. C. Largeot, C. Portet, J. Chmiola, P. L. Taberna, Y. Gogotsi and P. Simon, J. Am. Chem. Soc., 2008, 130, 2730–2731,  DOI:10.1021/ja7106178.
  53. Y. Xu, Z. Lin, X. Zhong, X. Huang, N. Weiss, Y. Huang and X. Duan, Nat. Commun., 2014, 5, 4554,  DOI:10.1038/ncomms5554.
  54. C. Meng, C. Liu, L. Chen, C. Hu and S. Fan, Nano Lett., 2010, 10, 4025–4031,  DOI:10.1021/nl1027397.
  55. Y. Zhang, Y. Zhao, J. Wang, H. Wang, D. Li, Z. Shi and G. Yu, Nano Energy, 2016, 22, 586–594,  DOI:10.1016/j.nanoen.2016.02.039.

Footnote

These authors contributed equally to this work.

This journal is © The Royal Society of Chemistry 2025
Click here to see how this site uses Cookies. View our privacy policy here.