1 Introduction

Onion (Allium cepa) is one of the most extensively grown vegetable crops worldwide. It is renowned for several health benefits upon consumption; most notable are its antiviral and antioxidant properties [1]. The massive consumption of onions results in the production of tons of onion skin (Fig. 1A, B), which when left to rot without adequate disposal contributes to biowaste, pollution, and loss of aesthetic value of the natural environment [2]. The large of amount quercetin (a flavonoid) in Allium cepa has been reported to prevent cancer, cardiovascular diseases, cataracts, and other vicious ailments [3].

Fig. 1
figure 1

A Onions (Allium cepa). B Onion skins. C Dried onion skin–based hydrochar. D Pulverized pristine carbon

The presence of components such as cellulose, vitamins, proteins, and flavonoids in onion waste provides several functionalities that can be harnessed for water treatment via adsorption techniques. The adsorption technique has been reported as the most convenient and efficient technique for the remediation of chemical pollutants in aqueous media [4]. However, the development of efficient, cost-effective, and abundant adsorbent suitable for large-scale and field applications is still subject to further research. The United Nations designated 2020 as the beginning of the “Decade of Action” to achieve the Sustainable Development Goals (SDGs) by 2030 [5]. The conversion of biobased waste materials aids in the management of solid waste and has an impact on several aspects of development across all three sustainability-related spheres: the environment, the economy, and the society [5]. Public health (SDG 3), solving water shortages, and tackling climate challenges (SDG 6 and 13) are the key guiding concepts of SDGs that support the progress of the “waste to wealth” concepts. Hence, the application of onion skin–derived carbon (OSDC) as adsorbents in water treatment applications finds its merits based on the concept of sustainable/green chemistry and the provision of a useful pathway to waste valorization towards achieving SDGs.

Methylparaben, also known as methyl 4-hydroxybenzoate, is a preservative that is frequently utilized by food industries, and in the manufacturing of pharmaceutical and personal care products, due to its antimicrobial activities [6, 7]. The vast application of this compound has led to its prevalence in drinking water and surface water. It is currently regarded as one of the “emerging chemical pollutants” [8]. Water sources such as rivers, swimming pools, seas, drinking water, and tap water may contain methylparaben, raising the possibility of human exposure. Methylparaben’s activity as a hormone disruptor and its toxicity are strongly connected [9, 10]. The presence of methylparaben in tumor tissues has been linked to breast cancer, according to several recent investigations. The discovery of methylparaben in human tissues, urine, milk, serum, and seminal fluid due to environmental exposures has also recently been described. Furthermore, methylparaben is potentially hazardous to human health due to its suspected carcinogenicity (linked to breast cancer) and ability to disrupt the endocrine system [9, 10].

In this study, we utilized a low-cost method for the preparation of porous carbon without the use of extensive chemicals from a globally available waste, onion skin. Furthermore, we carried out comprehensive material characterization and explored its adsorptive potential for methylparaben decontamination in water.

2 Experimental

2.1 Materials and reagents

A neat standard (98% purity) of methylparaben was supplied by Sigma-Aldrich (USA). Analytical grade (98% purity) of sodium azide (NaN3), hydrochloric acid (HCl), calcium chloride (CaCl2), and sodium hydroxide (NaOH) was purchased from Sigma-Aldrich (USA). HPLC-grade methanol and acetonitrile were from Sigma-Aldrich. Polytetrafluoroethylene (PTFE) membrane syringe filters (0.22 µm) were purchased from Stargate Scientific (South Africa). The working solutions were prepared with ultra-pure water obtained from the Direct- Q® 3UV-R purifier system.

2.2 Preparation of pristine carbon from onion skin

In this study, onion skin was gathered from a local market in Sunnyside Pretoria (South Africa), washed with deionized (DI) water, and dried for 12 h at 60 °C. The onion skin–based hydrochar was then produced via a process called hydrothermal carbonization, which entailed heating the onion skin at 200 °C in DI water (300 g/L) for 4 h. The resultant hydrochar was collected through filtration, rinsed repeatedly with DI water, and then dried for 12 h at 90 °C (Fig. 1C). Lastly, using a chemical vapor deposition (CVD) device with a ramp rate of 5 °C/min, the onion skin–derived hydrochar was carbonized at 400 °C for 1 h in an inert environment with the aid of argon. The resultant carbon was pulverized and sieved with a mesh size of 50 µm (Fig. 1D).

