Introduction

In recent decades, industries have contributed to economic growth and played a key role in reducing unemployment rates in countries, but this has also resulted in significant environmental pollution (Padhi et al. 2017; Qiu et al. 2018). Water is a crucial resource for both the industrial sector and human consumption for daily life. The manufacturing of a wide range of chemicals and new technologies has led to rapid development in the industrial and chemical sectors, as well as urban civilization, resulting in the generation of a huge amount of wastewater that is a major contributor to water pollution. Most water contaminants are industrial waste, organic compound complexes, and heavy metal ions, and their repeated removal presents significant challenges. Generally, heavy metals such as Cd, Pb, Cr, Fe, Co, Zn are present in water (Bhaumik et al. 2011; Fu and Wang 2011). Among these, chromium is one of the most hazardous elements according to the World Health Organization (WHO). Chromium is a prominent metal contaminant found in wastewater from various industries such as paint manufacturing, electroplating, steel, tanning, agricultural runoffs, and metal processing (Selvi et al. 2001). The oxidation state of chromium varies from − 2 to + 6, but the most stable oxidation states are + 3 and + 6 (Khatoon et al. 2023). Hexavalent chromium exists as chromate (HCrO4) and dichromate (Cr2O72−) while trivalent chromium exists as Cr(OH)3 and Cr(OH)2+ in the aqueous medium. Cr (VI) is thousand times more poisonous compared to Cr(III) because of its small size, high water solubility, and high mobility (Wang et al. 2017). The World Health Organization has declared a maximum permissible limit of 0.05 mg L−1 for chromium concentration in drinking water and 0.1 mg L−1 for groundwater (Xing et al. 2018). Once chromium enters into groundwater and drinking water, it spreads rapidly and causes serious concerns about the environment and human health, such as the liver, kidney, bladder, skin cancer, and diarrhea (Chávez-Guajardo et al. 2015; Barakat et al. 2016). Researchers are now focusing on the development of sorbent materials with high selectivity toward chromium ions, which can be easily captured when they are present in water, and then regenerated and reused.

Several methods have been studied to eliminate heavy metal ions from wastewater, including electrocoagulation (Bhatti et al. 2009), ion exchange (Ren et al. 2020), precipitation (Int 2017), reverse osmosis (Chaturvedi et al. 2022), photochemical reduction (Chen and Liu 2020), bio adsorption (Badessa et al. 2020), and adsorption (Boulett et al. 2023). Among these techniques, adsorption is highly preferred due to its advantages such as cost-effectiveness, ease of operation, high sorption capacity, and good environmental stability. However, when Cr(VI) is adsorbed, there still exists some toxicity in the environment because of the removal of the consumed adsorbent. To mitigate the environmental hazards, it is preferable to reduce Cr(VI) to Cr(III) as much as possible. The process should primarily involve a single-step simultaneous adsorption of Cr(VI) that is reduced to Cr(III), and then the adsorbed Cr(III) can be chelated with the adsorbent surface (Ding et al. 2018; Behera et al. 2022). Various adsorbents are available for removing toxic metal ions, Cr(VI) ions and organic dyes such as zeolites (Zeng et al. 2010), silica (Nayab et al. 2018), activated carbon (Sharma et al. 2019), carbon dots (Xiao et al. 2019), mesoporous carbon (Lu et al. 2018), chitosan (Vakili et al. 2018), biosorbents (Ahmad et al. 2017). However, the main drawback of most of these adsorbents is their limited adsorption capacity, low mechanical, and thermal stability.

Conducting polymers such as polypyrrole (PPY) and polyaniline (PANI) have gained interest for their ability to remove heavy metals and organic dyes from aqueous solutions (Liu et al. 2014). Nevertheless, PANI is a popular conducting polymer due to its environmental stability, ability to bind with negative ions through its N atom of amine groups, and simple synthesis route. Although PANI has a high surface area, good chemical stability, and abundant adsorption sites, it has low mechanical and thermal properties (Sahu et al. 2019). To improve its mechanical and thermal properties, PANI can be treated with stable inorganic materials. Zirconium-based adsorbents have gained attention in recent years due to their high ion exchange capacity and numerous applications in adsorption, sensing, separations, and catalysis. Zirconium possesses numerous distinct characteristics and advantages compared to other transition metals. It exhibits a high charge density, mechanical stability, tetravalent character, and the ability to accept lone pairs of electrons. Additionally, it has the capacity to generate sterically stable variable coordinate compounds (Sonal and Mishra 2021). These exceptional properties contribute to its widespread use in both fundamental and applied research applications. On the other hand, the refractory metal tungsten possesses a unique combination of qualities that set it apart. Notably, it boasts the highest melting point among all elements and demonstrates high elastic modulus, density, thermal conductivity, and remarkable mechanical properties at elevated temperatures (Xie et al. 2021). These excellent attributes enable tungsten to be utilized in a wide range of applications, including kinetic energy penetrators, heating elements, and filaments for incandescent light bulbs.

In order to overcome the technological limitations associated with excessive pressure drops, direct utilization of Zirconium tungstophosphate (ZrWPO4) powder in fixed bed columns or flow-through systems is not feasible. However, a solution has been developed by incorporating powdered ZrWPO4 particles onto porous polymeric substrates, thereby creating polymeric hybrid composites. This innovative approach successfully addresses the aforementioned constraints, allowing for the practical application of ZrWPO4 in various systems (Viswanathan and Meenakshi 2010). Therefore, a composite of zirconium tungstophosphate with polyaniline is expected to show excellent consequences as an effective adsorbent for heavy metal ions. To the best of our knowledge, this polymeric composite material has not been synthesized in the literature.

In this study, the synthesis of PANI-ZrWPO4 nanocomposite was carried out through the in situ-oxidative polymerization method, followed by its physiochemical properties’ characterization using XRD, Raman, FTIR, TGA-DTA, FESEM, TEM, BET, and XPS techniques. Batch adsorption studies were conducted to examine the efficiency of the PANI-ZrWPO4 nanocomposite in removing Cr(VI). Mathematical models including adsorption equilibrium isotherm, kinetics equilibrium, and adsorption thermodynamics were employed to assess the feasibility of the adsorption process. The capability to effectively reduce Cr(VI) to Cr(III) was demonstrated by the PANI-ZrWPO4 nanocomposite during this adsorption process. The simultaneous occurrence of adsorption and reduction of Cr(VI) to Cr(III) on the PANI-ZrWPO4 nanocomposite was further discussed. The regeneration capabilities of the composite were successfully demonstrated through multiple adsorption–desorption cycles, highlighting the potential of the composite as a promising adsorbent for the removal and sequestration of Cr(VI) ions.

Material and methods

Chemicals and reagents