2.3 Material characterization

The structure and morphology of the onion skin–derived carbon (OSDC) were examined by various analytical techniques. Powder X-ray diffraction (PXRD) analysis was carried out using an X-ray diffractometer (Bruker BV 2D Phaser, Bruker Optik GmbH, Ettlingen, Germany) with Co radiation (α = 1.79 Å) and reflection geometry at 2θ values (5–70°) at 5.24 s requisition time per step. Using a Bruker Alpha-T spectrometer, Fourier transformed infrared spectroscopy (FTIR) study was carried out in the 500–4000 cm−1 range (Bruker Optik GmbH, Ettlingen, Germany). The degree of graphitization using a WITec alpha 300 RAS + Confocal micro-Raman microscope operated at 500–3000 cm−1, 5 mW, 150 s, and 532 nm for frequency range, laser power, spectral acquisition time, and laser wavelength, respectively. A Zeiss Ultra-Plus 55 field emission scanning electron microscope (FE-SEM) with an energy-dispersive X-ray spectrometer (EDS) was used to obtain SEM images (OXFORD Link-ISIS-300 Zeiss, Germany).

The porosity of carbon material was characterized by the physical adsorption of N2 adsorption/desorption isotherms at 77 K using the NOVA Touch Surface Analyzer system (Anton Paar, South Africa). The surface area was determined following a model of Brunauer − Emmett − Teller (BET) and Barrett − Joyner − Halenda (BJH) techniques. Using a Physical Electronics Quantum 2000 and the CasaXPS program, an X-ray photoelectron spectroscopy (XPS) examination was carried out. The X-ray fluorescence (XRF) technique was used to carry out the elemental analysis. The ThermoFisher ARL PerformʹX Sequential XRF instrument with UniQuant software was used for analyses. The point of zero net charge (pHPZC) of OSDC was determined using the titrimetric method [8].

2.4 Adsorption test

In 40-mL PTFE screw-capped amber vials at 25 ± 1 °C, batch adsorption tests of the OSDC with methylparaben as the target contaminant were carried out. As a background electrolyte, 0.01 mol/L CaCl2 in deionized water was utilized. The initial sorbate concentrations used in the sorption isotherm experiment ranged from 5 to 40 mg/L. An orbital shaker was used to agitate the vials for 24 h at 200 rpm. After the adsorption supernatant was decanted, desorption experiments were carried out by adding 5 mL of background electrolyte. With the aid of 0.1 M HCl and/or 0.01 M NaOH, the pH of the solutions was adjusted to study the role of solution pH between pH 1 and 13 [11]. All the batch experiments were performed in duplicates.

2.5 HPLC instrumentation and analyte quantification

Afterward, 2 mL aliquots of the supernatant were filtered through 0.22-micron syringe filters after the vials had been centrifuged at 9860 × g for 20 min, before determining the amount of methylparaben in the solution. Analysis of unadsorbed or desorbed methylparaben was carried out with the aid of high-performance liquid chromatography coupled with a diode array detector (HPLC–DAD). An Agilent HPLC 1200 infinity series, equipped with a photodiode array detector (Agilent Technologies, Waldbronn, Germany), was utilized. The chromatograms were recorded at 250 nm. An Agilent Zorbax Eclipse Plus C18 column (3.5 µm × 150 mm × 4.6 mm) (Agilent Newport, CA, USA) was at an oven temperature of 25 °C. The mobile phase consisted of 70% methanol (mobile phase A) and 30% water (mobile phase B). An isocratic mode with a flow rate of 0.100 mL/min was used for the analysis.

A 5-point calibration curve with values ranging from 2.5 to 20 mg/L was used to quantify the methylparaben. The target analyte peak area versus the analyte concentration was plotted, and this data was used to determine the calibration. The difference between the initial and equilibrium liquid-phase concentrations was used to calculate the quantity of methylparaben adsorbed (Eqs. 1 and 2)

$${q}_{e} \left(\frac{\mathrm{mg}}{\mathrm{g}}\right)=\frac{ ({C}_{0}-{C}_{e}){V}_{0}}{{S}_{m}}$$
(1)
$$\mathrm{Removal\;efficiency}\left(\%\right)=\frac{({C}_{0}-{C}_{e})}{{C}_{0}}\times 100$$
(2)

where Vo is the initial volume (L), Sm is the mass (g) of the adsorbent, Co is the initial concentration (mg/L), and Ce is the equilibrium solute concentration (mg/L).

The concentrations of the pollutant were measured using methylparaben standards, and the calibration curves displayed high correlation coefficients (R2 > 0.99). To ensure reproducibility, each series of experiments was performed in duplicates. Vials without adsorbent were used as controls in each batch of the experiment. During the equilibration interval, these controls did not exhibit any appreciable microbial degradation or losses to the glassware’s walls.

3 Results and discussions

3.1 Physicochemical properties and elemental results

The pH of the biomass-derived carbon in its pristine form was found to be 7.9 in CaCl2(aq) solution. The specific surface area (SSA), pore volume, and pore size of carbon derived from onion skin as determined using the BET method are approximately 708 m2/g, 0.95 cc/g, and 0.85 nm, respectively. In the absence of chemical activation, the SSA value obtained in this study for OSDC (~ 708 m2/g) is higher than values obtained for peanut shell (3.1 m2/g), diary manure (1.6 m2/g), poultry litter (3.9 m2/g), hardwood (0.4 m2/g), sugarcane bagasse (0.8 m2/g), Prosopis africana shell (3.1 m2/g), fescue straw (1.8 m2/g), oak wood (1.9 m2/g), corn stover (3.1 m2/g), pine chip (6.2 m2/g), orange pomace (1.2 m2/g), and cottonseed hull (4.7 m2/g), around similar processing temperature [12]. The SSA value of OSDC was almost the same as the value obtained from activated carbon derived from an African palm shell (723 m2/g) [13]. Proximate analysis such as % moisture and ash contents of the biomass-derived carbon was carried out following a method described by Waqas et al. [14] (Eqs. 3 and 4). The moisture and ash contents of the carbonaceous material were 3.7% and 55%, respectively. The most prominent elements detected in the dry weight (DW) of OSDC are presented in Table 1.

Table 1 Basic physicochemical properties and elemental analysis of onion skin–derived carbon (OSDC)
$$\mathrm{Moisture\;}\left(\mathrm{\%}\right)=\frac{\mathrm{Dry\;weight\;of\;sample}}{\mathrm{\;Initial\;weight\;of\;sample}}\times 100$$
(3)
$$\mathrm{Ash\;}\left(\mathrm{\%}\right)=\frac{\mathrm{Weight\;of\;Ashed\;sample}}{\mathrm{Dry\;weight\;of\;sample}}\times 100$$
(4)

The XRF software analyzes all elements in the periodic table between Na and U, but only the ten most abundant elements found above the detection limits were reported. The result revealed diverse mineral composition in OSDC with the highest proportion of calcium (6.27 mg/g DW) and sulfur content being the least (0.07 mg/g DW) among the ten elements reported. Biomass processing temperature has been reported to influence not only the morphology of carbonaceous materials but the mineralogical composition as well [12]. However, there must be a balance between the cost associated with energy consumption and the desirable properties of the carbon material.

3.2 X-ray photoelectron spectroscopy results

The XPS analysis of OSDC is shown in Fig. 2A–H. This was carried out to determine the oxidation states, binding energies, and species composition of the surface. The presence of bonded carbon, oxygen, nitrogen, and trace metal species was also revealed by XPS results (Fig. 2A–H). The main C1s peak which is attributed to sp2 C = C and sp3 C–C bonding in the carbon material was observed at the binding energy of 284.6 and 284.7 eV, respectively (Fig. 2A, B). OSDC revealed three extra small peaks at 285.7, 287.2, and 288.7 eV which are due to C-O, C = O, and O-C = O bonds, respectively (Fig. 2B). The prominent O1s peak in the sample is C-O bonding at 531.2 eV and an extra peak at a binding energy of 532.8 eV belonging to C = O (Fig. 2C). The N1s at binding energies of 398.5 eV and 399.9 eV may be attributed to organic-N (i.e., pyridinic-N and pyrrolic-N structures), organic azide, or cyanide functionalities (Fig. 2D), essentially of N-doped sp2 hybridized system of carbon material [15]. The organic-N may bond to the edges or defects of the carbon material and contributes to the π electron system of the carbon materials [16]. Furthermore, peaks of Mg1s, Na1s, Ca2p, and Cl2p at various binding energies (Fig. 2E, F) buttress the presence of trace elements in the OSDC sample, as reported by XRF results.