All the chemicals used in the experiment were of analytical grade. Potassium dichromate (K2Cr2O7), zirconium oxychloride octahydrate (ZrOCl2.8H2O), sodium tungstate dihydrate (NaWO4.2H2O), orthophosphoric acid (H3PO4), ammonium persulfate ((NH4)2S2O8), 1,5-diphenyl carbazide, aniline (C6H5NH2), sodium hydroxide (NaOH), hydrochloric acid (HCl), and sulfuric acid (H2SO4) were purchased from Sigma Aldrich Co. (India) and used without purification. To prepare the chromium stock solution, 2.8 g of potassium dichromate (K2Cr2O7) was dissolved in doubly deionized water to obtain a concentration of 1000 mg L−1. The stock solution was then diluted to the necessary Cr(VI) concentrations. Throughout the entire experiment, doubly distilled water was used.

Instruments and characterization

The investigation of phase purity and crystalline structure was carried out using X-ray diffraction (XRD) analysis with Rigaku Ultima-IV diffractometer Cu Kα radiation source (λ = 1.54 A°, 40 kV, 30 mA) (Japan) and analyzed by X'Pert high score plus analytical instruments. Transmission electron microscopy (TEM) images of various nanoparticles were obtained using a Tecnai instrument (CA, USA) at 300 kV. Surface morphology of nanomaterials was investigated using a field emission scanning electron microscope (FESEM) with a Nova NanoSEM/FEI instrument (Oregon, USA), and energy dispersive X-ray analysis was used to identify the corresponding elements. Elemental oxidation state and nature of the material were analyzed by X-ray photoelectron spectroscopy with a VG Scientific ESCALAB Mark II spectrometer (Waltham, USA). Fourier transformation infrared (FTIR) spectroscopy was used to detect functional groups in the range of 400–4000 cm−1 using a PerkinElmer spectrometer (Waltham, USA). Raman spectrophotometry was analyzed using a WITec Alpha 300R spectrometer (Germany). The specific surface area and pore size distribution were determined using the N2 adsorption–desorption method with a Quantachrome Autosorb (IQ) model ASIQM0000-4 (Florida, USA). Thermogravimetric analysis (TGA) and differential thermal analysis (DTA) were used to examine the thermal properties under nitrogen flow was present (Netzsch STA 449C, Germany). Using a Nano ZS 90 (Malvern instrument, UK), the surface charge density of the material was resolved. The amount of Cr(VI) was measured using a Shimadzu 2450 UV–visible spectrophotometer (Japan).

Synthetic method

Zirconium tungstophosphate (ZrWPO4) was synthesized via the co-precipitation process, which was then exposed to microwave-assisted irradiation process. In this method, 0.1 M ZrOCl2.8H2O was added to a nitric acid solution along with 0.1 M NaWO4.2H2O and 1 M orthophosphoric acid in a volume ratio of 2:1:1. The mixture was stirred constantly at 60 °C for 5 h, and then transferred to a microwave-assisted autoclave and irradiated at 800 W for 10 min. The resulting solution was allowed to settle at room temperature and was repeatedly washed with distilled water before being dried for 24 h at 80 °C. The dried residue was then crushed with a mortar and pestle to obtain the ZrWPO4 powder.

The synthesis of polyaniline via organic route was performed using APS and aniline, as described in the literature (Wang et al. 2006). The polyaniline modified zirconium tungstophosphate (PANI-ZrWPO4) nanocomposite was synthesized via an in situ oxidative polymerization process (Scheme 1). Initially, 1 g of zirconium tungstophosphate was added to 100 mL of 1 M HCl solution and ultrasonicated for 30 min to reduce the accumulation of ZrWPO4 nanoparticles. Next, 3.5 mL of aniline was added to this mixture, followed by dropwise addition of the APS solution (4.56 g of ammonium persulfate in 50 mL of distilled water). The dispersion mixture was constantly stirred for 1 h at room temperature. The resulting greenish-dark precipitate was separated and washed with distilled water and HCl solutions to remove unreacted aniline. Finally, the precipitate was dried at 60 °C in the oven for 24 h and grinded into a black-greenish powder, which was named as PANI-ZrWPO4 nanocomposite.

Scheme 1
scheme 1

Schematic representation for the synthesis of PANI-ZrWPO4 and its Cr(VI) adsorption reduction mechanism

Batch adsorption experiment

Batch adsorption experiments were conducted to investigate the removal of Cr(VI) by PANI-ZrWPO4 nanocomposites under various adsorption parameters. These parameters included adsorbent dosage, pH, contact time, ionic strength, initial concentration, temperature, and coexisting ions. Using 0.1 M NaOH and 0.1 M HCl, the pH was raised from 2 to 9 in order to explore the effect of pH. The effect of adsorbent dosage was tested within the range of 10–110 mg, while the contact time varied from 10 to 90 min. The effect of initial concentration was verified by testing concentrations between 5 and 60 ppm. The effect of stirring rate was examined within the range of 50–250 rpm, and the effect of temperature was tested from 10 to 90 °C. The effect of ionic strength was studied by testing solutions with different concentrations of 1 M, 0.1 M, 0.01 M, and 0.001 M, and the effect of coexisting ions (e.g., F, CO32−, SO43−, I, Cl, NO3, SO32−, HSO4) was also investigated. Each experiment was repeated three times under identical conditions and the median value was used to assure the reproducibility of the results. The concentration of Cr(VI) removal are measured by using UV–visible spectroscopy and the different concentration of Cr(VI) are measured from the UV–visible spectra and the calibration graph which is shown in the supporting information of Fig. S1. The uptake capacity (qe) in mg g−1 and the removal percentage (R%) were calculated using the following equations:

$${q}_{e}=\frac{{C}_{0}-{C}_{e}}{M}\times V$$
(1)
$$R\; \%=\frac{{C}_{0}-{C}_{e}}{{C}_{0}}\times 100$$
(2)

where C0 (mg L−1) is the initial concentration of Cr(VI), Ce (mg L−1) is the final concentration of Cr(VI), V represents the volume of chromium solution in liter, and M denotes weights of PANI-ZrWPO4 nanocomposites in gram.

Design of experiment

The experiments’ data were analyzed using the Design-Expert version 13 software (USA). The Box-Behnken Design (BBD) was statistically used to optimize the process parameters of the removal of Cr(VI) using PANI-ZrWPO4 nanocomposite in the aqueous solutions within the ranges of experimental parameters. Here, the independent variables were adsorbent dose (A), time (B), concentration (C), pH (D), temperature (E), and stirring rate (F), whereas the removal of Cr(VI) was the dependent variable. Table 1 represents the levels and ranges of experimental and independent variables. A quadratic second-order polynomial equation was used for analyzing interactions between dependent and independent variables (Sahu et al. 2017):

$$Y={\beta }_{0}+\sum {\beta }_{i}{X}_{i}+\sum {\beta }_{ii}{X}_{i}^{2}+\sum \sum {\beta }_{ij}{X}_{i}{X}_{j}+\varepsilon$$
(3)