Fig. 2
figure 2

XPS of onion skin–derived carbon. A XPS survey. B C1s. C O1s. D N1s. E Mg1s. F Na1s. G Ca2p. H Cl2p peaks on the sample surface

3.3 SEM–EDS, FTIR, and XRD analysis

SEM was utilized to examine the surface morphology of the carbonized onion skin. The carbonized sample consists of a heterogeneous, micron-sized particle (Fig. 3A). The OSDC sample possesses a rough surface, irregular grain size, and porous structure. Reports have shown that materials with porous and rough surface morphology possess good adsorption capacity, as these attributes facilitate adherence and entrapment of contaminants during sorption processes [17]. The EDS spectrum reveals the elemental composition of the carbon derived from the onion skin (Fig. 3B), as additional confirmation of XPS and XRF results.

Fig. 3
figure 3

A SEM image. B EDS analysis inserted in the image analyzed. C FTIR analysis showing various peaks. D XRD plot for the carbonized onion skin

Figure 3C reveals the FTIR spectra of the carbonized onion skin obtained in the range of 500–4000 cm−1. The peak at 3340 cm−1 is assigned to the presence of O–H stretching vibration of hydroxyl functional groups, and the sp2 C = C stretching vibration was observed at 1592 cm−1, C-H bending at 1445 cm−1, and C-O vibrations at 1382, while C-H stretching, alkyl halides, and metal oxides are often detected around the fingerprint regions (< 1000 cm−1) [18, 19]. The XRD spectrum confirms the presence of the graphitic phase of the carbon derived from onion skin. The biomass-based carbon seems to be mainly amorphous considering the hump/broad nature of the peaks (Fig. 3D). The broad peak around 23.8° and narrow peak around 43.6°, respectively, are often ascribed to the (002) and (100) plane, respectively, of graphitic carbon [11, 20]. The sharp peak observed at 35.9° corresponds to iron oxide (JCPDS No 19–0629) [15].

3.4 Raman spectroscopy and BET analysis

Raman spectroscopy is a vital tool for determining how much carbon has been graphitized. Two distinct bands may be seen in the Raman spectrum of carbon: the D-band, which represents disordered carbon, and the G-bands, which represent the vibration of sp2 carbon that is aromatic or graphitic. Additionally, the ID/IG ratio is utilized to describe the degree of disorder in carbon [21]. The G-band mode at 1590 cm−1 and the 2D band mode at 2690 cm−1 are typically the Raman characteristic features of high-quality carbon material, and they result from the typical first-order Raman scattering process (the tangential vibration of the sp2 carbon atoms) and the second-order process (double resonance Raman process), which involves two in-plane transverse optical modes (iTO) phonons close to the K-point [22].

As shown in Fig. 4C, the disorder-induced D-band appeared at ~ 1350 cm−1. The broad 2D peak may be a result of stacking disorder in the carbon structure, which suggests a multilayered carbon material was deduced from the onion skin waste. The low degree of ordering of the carbon corroborates the amorphous XRD pattern. According to reports, the typical Raman spectra of a high-quality monolayer, bilayer, and multilayer carbon material show I2D/IG ratios of > 2, ~ 1, and < 0.7, respectively [23]. Thus, we can assume that the carbon synthesized is multilayer, considering the ratio of the 2D and G peaks shown in Fig. 4C.

Fig. 4
figure 4

A BET isotherm plot. B Pore distribution. C Raman spectral of the porous carbon material derived from onion skin

The most intense peak in the XPS and Raman spectra was revealed as sp2 C = C structure at 284.6 eV, which represents a partially disordered network of the carbon multilayer structure and explains the D peak in the Raman spectrum. The BET isotherm of OSDC is shown in Fig. 4A. It depicts an H4-hysteresis loop observed in heterogenous/complex materials. The pore distribution of the carbon material as shown in Fig. 4B revealed the presence of micropores (less than 2 nm) and mesopores, with no macropores, respectively.

3.5 Adsorption isotherm and sorption hysteresis

When adsorption process achieves equilibrium, sorbent-sorbate interactions are described using adsorption isotherm models [24]. The adsorption isotherms of methylparaben on biomass-derived sorbent are shown in Table 2 and Fig. 5. The adsorption experimental data were fitted using the models given below. The Freundlich, Langmuir, linear, and Sips isotherm models were among these models. When describing the sorption equilibria of organic chemicals, the Freundlich model (FM) is frequently utilized (Eq. 5). The Langmuir model (LM) describes site-limiting sorption equilibrium (Eq. 6). The partitioning behavior of the selected PAHs between the sorbent-solution interphase can also be described using the linear equation (Eq. 7). The Sips model (Eq. 8) is a three-parameter model used to describe complex sorbent-sorbate interactions. It could be reduced to Langmuir or Freundlich model as a result of changes in the concentration of pollutants and surface interactions with the sorbents [25]. The sum of squared errors (SSE) (Eq. 9) was utilized to validate all adsorption models [26, 27].

$${q}_{e}={K}_{f}{ C}_{e}^{N}$$
(5)
$${q}_{e}=\frac{{q}_{\mathrm{max}}{K}_{L}{C}_{e}}{1 + {K}_{L}{C}_{e}}$$
(6)
$${q}_{e}={K}_{d}{C}_{e}$$
(7)
$${q}_{e }= \frac{{q}_{m}{K}_{s} {C}_{e}^{ms}}{1 + {K}_{s}{ . C}_{e}^{ms}}$$
(8)
$${\sum }_{i=1}^{n}({q}_{e,\mathrm{cal}}-{q}_{e, \mathrm{exp}}{)}_{i}^{2}$$
(9)

where Ce is the liquid-phase equilibrium concentration (mg/L) and qe is the solid-phase concentration (mg/g). Kd is the partition coefficient/adsorption capacity, KF is the sorption capacity-related parameter, KL is the Langmuir constant, N and ms are the isotherm nonlinearity indices or heterogeneity indicators, and qmax and qm are the maximal sorption capacities [28, 29].

Table 2 Adsorption isotherm models for methylparaben by OSDC and their sum of squared error (SSE) coefficients. Hysteresis index (H) was derived from the Freundlich isotherm model fitting of adsorption and desorption experimental data
Fig. 5
figure 5

A Isotherm fit for experimental data obtained for the methylparaben interaction with OSDC. B Sorption–desorption plot of OSDC-methylparaben interactions

The isotherm regression plots and parameters are presented in Table 2 and Fig. 5. The Freundlich isotherm model, which represents the multilayer adsorption mechanism, best describes the methylparaben interaction with onion skin–derived adsorbent with a lowest SSE value of ~ 0.45 and R2 > 0.99. An exceptionally high maximum adsorption capacity (qmax) value of ~ 8146 mg/g was recorded. Several types of interactions may have facilitated the high adsorption capacity, considering the functionalities of methylparaben and the moieties present on the surface of the adsorbent revealed by XPS data (i.e., the N-, O-, and H-containing groups). The role of hydrogen bonding, covalent bond, and π electron-donor-acceptor interactions, due to some degree of graphitization of the carbon material and aromatic rings of the pollutant, cannot be ruled out [30]. This complex interaction is also supported by the fact that the Sips model also fits the experimental data quite well and revealed an equally high adsorption capacity of ~ 5072 mg/g (qm). The adsorption intensity and heterogeneity index (ms: 1.282) predicted by Sips (three-parameter model) are quite similar to the adsorption intensity (N: 1.282) predicted by Freundlich (two-parameter model). This further buttresses the assertion that a heterogeneous and complex adsorption process occurred between methylparaben and OSDC and the physicochemical properties of the sorbate and sorbent played a huge role in the sorption process.