where ε is the model error, Y is % removal, βi and β0 are effect of linear parameter and coefficient constant, βij is the interaction coefficient between Xi and Xj, and βii is an effect of quadratic parameter.

Table 1 Process variables and their level for the removal of Cr(VI)

Results and discussion

The XRD analysis was used to characterize the crystal structure and phase purity of the PANI, ZrWPO4, and PANI-ZrWPO4 nanocomposite. As shown in Fig. 1a, PANI exhibited characteristic peaks at 2θ = 20.4° and 25.5°, indicating its semi-crystalline nature and confirming the formation of the PANI polymer (Janaki et al. 2013). The XRD patterns of ZrWPO4 showed a peak at 2θ = 11.9°, indicating the presence of zirconium atoms on the (002) plane, and a peak at 2θ = 34.8°, indicating the presence of tungsten atoms on the (202) plane (Boruah et al. 2020; Ding et al. 2020). Other peaks at 19.5° and 25.1°, corresponding to the (110) and (112) planes, respectively, confirmed the presence of zirconium tungstophosphate nanoparticles. The XRD patterns of PANI-ZrWPO4 nanocomposite retained all the peaks of ZrWPO4 but with broadening due to the incorporation of polyaniline with the zirconium tungstophosphate. The FTIR spectra of PANI, ZrWPO4, and PANI-ZrWPO4 nanocomposite are shown in Fig. 1b. The FTIR spectra of PANI exhibited peaks at 1041 cm−1 and 1247 cm−1, denoting the C = N stretching vibration and a peak at 1305 cm−1, denoting the C-N stretching vibration frequency. Peaks at 1487 cm−1 and 1575 cm−1 indicated the C = C stretching vibration frequency and peak at 615 and 820 cm−1 indicates the C-H bending vibration of benzene ring and confirmed the formation of PANI (Abbasian et al. 2017). The FTIR spectra of ZrWPO4 showed a band at 609 and 518 cm−1, representing the tungsten oxide and metal oxide bond (Thakur and Pathania 2019). Sharp peaks at 1074 cm−1 designated the P-O stretching frequency, while a broad peak at 3562 cm−1 specified the water -OH stretching vibration frequency, and a peak at 1632 cm−1 was due to water -OH bending vibrations (Viswanathan and Meenakshi 2010). The FTIR spectra of PANI-ZrWPO4 nanocomposite showed all the bands of ZrWPO4 retained, with a slightly shifting of absorption band indicating the polyaniline interaction with zirconium tungstophosphate. The FTIR spectra after adsorption of Cr(VI) is shown in the supporting information file Fig. S2. It showed that the bending vibration of N–H bond was shifted from 1610 cm−1 to 1568 cm−1, which indicates a solid interaction between chromium and nitrogen atom. Furthermore, the peak at 3410 cm−1 was shifted to 3375 cm−1 because of interaction between Cr(VI) ion with -OH groups. A new peak at 814 cm−1 formed due to the stretching frequency of Cr–O bond of chromate group and few peaks were changed due to the presence of chromium ion. The overall data confirmed the adsorption of Cr(VI) on the surface of PANI-ZrWPO4 nanocomposite. Figure 1c shows the Raman spectra of PANI, ZrWPO4, and PANI-ZrWPO4 nanocomposite. The Raman band of PANI-ZrWPO4 showed the characteristics peak of both PANI and ZrWPO4, confirming the formation of the nanocomposite. The Raman spectra of ZrWPO4 showed peak at 427 cm−1, 536 cm−1 indicating the differential structural state of W–O bond (Kumar et al. 2018) and peak showed at 1007 and 1081 cm−1 indicating the P-O asymmetric stretching vibration suggests the formation of material (Nair and Dhoble 2015). In the case of PANI-ZrWPO4, the Raman peak slightly shifted to 420, 516, and 828 cm−1 signifying the interaction between the ZrWPO4 and PANI. The zeta potential study is shown in Fig. 1d, notified that PANI-ZrWPO4 carries lots of positive charge in the aqueous solution at lower pH, which is attributed to the electrostatic interaction between positive charge of PANI-ZrWPO4 composite and negative charge chromate or dichromate species. Hence, the maximum adsorption of Cr(VI) occurs at lower pH and show that the pHPZC (point zero charge of surface charge density) value of PANI-ZrWPO4 is 5.4.

Fig. 1
figure 1

a XRD, b FTIR, c Raman analysis of PANI, ZrWPO4, and PANI-ZrWPO4 nanocomposites, and d Zeta potential study of PANI-ZrWPO4 nanocomposites

X-ray photoelectron spectroscopy (XPS) analysis was investigated to examine the chemical composition, binding energy, and elemental oxidation state of PANI-ZrWPO4 nanocomposite, and the XPS survey spectra are shown in Fig. 2. The survey spectra of the PANI-ZrWPO4 nanocomposite showed peaks for W4f (36.3 eV), P2p (133.7 eV), Zr3d (183.8 eV), C1s (286.2 eV), N1s (401.2 eV), and O1s (530.1 eV), which suggests the formation of nanocomposite. The high-resolution XPS spectrum of W4f was deconvoluted into two peaks at 36.1 eV and 38.19 eV, which represent W4f5/2 and W4f7/2 and indicate that tungsten is strongly bound with oxygen in + 3 oxidation state (Fig. 2b) (Nayak et al. 2017). The XPS spectra of Zr3d was deconvoluted into two peaks at 181.3 eV and 183.6 eV, which correspond to Zr3d5/2 and Zr3d3/2 and indicate that zirconium in + 4 oxidation state (Fig. 2c) (Gondal et al. 2017). The high-resolution XPS spectrum of O1s was deconvoluted into four peaks at 529.1 eV, 529.9 eV, 530.6 eV, and 531.1 eV, which represent oxide oxygen (O2−), hydroxide group (-OH), metal oxide (W = O) group, and adsorbed water (H2O), respectively (Fig. 2d) (Mazur et al. 2021). One peak at 131.1 eV is observed in the high-resolution P2p spectrum, indicating that there is one kind of phosphorus present in the material. The high-resolution XPS spectrum of C1s is deconvoluted into two peaks at 281.9 eV and 283.2 eV, which denote C = C (aromatic carbon) and C = N (hetero group), respectively (Fig. 2e). The N1s fitted spectrum is deconvoluted into 3 peaks at 397.4 eV, 398.3 eV, and 399.9 eV that suggest to quinoid amine (= N-), benzenoid amine (-NH-), and positively charged nitrogen (N+), respectively (Fig. 2f) (Sahu et al. 2021b).

Fig. 2
figure 2

a XPS survey spectra of PANI-ZrWPO4 nanocomposite, high resolution XPS spectra of b W4f, c Zr3d, d O1s, e C1s, and f N1s of PANI-ZrWPO4 nanocomposite