Desorption studies help forecast the likelihood of environmental recontamination and the possibility of the release of organic contaminants that have been adsorbed. As a result, it is necessary to determine the sorbed fraction that can return to the solution by finding a new equilibrium [31]. The Kf.des and Ndes are the desorption capacity and desorption intensity respectively for interaction between OSDC and methylparaben, and they were deduced from fitting the desorption experimental data to Freundlich isotherms [32]. Table 2 reveals that the sorbates’ computed H-index value was higher than zero and very near to 1, which suggests that sorption–desorption hysteresis (irreversibility) took place. The irreversible entrapment and slow rate of desorption of sorbed molecules are the two processes responsible for sorption hysteresis [33]. Hysteretic behavior in sorption processes has been linked to irreversible pore deformation of the sorbent and chemical hydrophobicity, which may be caused by sorbate-induced changes to the sorbent from its initial thermodynamic state via accumulation in unrelaxed free volume [33]. Numerous publications have been published in support of the theory that the pore-deformation mechanism is the primary factor in the irreversible sorption of organic molecules sorbed by carbonaceous materials [34].

3.6 Effect of pH and sorption thermodynamics

Solution pH plays an important role in the adsorption of organic contaminants because it may influence net charges during sorbate-sorbent interactions [25, 34]. The effect of pH was tested between pH of 1 and 13 for the removal of methylparaben by onion skin–derived adsorbent from aqueous solution. The pH of aqueous environmental systems varies depending on the nature and composition of the aquatic system.

Figure 6A reveals a significant increase in the adsorption of methylparaben at pH beyond the pKa of the target compound. The pKa of methylparaben is 8.5 and it is widely understood that compounds exist predominantly as neutral species before pKa values and as anionic species at pH above their pKa values [11, 35]. Figure 6B shows that the pH of OSDC point zero net charge (pHpzc) is 9.25. The surface charge of OSDC is negative when pH > pHpzc and positive when pH < pHpzc. Because OSDC and the solution (pH < 7) are both positively charged, electrostatic repulsion may have taken place, leading to lower adsorption performance at pH < 9.25. When the solution pH was above the sorbent’s pHpzc value and sorbate’s pKa value, both become negatively charged, yet the adsorption capacity increased at solution pH > 9.25. This finding is in line with a study by Xiong et al. [8] and suggests that electrostatic interaction only had a minor role in the adsorption processes. Therefore, there is a likelihood that a covalent bond will form between the graphenic surface of the carbonaceous material and the phenolic groups of parabens at basic conditions and above the pKa value of methylparaben. The electrostatic repulsion which may have occurred between the negatively charged sorbate and sorbent at the basic pH range was less significant than this bonding interaction. This is also supported by the interaction of OSDC and methylparaben with respect to pHpzc (Fig. 6B). Deprotonation of methylparaben results from the addition of OH ions, which creates unpaired electrons for covalent bonding interactions with the carbon generated from onion skin.

Fig. 6
figure 6

A The effect of varying pH conditions on the adsorption performance of the synthesized carbon material from onion skin waste. B pHpzc of OSDC

Furthermore, due to the presence of metals in the OSDC sample as shown in the XRF data presented in Table 1, there might be leaching of metal ions into solution during agitation at acidic pH values. The presence of these cations potentially alters the solution chemistry and/or competes for binding sites with methylparaben, which may also contribute to the decline in methylparaben removal at acidic pH range. Overall, the outcome of the pH study demonstrated that the adsorbent had ~ 100% adsorption efficiency at extremely alkaline conditions.

Temperature change impacts several physicochemical and biological processes. Therefore, at 25, 35, and 45 °C, respectively, the effect of temperature on the adsorption of methylparaben by OSDC was investigated. Using the Van’t Hoff plot (Fig. 7) and Eqs. 10 and 11, the free energy change (ΔG˚), enthalpy (ΔH˚), and entropy (ΔS˚) were extrapolated to describe the thermodynamic nature of methylparaben adsorption as a function of temperature [25, 26].

$$\ln\;K_d=\frac{\Delta S^\circ}R-\frac{\Delta H^\circ}{RT}$$
(10)
$$\Delta G^\circ = \Delta H^\circ -T\Delta S^\circ$$
(11)

where R = the gas constant (8.314 J/mol.K), T = the thermodynamic temperature (K), and Kd is the adsorption capacity calculated using the partitioning model. \(\Delta G\) is the change in the Gibbs free energy ((J/mol)), \(\Delta H\) is the change in enthalpy (KJ/mol), and \(\Delta S\) is the change in entropy (kJ/mol.K).

Fig. 7
figure 7

Van’t Hoff plot for methylparaben adsorption onto OSDC from aqueous solution

Table 3 reveals positive values of sorption enthalpy (\(\Delta H^\circ )\) and entropy \(\left(\Delta S^\circ \right),\) and a negative value of \(\Delta G\) for OSDC-methylparaben interaction, which indicates a spontaneous endothermic process as the temperature increases. The thermodynamic parameters showed OSDC adsorption of methylparaben is more feasible at ambient temperature (lowest Gibb’s free energy) and increasing the temperature led to an increase in systemic perturbances (\(+\Delta S^\circ )\), which may necessarily not favor sorbate-sorbent interactions. The efficiency of OSDC at ambient temperature is beneficial in terms of energy cost and process sustainability.

Table 3 Thermodynamic parameters for adsorption of methylparaben onto onion skin–derived carbon

3.7 Probable sorbent-sorbate mechanism of interaction

Parabens are ubiquitous water contaminants because they are widely used as preservatives in pharmaceuticals and personal care products. They are a series of parahydroxybenzoates or parahydroxybenzoic acid esters (also known as 4-hydroxybenzoic acid) [36]. The moieties/functional groups, molecular conformation, and electronic structure of the adsorbents and adsorbates control how the two interact. The Sips model fits well with the experimental adsorption results for methylparaben interaction with biomass waste–derived carbon. This predicts the existence of complex interactions that can be altered by the contaminant’s concentration and solution pH. It has been suggested that parabens and carbon material interact in a complex electron donor–acceptor mechanism [37]. The aromatic ring of the methylparaben serves as the electron-acceptor and the carbonyl group on the carbonaceous adsorbent serves as the electron-donor, leading to covalent bonding interaction [13, 38].

Other non-covalent bonding interactions are possible between methylparaben and the carbon-based materials; these binding interactions include van der Waals, hydrophobic bonding, hydrogen bonding, π-π electron-donor–acceptor interactions, and pore-filling mechanisms (Fig. 8), which have been reported to contribute to the sorption mechanisms of many organic pollutants by carbon-based materials [39,40,41,42]. Interactions between π-electrons and acidic/cationic groups are feasible in water and at different pH levels. Due to interactions between the cations (H+, Ca2+) in the medium, OSDC, and π-electrons in the aromatic ring of the methylparaben, these interactions are adversely affected by acidic pH as supported by Fig. 6A. Additionally, the presence of electronegative atoms like nitrogen as shown by XPS data of OSDC and the proton-rich structure of methylparaben suggest that electrostatic attraction and repulsion in ionic aqueous medium cannot be entirely ruled out, especially under variable pH conditions [43].

Fig. 8
figure 8

Plausible mechanisms of interaction between methylparaben and OSDC adsorbent

4 Conclusion

In the context of waste to wealth, as well as green and sustainable chemistry, the findings in this study are very important for possible environmental and industrial applications of onion skin waste–derived adsorbents for the removal of methylparaben and other industrial addictive from wastewater. The isotherm analyses demonstrate that the sorption process as predicted by Freundlich and Sips models follows a multilayer adsorption mechanism on the heterogeneous surface of the carbon material. Furthermore, very high adsorption maximal qmax and qm of ~ 8146 mg/g and ~ 5072 mg/g, respectively, were obtained using OSDC. This study shows that the removal efficiency of ~ 100% is obtainable under optimal conditions. In conclusion, this study shows that the carbon-based material obtained from onion skin waste can be used to successfully remove methylparaben from contaminated water and that the material can be explored as a polishing tool in water treatment facilities. Due to its adsorption capacity, water permeability, and physicochemical properties, OSDC may be used to fabricate filters and membranes for water purification applications. Although, prior to field-based or industrial-scale water treatment applications, a thorough techno-economic feasibility analysis and continuous fixed-bed column adsorption studies are crucial.