The morphology of PANI, ZrWPO4, and PANI-ZrWPO4 nanocomposite was analyzed using field emission scanning electron microscopy (FESEM) and transmission electron microscopy (TEM). Figure 3a clearly showed that the FESEM image of PANI was agglomerated to form spherical shapes (Sahu et al. 2021a). The FESEM image of the ZrWPO4 nanoparticle displayed a hexagonal-like-layered nonuniform structure, as shown in Fig. 3b. In the case of the PANI-ZrWPO4 nanocomposite, it was clear that the PANI polymer covered the surface of the ZrWPO4 particle to form the PANI-ZrWPO4 nanocomposite. Figure S3 and S4 in the supporting information showcase the EDX spectra and mapping of the PANI-ZrWPO4 nanocomposite, as well as the changes that occur following the adsorption of Cr(VI) onto the composite material. The structural morphology of the samples and their atomic nature were determined using TEM, as represented in Fig. 3e–i. The TEM image of ZrWPO4 showed a hexagonal-like-layered nonuniform structure, as shown in Fig. 3e. The TEM image of the PANI-ZrWPO4 nanocomposite clearly showed that the spherical PANI polymer was strongly bound to the ZrWPO4 nanoparticle, forming the PANI-ZrWPO4 nanocomposite. The selected area electron diffraction (SAED) pattern of the PANI-ZrWPO4 nanocomposite showed that it was crystalline in nature. The TEM analysis confirmed the strong binding of PANI and ZrWPO4 to form the PANI-ZrWPO4 nanocomposite. Furthermore, the HRTEM image showed the high crystallinity of nanocomposite material (Fig. 3i). The presence of the lattice fringes (0.30 nm) indicates the orthorhombic crystal phase of the nanocomposite material.

Fig. 3
figure 3

FESEM image of a PANI, b ZrWPO4, and cd PANI-ZrWPO4, and TEM image of e ZrWPO4, fg PANI-ZrWPO4, h SAED pattern of the PANI-ZrWPO4, and i the HRTEM image of the PANI-ZrWPO4

The surface area and pore structures of the synthesized material were characterized using the N2 adsorption–desorption study. As shown in Fig. 4a, the surface area of ZrWPO4 was 30.5 m2/g, but after modification with polyaniline, the surface area of PANI-ZrWPO4 increased to 78.6 m2/g. The pore diameters of ZrWPO4 and PANI-ZrWPO4 were 3.7 nm and 4.2 nm, respectively, as shown in Table 2. The increased surface area provided more availability sites for the adsorption of heavy metal ions. Moreover, the synthesized nanocomposite had a large specific surface area and a small average pore diameter, which created additional binding sites for the dissolved hexavalent chromium ions to interact with PANI-ZrWPO4 and facilitate the adsorption of Cr(VI) ions. Thermal gravimetric analysis (TGA) and differential thermal analysis (DTA) investigations were performed to precisely and continuously measure the mass loss and heat content required to assess the material thermal stability. Figure 4c and d showed the TGA and DTA graph of ZrWPO4 and PANI-ZrWPO4. The TGA curve of ZrWPO4 showed that mass loss occurs in two phase process. The first phase of mass loss found below 120 °C due to the loss of external water molecule and the second phase of mass loss due to lattice water molecule. The TGA curve of PANI-ZrWPO4 showed the first mass loss occurs at below 120 °C due to loss of physically adsorbed water molecule and second mass loss at above 200 °C due to hydration of ZrWPO4 and lattice water. The mass loss showed above 480 °C due to the degradation of organic compound in the nanocomposite. The DTA curve of PANI-ZrWPO4 showed an endothermic peak at 120 °C due to loss of external water molecule and an endothermic peak showed at above 340 °C due to the degradation organic component, which confirmed the formation of the nanocomposite material.

Fig. 4
figure 4

a BET surface area, b pore size distribution, c TGA, and d DTA curve of ZrWPO4 and PANI-ZrWPO4

Table 2 BET surface area, average pore diameter, and total pore volume

Based on the analysis of various characterization techniques and synthetic procedures, we proposed the mechanism of a PANI-ZrWPO4 nanocomposite. Under acidic conditions, the H+ ions protonate the -OH groups present in the ZrWPO4 material, resulting in a positive surface charge. The lone pair of electrons on the nitrogen atom in aniline interact with the positively charged -OH2+ groups, leading to the formation of hydrogen bonding reactions. Additionally, the lone pair of electrons on the nitrogen atom in aniline bonds with the vacant orbitals of the Zr and W metal ions, forming coordination or dative bonds. After that the presence of APS triggers the conversion of aniline to polyaniline, ultimately resulting in the formation of the desired PANI-ZrWPO4 nanocomposite (Scheme 2).

Scheme 2
scheme 2

Formation mechanism of the PANI-ZrWPO4 nanocomposite

Removal study of Cr(VI)

Critical analysis of adsorption process

Batch adsorption experiments were conducted to investigate the adsorption behavior of Cr(VI) onto PANI-ZrWPO4 nanocomposites. For comparison, individual PANI and ZrWPO4 materials were also evaluated as parameters of initial concentration, adsorbent dose, and contact time (Fig. S5). The results showed that PANI-ZrWPO4 nanocomposites exhibited better adsorption capacity than single PANI and ZrWPO4 materials, with a maximum removal capacity of 98.8%. The effect of adsorbent dosage indicated that the removal of Cr(VI) increased gradually up to 30 mg of adsorbent dosage and then remained constant. The increase in the amount of PANI-ZrWPO4 nanocomposite significantly influenced the number of active sites available for adsorption, as seen in Fig. 5a. The effect of initial concentration revealed that the removal effectiveness decreased steadily as the starting concentration of Cr(VI) increased. Approximately 98.4% of Cr(VI) was removed using a 10 ppm Cr(VI) solution, as shown in Fig. 5b. The effect of contact time indicated that the removal of Cr(VI) onto PANI-ZrWPO4 nanocomposites increased rapidly during the first 60 min of contact time and then slowly until adsorption equilibrium was reached with increasing contact time. Initially, the adsorption of Cr(VI) rapidly increased due to the availability of vacant space on the adsorbent site, and then it remained constant due to the unavailability of vacant space, as seen in Fig. 5d. The effect of stirring rate indicated that the maximum adsorption of Cr(VI) onto PANI-ZrWPO4 nanocomposites occurred at 200 rpm because of an increase in film diffusivity and intraparticle diffusion onto the adsorbent (Dotto and Pinto 2011). Equilibrium was reached above 200 rpm due to the saturation of the adsorbent material, as seen in Fig. 5e. The effect of temperature indicated that there was no effect of temperature during the removal of Cr(VI) from the PANI-ZrWPO4 nanocomposite, as seen in Fig. 5f. The effect of ionic strength was examined by mixing 1 M, 0.1 M, 0.01 M, and 0.001 M of NaCl into Cr(VI) solutions, and the results showed that the increase in the concentration of NaCl decreased the adsorption rate, indicating the formation of an outer sphere complex formation (Pourbeyram 2016) as seen in Fig. 5g. The effect of coexisting ions, such as bicarbonate, iodide, nitrate, chlorate, bicarbonate, sulfite, sulfate, fluoride was studied on the removal of Cr(VI) onto PANI-ZrWPO4 nanocomposites. Each interfering ion was introduced in an amount of 25 mL with a concentration of 10 mg L−1. The effectiveness of the adsorption was then calculated, and it was found that the Cr(VI) removal efficiency decreased in the following order: bicarbonate > sulfate > nitrate > carbonate > sulfite > iodide > chloride > fluoride (Fig. 5h). This trend in coexisting ions influence on Cr(VI) adsorption may be partially attributable to both the hydrated ionic radius and charge density (Sahu et al. 2021a).

Fig. 5
figure 5

Removal capacity of Cr(VI) onto the PANI-ZrWPO4 of effect of a adsorbent dosage (C0 = 10 mg L−1, pH = 5.0 ± 0.1), b initial concentration (pH = 5.0 ± 0.1, m/V = 0.3 g L−1), c solutions pH (C0 = 10 mg L−1, time = 60 min, m/V = 0.3 g L−1), d contact time (C0 = 10 mg L−1, pH = 5.0 ± 0.1, m/V = 0.3 g L−1), e stirring rate (pH = 5.0 ± 0.1, m/V = 0.3 g L−1, C0 = 10 mg L−1, pH = 5.0 ± 0.1), f temperature (pH = 5.0 ± 0.1, m/V = 0.3 g L−1, C0 = 10 mg L−1, time = 60 min, stirring rate = 250 rpm), g ionic strength (pH = 5.0 ± 0.1, m/V = 0.3 g L−1, C0 = 10 mg L−1, time = 60 min), and h co-existing ions (pH = 5.0 ± 0.1, m/V = 0.3 g L−1, C0 = 10 mg L.1, time = 60 min, temperature = 298 K)

Effect of pH

The pH of the solution plays a crucial role in the adsorption of Cr(VI) ions by the PANI-ZrWPO4 material. The surface of PANI-ZrWPO4 is influenced by the pH of the solution due to the presence of active functional groups on its surface (Elwakeel et al. 2020). In our study, the pH of the solution varied from 2 to 11, and its impact on the percentage of Cr(VI) removal was investigated. The results demonstrated that the maximum adsorption of Cr(VI) occurred at lower pH values, specifically within the pH range of 2 to 5 (Fig. 5c). As the pH increased, the adsorption capacity gradually declined. This behavior can be attributed to the different ionic forms of Cr(VI) that exist in solution at varying pH levels. At pH values less than 2, H2CrO4 predominates as the primary species of Cr(VI). In the pH range of 2 to 6, HCrO4 and Cr2O72− are usually found, while at pH levels above 7, CrO42− becomes the primary form (Elwakeel et al. 2017). The presence of different ionic forms of Cr(VI) ions in solution significantly influences the removal capacity of PANI-ZrWPO4 for Cr(VI) ions. Under strong acidic conditions, the amino groups of the polyaniline in PANI-ZrWPO4 material become protonated, forming positively charged species (-NH3+). These positively charged species electrostatically interact with the negatively charged Cr(VI) species, leading to an increase in removal efficiency. However, at higher pH levels, the ability of protonation weakens due to an increase in OH concentration, which competes with the anionic Cr(VI) species. This competition results in a decline in the removal efficiency of Cr(VI) ions by PANI-ZrWPO4. Overall, the pH of the solution significantly influences the adsorption behavior of Cr(VI) by PANI-ZrWPO4, with lower pH values being more favorable for enhanced removal efficiency (Elwakeel et al. 2018).

The point of zero charge (pHPZC) for the PANI-ZrWPO4 nanocomposite was determined to be 5.4 (Fig. 1d). pHPZC refers to the pH at which the material’s surface is electrically neutral. Above pHPZC, the surface becomes negatively charged, while below pHPZC, it becomes positively charged. At higher pH, there is an electrostatic repulsion between the negatively charged surface and the negatively charged species of chromate ions (CrO42−), hindering the adsorption process and vice versa. Adsorption is favored at lower pH levels due to the positively charged surface of the material, which can interact with the negatively charged Cr(VI) ions. On the other hand, at higher pH levels, the negatively charged surface repels the negatively charged Cr(VI) ions, leading to a reduced adsorption efficiency.

Adsorption isotherm

Adsorption is a dynamic process that involves the interaction between adsorbate and adsorbent molecules and can be characterized by fitting mathematical models to experimental data. Many adsorption parameters can be calculated from these isotherms. The Langmuir, Temkin, and Freundlich models which are commonly used to observe the equilibrium adsorption (Asl et al. 2013). The adsorption behavior of Cr(VI) onto the PANI-ZrWPO4 nanocomposite was evaluated using the Langmuir and Freundlich isotherm models. The Langmuir model assumes monolayer adsorption, where a fixed number of adsorption sites are available for the adsorbate molecules. The experimental data was fitted to the linearized Langmuir equation to determine the adsorption parameters. The maximum Langmuir adsorption capacity (qm) for Cr(VI) onto PANI-ZrWPO4 nanocomposite was found to be 71.4 mg g−1 (Fig. 6a). On the other hand, the Freundlich isotherm model suggests multilayer adsorption, providing information about surface heterogeneity and adsorption mechanisms. The 1/n value in the Freundlich equation represents the strength of adsorption intensity. In this present study, the 1/n value indicated favorable adsorption, with a value greater than 1, suggesting cooperative (multilayer) adsorption (Fig. 6b). Additionally, a higher value of “n” indicated a stronger interaction between the PANI-ZrWPO4 adsorbent and Cr(VI) ions. Furthermore, the Temkin isotherm models was also investigated to gain insight into the interaction between the adsorbent and adsorbate. The Temkin model suggests a linear decrease in the heat of adsorption of a heterogeneous system with increasing adsorption quantity, indicating interaction between the adsorbate and adsorbent molecules. The Temkin isotherms (Fig. 6c) exhibited a strong interaction between the adsorbate and adsorbent species, with a binding energy (bT) value of 245.73 (Foo and Hameed 2010). The summarized isotherm parameters are provided in Table 3.

Fig. 6
figure 6

a Langmuir, b Freundlich, and c Temkin adsorption isotherm model for Cr(VI) removal onto PANI-ZrWPO4 nanocomposite

Table 3 Adsorption isotherm parameter of Cr(VI) onto PANI-ZrWPO4 nanocomposite

Adsorption kinetics

In order to investigate the rate-determining step and factors influencing the distribution of chromium between the bulk solution and the solid adsorbent surface, comprehensive kinetic analysis was performed. Three different models were employed to fit the adsorption kinetics: the pseudo-first-order reaction, the pseudo-second-order reaction, and the intraparticle diffusion kinetic model (Singh et al. 2017). The corresponding figure (Fig. 7a–c) illustrates the application of these models to the adsorption of Cr(VI) onto PANI-ZrWPO4 nanocomposite. Table 4 provides a summary of the calculated parameters for both kinetic models, while the correlation coefficients (R2) were used to assess the goodness of fit between the experimental data and the predicted data. Notably, the pseudo-second-order kinetic model exhibited a high R2 value of 0.98, indicating a superior fit for the adsorption of Cr(VI) onto PANI-ZrWPO4 nanocomposites compared to the pseudo-first-order reaction. The adsorption capacity values obtained from the pseudo-first-order and pseudo-second-order reactions were 8.03 mg g−1 and 26.31 mg g−1, respectively. There are numerous steps involved in the transport of Cr(VI) from water to the surface of the PANI-ZrWPO4 nanocomposite (pore diffusion, surface adsorption, surface diffusion, diffusion by external means, etc.). However, these models do not provide information about the internal diffusion of adsorbate and adsorbent particles (Benettayeb et al. 2021). To investigate the internal diffusion of the adsorbate into the surface of the adsorbent molecules, the intraparticle diffusion kinetic model was employed, which is fitted using the Weber-Morris theory equation (Sahu et al. 2020). Figure 7c illustrates the plot of the intraparticle diffusion kinetic model. The intercept value C provides an indication of the layer thickness, with higher values suggesting greater external resistance. In this study, the value of C was determined to be 11.57. The R2 values of the intraparticle diffusion model were lower compared to those of the pseudo-second-order kinetic model. The intraparticle diffusion plot show the deviation of straight line from its origin, signifying changes in the mass transfer rate during the adsorption phases, proving that pore diffusion is not the only factor in determining the rate-defining step (Hamza et al. 2022). The initial portion of the plot represents the binding of Cr(VI) to the active sites available on the outer surface, while the subsequent linear portion defines the adsorption occurring during the intraparticle diffusion of Cr(VI) ions and the availability of active pore sites on the PANI-ZrWPO4 nanocomposite surface.

Fig. 7
figure 7

a Pseudo-first-order, b pseudo-second-order, and c intraparticle diffusion kinetics model of Cr(VI) onto PANI-ZrWPO4 nanocomposite

Table 4 Adsorption kinetic parameters for Cr(VI) onto PANI-ZrWPO4 nanocomposite

Adsorption thermodynamics

An adsorption thermodynamics study was carried out to understand the nature, feasibility, and spontaneity of the process for Cr(VI) onto PANI-ZrWPO4 nanocomposite. The thermodynamic parameters, including Gibbs free energy (ΔG), enthalpy change (ΔH), and entropy change (ΔS) were calculated using Van’t Hoff equation (Dinh et al. 2020). Table 5 presents the obtained thermodynamic parameters, which can be used to predict the kind of adsorption. The Van’t Hoff plot of log Kc vs 1/T served as the basis for the calculation of the ΔH and ΔS values (Fig. 8). The negative value of free energy (∆G = − 1.69 kJ mol−1) indicates the spontaneity of the adsorption process for Cr(VI) onto PANI-ZrWPO4 nanocomposite. The positive value of enthalpy change suggests the endothermic nature of the adsorption process. Additionally, the positive ΔS value suggests the increase in the randomness of solid–liquid interface ions during the adsorption process.

Table 5 Adsorption thermodynamics parameters of Cr(VI) onto PANI-ZrWPO4 nanocomposite
Fig. 8
figure 8

Van’t Hoff plot for Cr(VI) adsorption onto PANI-ZrWPO4 nanocomposite

Optimization study

The calculated batch results of 54 experimental runs were carried out under various conditions for the removal of Cr(VI) by PANI-ZrWPO4 nanocomposite from aqueous solutions as shown in the supporting information in Table ST1. The model suggested a quadratic model for Cr(VI) removal, and the percentages of Cr(VI) removal that were realized ranged from 23 to 98%. The relationship between the coded factors of independent variables, with the response for Cr(VI) removal, was stated a second-order polynomial equation as follows:

$$\begin{array}{l}Y=72.15+7.62^\ast A+3.36^\ast B-8.65^\ast C-2437^\ast D+1.39^\ast E+5.38^\ast F+0.039^\ast A^\ast B+3.15^\ast A^\ast C\\+1.42^\ast D+0.72^\ast A^\ast E+3.03^\ast A^\ast F-0.44^\ast B^\ast C-0.095^\ast B^\ast D-1.17^\ast B^\ast E+2.91^\ast B^\ast F\;+\\5.93^\ast C^\ast D+0.35^\ast C^\ast E-2.00^\ast C^\ast F-0.72^\ast D^\ast E+0.82^\ast D^\ast F-0.86^\ast E^\ast F+1.38^\ast A^2-1.11^\ast B^2\;+\\5.57^\ast C^2-11.59^\ast D^2-0.68^\ast E^2-7.50^\ast F^2\end{array}$$

where the negative and positive sign indicates anti-synergetic and synergetic effects of Cr(VI) removal by PANI-ZrWPO4 nanocomposite, respectively. The Adj. R2 (Adjacent correlation coefficient) and R2 (correlation coefficient) values could provide a more comprehensive explanation of the model accuracy. Greater R2 values (nearing one) would signify good model quality, as well as high accuracy and reliability (Ecer et al. 2023). The Adj. R2 value gives an idea about the model accuracy of insignificant data removed through the calculation process. The BBD model showed that higher R2 value nearing one i.e., 0.97 signifying 97% of the data can be elucidated by the model, and only 3% of data could not explain by the model because of pure error. The actual versus predicted Cr(VI) removal and normal probability of Cr(VI) removal are shown in the supporting information in Fig. S6. The graph demonstrates that every point was present and very close to the diagonal line, showing that the data from the batch adsorption of Cr(VI) removal were fitted with model responses. The above data confirmed that the model expressed for Cr(VI) removal onto PANI-ZrWPO4 nanocomposite is highly significant. Analysis of variance (ANOVA) was also used to examine the suitability of the model accuracy. Table 6 shows the results of the response surface quadratic model fitting in the ANOVA and the model F-value of 31.64 indicates that the model is significant as the p-value (< 0.0001). The model is significant where the p-value is greater than 0.05 (Ecer et al. 2022). Only 0.01% chance that a “Model F-value” this large could occur due to noise. In this study terms A, B, C, D, F, CD, C2, D2, and F2 were significant due to lesser p-values(> 0.05) and the rest of other terms are non-significant due to higher probability values. It can be concluded that concentration (C), adsorbent dose (A), temperature (E), stirring rate (F), and time (B) have an important role in Cr(VI) adsorption over pH (D) due to the larger F-value.

Table 6 ANOVA data for Cr(VI) removal (%) by PANI-ZrWPO4 nanocomposite

Response surface plots

The response surface 3D plot are used to explain Cr(VI) removal where two independent parameters are studied while other parameters are kept constant and the figure is shown in the supporting information Fig. S7. Figure S7a represents a response surface 3D plot for Cr(VI) adsorption as a function of time and dose. With the increase of adsorbent dosage from 10 to 100 mg L−1, the removal percentage of Cr(VI) increased from 59 to 74% because the increase of adsorbent dosage creates a more active binding group and holds maximum Cr(VI) ion on the surface. At the same time, the effect of time increases from 10 to 120 min, and the removal of Cr(VI) is increased from 55 to 69% due to the availability of vacant space on the adsorbent site of material. Figure S7b shows 3D plot for Cr(VI) adsorption as a function of adsorbent dose and concentration, while other parameters are kept constant. With the increase of adsorbent dose from 10 to 100 mg L−1, the removal of Cr(VI) increased from 74 to 94% due to the increase of adsorbent dosage creating a more active binding group and holding maximum Cr(VI) ion on the surface. On the other hand, the removal percentage of Cr(VI) decreases from 78 to 57% with increases in Cr(VI) concentration from 5 to 60 ppm. At lower concentrations, the concentration of Cr(VI) is very low and simply adsorbed but at higher concentrations, the volume of Cr(VI) ion increases into the surface, so the adsorption rate decreases. It showed that at higher doses and lower concentrations about 94% Cr(VI) was adsorbed with the PANI-ZrWPO4 nanocomposite. Figure S7c shows a 3D plot for Cr(VI) adsorption as a function of adsorbent dose and pH, while other parameters are kept constant. With the increase of the adsorbent dose from 10 to 100 mg L−1, the removal of Cr(VI) is increased from 64 to 93%; due to an increase on the surface of the adsorbent, the binding rate of Cr(VI) increases. At the same time, the increase of pH from 2 to 11, the removal capacity decreases to 28%; due to higher pH, the ability of protonation weakened due to the increase of OH- concentration and competed with the anion Cr(VI) species, which resulted in the decline of Cr(VI) ion removal efficiency. It showed at lower pH and higher dose about 94% Cr(VI) is removed with the PANI-ZrWPO4 nanocomposite. Figure S7d shows a 3D plot for Cr(VI) adsorption as a function of temperature and concentration, while other parameters are kept constant. With the increases of Cr(VI) concentration from 5 to 60 ppm, the removal percentage of Cr(VI) is reduced to 81 to 66%. At lower concentrations, Cr(VI) is present in very small amounts and is readily adsorbed but when the concentration increases, more Cr(VI) ion forms on the surface, so the rate of adsorption decreases. At the same time, the temperature increases from 25 to 80 °C, the removal of Cr(VI) are same that suggesting temperature would not affect Cr(VI) removal. Figure S7e shows a 3D plot for Cr(VI) adsorption as a function of pH and concentration, while other parameters are kept constant. With the increases of Cr(VI) concentration from 5 to 60 ppm, the removal percentage of Cr(VI) is decreased from 82 to 68%. At lower concentrations, Cr(VI) is present in very low and is easily adsorbed but when the concentration increases, more Cr(VI) ion forms on the surface, so the rate of adsorption decreases. On the other hand, with the increase of pH from 2 to 11 the removal of Cr(VI) reduced from 80 to 42%. This value suggests the maximum removal of Cr(VI) at lower pH, due to the presence of more number of H+ ions, whereas at higher pH increase of OH ion that repulsion between the negatively charged species of Cr(VI) ion and negatively charged adsorbent, so reduced the percentage of Cr(VI) removal. It showed at lower pH and lower concentration that about 82% Cr(VI) is removed with the PANI-ZrWPO4 nanocomposite. Figure S7f shows a 3D plot for Cr(VI) adsorption as a function of stirring rate and time, while other parameters are kept constant. With the increase of time from 10 to 120 min, the removal of Cr(VI) increases from 51 to 62% due availability of vacant space on the adsorbent site and incorporation of adsorbent material. On the other hand, with the increase in the stirring rate from 50 to 400 rpm the removal of Cr(VI) increases by 51 to 63% due to film diffusivity and intraparticle diffusion onto the adsorbent.

Verification of optimal model and desirability functional for Cr(VI)

The desirability function approach was used to validate the correctness of Cr(VI) removal by PANI-ZrWPO4 nanocomposite. The good desirability function parameter of the optimization condition for removing Cr(VI) is displayed in the supporting information Table ST2. Under the same conditions, the experiments performed were repeated and it shows that the predicted and experimented removal efficiency are 95 ± 3% and 98. 02%, respectively. The error was quite low 0.02%, and there was an excellent match between the predicted and experimental values. Hence, it is suggested that the BBD of RSM is maximum desirability and could be calculated as the optimum condition of Cr(VI) removal of PANI-ZrWPO4 nanocomposite.

Comparison of adsorption performance with other adsorbents

A comparison analysis was conducted to evaluate the removal capacity of various reported adsorbents and the PANI-ZrWPO4 nanocomposite for Cr(VI) removal. The results demonstrated that the PANI-ZrWPO4 nanocomposite exhibited a significantly higher maximum adsorption capacity of 71.4 mg g−1 compared to the other adsorbents, including zirconium, tungsten, and PANI, as documented in the Table 7. This finding indicates that the PANI-ZrWPO4 nanocomposite is a favorable and efficient option for the removal of Cr(VI) from the environment. To validate its practical applicability, we conducted tests on real-world chromium-contaminated water samples. The outcomes revealed that by utilizing 1 g L−1 of the adsorbent, the concentration of Cr(VI) could be reduced from 3.2 mg L−1 to an acceptable level. While the optimal conditions for synthetic Cr(VI) solutions required a specific adsorbent dosage, the real contaminated samples necessitated a different dose. This variance in required dosage may be attributed to the presence of various interfering polluting ions found in the actual water samples.

Table 7 Comparison of adsorption performance for Cr(VI) with other adsorbent material

XPS and adsorption mechanisms

The adsorption mechanism was explained using the XPS, FTIR, and EDX analysis. The FTIR spectra of after adsorption confirmed that chromium has adsorbed on the surface of PANI-ZrWPO4 nanocomposite. The EDX analysis of after adsorption of Cr(VI) onto PANI-ZrWPO4 nanocomposite shows Cr existing with all other element presence. The aforementioned data confirm that Cr(VI) is electrostatic interaction with the surface of PANI-ZrWPO4 nanocomposite. Furthermore, the adsorption mechanism of Cr(VI) onto PANI-ZrWPO4 nanocomposite was investigated using XPS analysis to clarify the adsorption mechanism of Cr(VI) and the results are presented in Fig. 9. The XPS survey spectra of after adsorption Cr(VI) onto PANI-ZrWPO4 nanocomposite showed the presence of Cr2p along with other elements such as C1s, N1s, Zr3d, W4f, P2p, and O1s, indicating the adsorption of Cr(VI) onto PANI-ZrWPO4 (Fig. 9a). The high-resolution XPS spectrum of Cr2p was deconvoluted into two peaks at 576.8 eV and 586.5 eV, corresponding to Cr2p3/2 and Cr2p1/2, respectively (Bumajdad et al. 2017). These peaks indicate the presence of both Cr(VI) and Cr(III) ions on the surface of the nanocomposite. Therefore, the simultaneous presence of Cr(VI) and Cr(III) on the surface of PANI-ZrWPO4 nanocomposite proposes that some of the Cr(VI) is reduced to Cr(III) during the adsorption process. The -N = C and -NH- groups of polyanilines from PANI-ZrWPO4 get protonated in acidic environments. Then, the Cr(VI) ion (exist as HCrO4 or Cr2O72−) was electrostatically interacting with the positively charged nitrogen atom of the polyaniline group of PANI-ZrWPO4 nanocomposite during the adsorption process. In this process, the -C-NH- group of polyanilines of PANI-ZrWPO4 nanocomposite oxidized to –N = C– and –NH– / –N = group function as dynamic redox pair. Therefore, Cr(VI) was reduced to Cr(III) during in situ chemical reduction reaction (Scheme 1). Furthermore, the XPS spectrum of N1s after adsorption shows a peak at 398.2 eV, 399.4 eV, and 401.2 eV corresponding to quinoid amine, benzenoid amine, and positively charged nitrogen, respectively. After adsorption, the positively charged nitrogen atom peak area significantly decreased, suggesting an electrostatic force of interaction with negatively charged chromium species (as compared to the N1S spectrum before adsorption in Fig. 2f). This result indicated the simultaneous adsorption and reduction of Cr(VI) to Cr(III). After reduction, Cr(III) ion may be chelating with the amine group of the surface of the PANI-ZrWPO4 composite. The simultaneous adsorption-reduction of Cr(VI) to Cr(III) occurs on the surface of PANI-ZrWPO4 nanocomposite in an acidic environment and can be expressed as follows (Pakade et al. 2019):

Fig. 9
figure 9

a XPS survey spectra of after Cr(VI) adsorption of PANI-ZrWPO4 nanocomposite, high resolution spectra of b Cr2p and c N1s

$$\begin{array}{c}{PANI}^{2+}+ {2e}^{-}\to {PANI}^{0}\\ {2HCrO}_{4}^{-}+{7H}^{+}+ {3PANI}^{0} \to 2{Cr}^{3+}+ {3PANI}^{2+}+{ 8H}_{2}O\\ {Cr}_{2}{O}_{7}^{2-}+ {14H}^{+}+ {3PANI}^{0}\to {2Cr}^{3+}+{3PANI}^{2+}+ {7H}_{2}O\end{array}$$

Furthermore, adsorption occurs as a result of electrostatic interactions. This phenomenon can be attributed to the attraction between the negatively charged species of Cr(VI) solutions and the positively charged nitrogen atom of PANI-ZrWPO4. In aqueous solutions, Cr(VI) exists as HCrO4 at lower pH and as Cr2O72– at higher pH. When the pH is lower than the pHPZC (point of zero charge) of PANI-ZrWPO4, the positively charged nitrogen center of PANI can serve as dynamic anchoring sites for the negatively charged chromate and dichromate ions through electrostatic interactions. On the other hand, the adsorption of Cr(VI) onto PANI-ZrWPO4 nanocomposite can be explained by an ion exchange reaction. The presence of -OH groups in the phosphate component of the nanocomposite facilitates the ion exchange reaction. The -OH groups of the nanocomposite’s phosphate groups and the M–OH groups can undergo an interchange with the negative species of Cr(VI), such as dichromate and chromate ions, promoting an ion exchange process similar to that of an ion exchange resin. This can be shown in the form of equations below

$$\begin{array}{c}{-NH}_{3}^{+}+ {HCrO}_{4}^{-} \to {-NH}_{3}^{+}\dots \dots .{HCrO}_{4}^{-}\\ {-NH}_{3}^{+}+ {Cr}_{2}{O}_{7}^{2-} \to {-NH}_{3}^{+}\dots \dots \dots {Cr}_{2}{O}_{7}^{2-}\\ M-OH+ {H}_{3}{O}^{+}+{Cr}_{2}{O}_{7}^{2-}\to {M}^{+}\dots \dots .{Cr}_{2}{O}_{7}^{2-}+{2H}_{2}O\end{array}$$

Desorption and reusability study

In order to prevent the production of secondary waste and recover valuable materials, desorption is necessary for solid waste. In this study, desorption of Cr(VI) from PANI-ZrWPO4 nanocomposite was carried out in acidic (0.1 M HCl), basic (1 M NaOH), and neutral solutions at pH 3–12. The concentration of Cr(VI) in the filtrate solution was measured. The desorption of Cr(VI) was found to be low at lower pH, while it increased to 65% at a higher pH of 10. The removal efficiency of Cr(VI) onto PANI-ZrWPO4 nanocomposite was evaluated through five adsorption–desorption cycles, and it was observed that even after five cycles, approximately 80% of Cr(VI) was removed (Fig. S8). The leaching properties of PANI-ZrWPO4 nanocomposite were also investigated, and it was found that there was no leaching of atoms during the adsorption process. This confirms that the material is highly stable and durable in aqueous solutions.

Conclusions

In this study, PANI-ZrWPO4 nanocomposite was prepared using in situ polymerization and tested its effectiveness for removing Cr(VI) from water. The nanocomposite’s physicochemical properties were analyzed using various techniques. The PANI-ZrWPO4 nanocomposite outperformed individual PANI and ZrWPO4 in Cr(VI) removal. The optimal pH value for adsorption was determined to be 5.4. The adsorption kinetics followed a pseudo-second-order model, indicating a chemisorption process. The Langmuir isotherm model fits the adsorption data well, with a maximum adsorption capacity of 71.4 mg g−1. The optimum condition showed around 98% Cr(VI) removal with 99.1 mg adsorbent dose, 119.74 min time, initial concentration 5.25 ppm, pH 2.19, temperature 68.59 °C and stirring rate 372.7 rpm by BBD model. The adsorption mechanism involved electrostatic interaction and in situ reduction of Cr(VI) to Cr(III). Leaching studies confirmed the stability of the nanocomposite, and it showed excellent reusability for up to five cycles. These findings highlight the potential of PANI-ZrWPO4 nanocomposite as an efficient adsorbent for Cr(VI) removal from wastewater, promising environmental remediation applications.