Introduction

Water is a unique gift of nature to mankind since it is an essential and renewable resource to sustain life on earth. Unfortunately, freshwater ecosystem is badly disturbed by excessive use of dyes in plastics, textile, cosmetics, paper and paint industries (Lellis et al. 2019). Contaminated effluents coming from textile industries contain different types of dyes such as azo dyes, nitro dyes, acid dyes, basic or cationic dyes. During dyeing and finishing processes, almost 20,000 tons of these dyes lost to effluents every year and persist in environment because of their high stability to light and temperature. Among these, crystal violet (a triphenyl methane) is a cationic dye which is regarded as biohazardous substance. Because of its resistance to biodegradation, it is a serious threat to aquatic life and results in potential cause of carcinogen and promotes tumor growth in some species of fish (Mani and Bharagava 2016). Crystal violet dye causes serious health problem like kidney failure permanent blindness and skin irritation when inhaled or ingested (Karam et al. 2021). Treatment of dye containing effluent is a worldwide issue. For this many physical, chemical and biological methods are used. Among physical methods, adsorption is one of cost-effective and environment friendly process to remove dyes by using natural, agricultural, and industrial adsorbents (Sharma and Kaur 2018).

Nowadays, various adsorbent such as hybrid nanomaterials, carbon-based nano-adsorbent, transition metal-based oxides, magnetic and non-magnetic metal oxides nanocomposites, polymer-based nanocomposites, ceramic-based adsorbent, metal organic frameworks and agriculture-based biosorbents are used to treat dye effluents. Among agriculture, domestic and plant biomass waste several low-cost adsorbents like rice husk, grapefruit waste, walnut shell, coconut leaves, lemon peel, tea waste, raw maize cob, pine tree leaves, apple and banana peel have been used by many researcher in dye waste remediation (Dutta et al. 2021). Due to large surface area, porosity and thermal stability activated carbon was found to be a well-known adsorbent for removal of dyes. Adsorption of dyes on activated carbon was found to be very efficient, low cost and simple (Elhadiri et al. 2020). Recently, researcher focused on the use of low-cost activated carbon from various agricultural waste like olive stone, almond shell, saw dust, coconut shell, eucalyptus bark, apricot and peach stones for removal of dyes (Blachnio et al. 2020). Onion is one of the important vegetable crops, composition of onion includes amino acids, vitamins, phenolic and other biologically active compounds. Functional groups that present in compounds make the native and modified onion skin as a good sorption material for removal of various metals (Cd+2, Pb+2, Cu+2, Ni+2, Zn+2) (Shaikhiev et al. 2022).

In the present study, novel biosorbent based on onion waste has been synthesized and used as an ecofriendly and cost-effective source for removal of crystal violet dye. To enhance porosity chemical activation was carried out by potassium hydroxide as an activator. To find surface area and nature of porosity, BJH method was used. For the application purpose, adsorption technique has been adopted to find the adsorption capacity of carbon before and after activation. Effect of various parameters like concentration, temperature and contact time were studied. To understand the nature of adsorption, thermodynamics studies and spectroscopic analysis of CV sorption by carbon and activated carbon from an aqueous solution were investigated because this information is currently quite limited.

Materials and method

Materials

Onion bulb was employed as a precursor to extract carbon for use as an adsorbent, and crystal violet dye stock solution was diluted to make desired concentrations that were used as an adsorbate. Potassium hydroxide was used after dilution as an activator. All the chemicals were of analytical quality and no further purification was necessary. Deionized water (DI) was used for all the experiments.

Carbonization

After removing the onion skin and rinsing the onion bulb with DI water several time to remove any dust particles, the onion bulb is then sliced into small pieces. This raw material was then dried in oven at 110 °C for 24 h. Dried carbon precursor was then ground into powder and carbonized in tube furnace set at 450 °C for 1 h with heating rate of 15 °C/min under continuous nitrogen gas flow (0.2 l/min). The carbonized sample was initially ground into small particles, washed with dilute acid followed by distilled water until the filtrate was neutral to pH. After drying at 110 °C the carbonized material was stored in glass vials. Carbon (C) sample was analyzed by using different techniques like X-ray diffraction (XRD), Fourier transform infrared (FTIR) spectroscopy, field emission scanning electron microscopy (FESEM) and thermogravimetric analysis (TGA).

Activation

Carbonized sample (1 g) was soaked with 3 M KOH overnight before being activated in tube furnace set at 600 °C for 1 h with heating rate of 20 °C/min under continuous nitrogen gas flow (0.2 l/min). Multiple washing with DI water was performed to ensure that the KOH content was removed from activated carbon sample. This sample was then oven dried at 110 °C and then stored in glass vials. Activated carbon (AC) sample was subjected to different analysis like XRD, FTIR, FESEM and TGA. Surface area and pore size of carbon and activated carbon was determined by using Barrett–Joyner–Halenda (BJH) analysis.

Adsorption study

Batch adsorption experiment was carried at different temperature to find the efficiency of onion-based activated carbon. For this purpose, 30 mg of adsorbent was added in 10 mL of each solution with different concentration (5, 10, 20, 30, 50 and 100 mg/L) of crystal violet dye to make a suspension. The suspension was shaken in end-to-end shaker bath for 3 h at speed of 120 rpm. To cutoff the interaction between adsorbate and adsorbent, each sample was immediately filtered. The filtrate is then subjected to UV analysis by UV–Visible spectrophotometer at the wavelength of maximum absorbance (580 nm). Equilibrium concentration (\({C}_{\mathrm{e}}\)) of adsorbate was calculate through calibration curve prepared from known concentrations of crystal violet dye. Amount adsorb to the surface of adsorbent (\({q}_{\mathrm{e}}\)) was calculated by following relationship.

$${q}_{\mathrm{e}} =\frac{{C}_{\mathrm{o}}-{C}_{\mathrm{e}}}{m}\times V$$
(1)

where \({C}_{\mathrm{o}}\) and \({C}_{\mathrm{e}}\) are initial and equilibrium concentration, m is the mass of adsorbent in gram, and V is the volume of adsorbate in L.

Results and discussion

X-ray diffraction analysis (XRD)

XRD analysis was performed with JDX-3532 X-ray diffractometer (JEOL-Japan) with Mn filters and Cu Kα radiation. 2θ values were recorded between 10 and 80 degree with step size of 0.30 degree and step length of 5 degree per second. To find the nature of adsorbent, both carbon and activated carbon were subjected to X-ray diffraction analysis. Figure 1 represents X-ray diffraction pattern of carbon before and after activation. Two broad diffraction peaks around 23° and 43° associated with diffraction from (002) and (100) plane, respectively.

Fig. 1
figure 1

X-ray diffractograms of carbon and activated carbon

Primarily amorphous form of carbon may be deduced from presence of broad diffraction peaks and absence of sharp peaks. In case of activated carbon broad and depressed diffraction peak around 43° suggest that intragraphitic layer is not as developed as it might be. These results indicated that activated carbon shows a very disordered microcrystalline structure (Farma 2019; Khalil et al. 2013; Shamsuddin et al. 2016).

Fourier transform infrared spectroscopy (FTIR)

Figure 2 displays the FTIR Spectra of carbon before and after it has been activated (recorded on Nicolet 6700 USA).

Fig. 2
figure 2

FTIR spectra of carbon and activated carbon

The band around 3449 cm−1 may be attributed to stretching vibration of hydroxyl group. The prominent band around 1736 cm−1 was identified as belongings to carbonyl group and may be the result of stretching vibration in esters, aldehyde, ketone and carboxylic groups that are primary component of carbon precursor. The C=C stretching vibration in aromatic rings that are found to be part of carbonaceous material correspond to the absorption band that is located at 1585 cm-1. The region in between 700 and 1100 cm−1 has a variety of bands that are associated with aromatic, out of plane C–H bending with varying degrees of substitution. The band that centers about 1364 cm−1 may be attributed to C–H aliphatic bending. It is possible that C–O stretching vibration of carboxylic acid and alcoholic groups are responsible for the absorption band at 1216 cm−1 (Joshi and Pokharel 2013; Wazir et al. 2020).

Field emission scanning electron microscopy (FESEM)

Figure 3 shows the surface morphology of material which was performed through FESEM (SEM HV: 10.00 kV) model TESCAN MIRA3 XMU.

Fig. 3
figure 3

FESEM images of carbon (a, c) and activated carbon (b, d)

For this process, sample was first deposited on double sided carbon tape placed on aluminium holder and before analysis sample was sputter with gold and tungsten. The FESEM images of carbon before and after activation, they provide a very clear illustration of the establishment of porous network after activation and drastic change in surface morphology (Castro et al. 2019). The creation of fine porous structure with a variety of cavities is the result of activation of carbon with KOH the diverse porous structure both in micro and nm range can be observed in Fig. 3a–d. The porous morphology of material is therefore essential for the removal of contaminants like dyes from water samples.

Thermogravimetric analysis (TGA)

Thermogravimetric analyzer (model PerkinElmer USA) was used to characterize thermal stability of carbon before and after activation. Weight loss as a function of temperature owing to various physical and chemical phenomenon as shown in Fig. 4.

Fig. 4
figure 4

TGA curve for carbon and activated carbon

It is clear from TGA curve that thermal decomposition of carbon involves three stages. In the first stage (25–200 °C), C and AC lose 3.6% 12.1% of their weights, respectively, due to release of adsorb moisture content in the sample, more weight loss in case of AC during this stage refers to entrapped moisture content into porous network while stage II (200–1000 °C) displays no substantial mass loss corresponds to the stability of material in this temperature range. Stage III (Above 1000 °C) indicates a dramatic decline in weight loss that may be due to volatile component and thermal breakdown of functional group present in carbon (Bazan et al. 2016).

Surface area analysis

Barrett–Joyner and Halenda (BJH) analysis was used to obtain nitrogen adsorption desorption isotherm that was performed using NOVA 1200e Quantachrome instrument. According to IUPAC classification the nitrogen adsorption desorption isotherm of carbon activated with KOH at 600 °C is supposed to be a type IV isotherm which is the features of mesoporous material. Type IV isotherm ascribes to monolayer as well as multilayer adsorption which is then followed by capillary condensation via pores that have a tapered slit like structure. Hysteresis loop in adsorption desorption curve is represented in Fig. 5 which shows that material in question is strongly mesoporous with some degree of macroporosity as well (Ali et al. 2020).

Fig. 5
figure 5

BJH analysis and pore size distribution curve for activated carbon

From the pore distribution curve (inset of Fig. 5), it was concluded that pore diameter ranges from 3 to 107 nm and most of the volume (0.23 cm3/g) is occupied by mesopores. Activated carbon was found to be highly porous with BET surface area of 292.8 m2/g. Other textural parameters like pore volume and pore diameter are enlisted in Table 1.

Table 1 Textural parameters of activated carbon obtain by BJH analysis

Zeta potential

Zeta potential of adsorbent suspension at different pH and room temperature was determined using Zetasizer Nano ZSP. Zeta potential is the charge that develop at the solid liquid interface. Plot of zeta potential vs pH used to find isoelectric point (IEP) that was found to be 3.7 and 2.2 for carbon and activated carbon, respectively (Fig. 6). Results indicated that surface of adsorbent is negatively charges beyond their IEP. Present study was performed between pH 6 and 7 as the zeta potential was found to be lower than − 30 mV it suggested to be more suitable for adsorption of cationic dyes as negative group like dissociative carboxyl groups are present on surface of carbon (Loulidi et al. 2020). Adsorption of CV dyes increases with pH, and higher adsorption capacities were reported for adsorption of CV dyes at pH > pHpzc (Taktak et al. 2022).

Fig. 6
figure 6

Zeta potential vs pH for carbon and activated carbon

UV–visible spectroscopy

Figure 7 represents the adsorption capacity of synthesized activated carbon. For this purpose, different concentrations of CV (5, 10, 20, 30, 50 and 100 mg/L) were prepared; and then, UV–visible spectra were recorded at λmax = 580 nm that was found by running the scan from 400 to 800 nm.

Fig. 7
figure 7

Absorption of CV (10 mg/L) solution by using carbon and activated carbon

Using calibration curve, equilibrium concentration was calculated that was further used to evaluate different parameter. Absorption spectra for 10 mg/L solution of CV dye before and after adsorption were measured which shows a remarkable decrease in absorbance after using carbon and activated carbon as an adsorbent.

Adsorption isotherm

Adsorption isotherm is a graphical representation between equilibrium concentration and amount adsorbed at constant temperature.

Adsorption processes are studied using an adsorption isotherm that are very useful to analyze the interaction between adsorbate and adsorbent. Adsorption isotherms are important in optimizing the use of adsorbent provide useful data to explore the mechanism for adsorption and to develop an equation which describe the results (Joshi and Pokharel 2013). Adsorption isotherm depict that activated carbon has more adsorption capacity then carbon (Fig. 8a) as equilibrium is reached upto the equilibrium concentration of 67 mg/L as compared to carbon where it is 33 mg/L. As the temperature increases adsorption capacity increases because more adsorption sites are created (Fig. 8b).

Fig. 8
figure 8

Adsorption isotherm of carbon before and after activation at 298 K (a) and activated carbon at 293, 298 and 303 K (b)

Adsorption modeling

To investigate the equilibrium behavior between CV dye and adsorbent, it is significant to establish the best correlation for the equilibrium isotherm. For this purpose, Langmuir and Freundlich models were used to determine the appropriate isotherm require for adsorption of CV (Foroutan et al. 2021). The Langmuir isotherm model is most widely used isotherm for adsorption studies to describe the monolayer adsorption on the homogeneous surface of adsorbent in solid liquid system. Linear form of Langmuir model can be represented as follows:

$$\frac{1}{{q}_{\mathrm{e}}}=\frac{1}{{q}_{\mathrm{m}}}+\frac{1}{{k}_{\mathrm{L}}{q}_{\mathrm{m}}}\cdot \frac{1}{{C}_{\mathrm{e}}}$$
(2)

where \({C}_{\mathrm{e}}\) (mg/L) is the equilibrium concentration, \({q}_{\mathrm{e}}\) (mg/g) is the amount adsorbed at equilibrium, \({q}_{\mathrm{m}}\) is the monolayer adsorption capacity, and \({K}_{\mathrm{L}}\) is the Langmuir constant. By plotting \(\frac{1}{{q}_{\mathrm{e}}}\) vs \(\frac{1}{{C}_{\mathrm{e}}}\) straight line is obtained with R2 value near to unity both for carbon and activated carbon. From slope the value of \({k}_{\mathrm{L}}\) was found to be 8.9 and 23.4 mg/g at 293 K for carbon and activated carbon, respectively.

Whereas from the intercept, the value of \({q}_{\mathrm{m}}\) was calculated to be 8.7 and 18.6 mg/g for carbon and activated carbon at 293 K. The comparative analysis with others low-cost adsorbents is listed in Table 2. Furthermore, a dimensionless constant \({R}_{\mathrm{L}}\) called separation factor was calculated by the equation given below:

Table 2 Comparison of monolayer adsorption capacity (qm) for the adsorption of CV dyes by low-cost adsorbents
$${R}_{\mathrm{L} }=\frac{1}{1+{k}_{\mathrm{L}}{C}_{\mathrm{o}}}$$
(3)

The values of \({R}_{\mathrm{L}}\) was found to be 0.14 and 0.23 for carbon and activated carbon, respectively, which shows that adsorption of CV dyes on carbon was a favorable process (Idan et al. 2018).

Freundlich model assume a multilayer sorption and describe the adsorption equilibrium based on heterogeneous energetic distribution of active sites. The linearized form of Freundlich model is given below:

$$\mathrm{ln}{q}_{\mathrm{e}}=\mathrm{ln}{k}_{\mathrm{f} }+\frac{1}{n}\mathrm{ln}{C}_{\mathrm{e}}$$
(4)

where \({q}_{\mathrm{e}}\) (mg/g) is the amount adsorbed at equilibrium by the adsorbent, \({K}_{\mathrm{f}}\) (mg/g) and \(n\) are Freundlich constant indicates the adsorption capacity and intensity of adsorption calculated from intercept and slope, respectively. The parameter evaluated by using Freundlich equation is enlisted in Table 3. The Langmuir and Freundlich isotherms for CV dye at different temperatures are shown in Figs. 9 and 10, respectively. The results clearly show that the adsorption of CV dye on carbon and activated carbon fit well with the Freundlich model. Based on regression coefficient, it was concluded that adsorption of CV dyes on carbon and activated carbon was well fitted at 298 K with R2 value of 0.9877 and 0.9997, respectively. As observed from Table 3, the value of n greater than 1 indicates that the adsorption of CV dyes on carbon and activated carbon is a favorable process. Value of n > 1 is an index of surface heterogeneity.

Table 3 Freundlich parameter for adsorption of CV dyes on carbon and activated carbon
Fig. 9
figure 9

Linear fitting of Langmuir model for CV adsorption by carbon (a) and activated carbon (b)

Fig. 10
figure 10

Linear fitting of Freundlich model for CV adsorption by carbon (a) and activated carbon (b)

Thermodynamic studies and activation parameters

Thermodynamic parameters that must be considered to determine the sorption processes are changes in the standard free energy (\(\Delta G)\), standard enthalpy (\(\Delta H)\), and standard entropy (\(\Delta S)\). The thermodynamic parameters were calculated using following basic equation.

$$\Delta G= -RT\mathrm{ln}K$$
(5)
$$\mathrm{ln}K= \frac{\Delta S}{R}-\frac{\Delta H}{RT}$$
(6)

The \(\Delta H\) and \(\Delta S\) values are obtained from slope and intercept of Van’t Hoff plots of lnK vs 1/T (Fig. 11). The calculated value of \(\Delta G\), \(\Delta H\) and \(\Delta S\) is listed in Table 4.

Fig. 11
figure 11

Van’t Hoff plot for adsorption of CV dyes on carbon and activated carbon

Table 4 Thermodynamic parameter for adsorption of CV dyes on carbon and activated carbon

The negative value of \(\Delta G\) for adsorption of CV dyes at 298 and 303 K demonstrate that adsorption was feasible and spontaneous. In case of carbon positive value of \(\Delta G\) at 293 K suggested that at low temperature adsorption occur nonspontaneously. The positive value of \(\Delta H\) and \(\Delta S\) confirmed that adsorption is endothermic and there is increasing in the randomness of the CV dye at the solid and liquid interface and some structural changes are also observed during adsorption process (Idan et al. 2018).

Thermodynamics activation energy is an important parameter which can be calculated using a linearized form of Arrhenius equation.

$$\mathrm{ln}k=\mathrm{ln}A-\frac{{E}_{\mathrm{a}}}{RT}$$
(7)

where \(R\) is general gas constant, A is a frequency factor, \(k\) is adsorption rate constant, \({E}_{\mathrm{a}}\) is the activation energy (kJ/mol), and T is temperature in kelvin. Plot of \(\mathrm{ln}K\) vs 1/T give straight line with slope is equal to \(-\frac{{E}_{\mathrm{a}}}{R}\) from which value of activation energy can be calculated. Value of \({E}_{\mathrm{a}}\) is another indication of type of adsorption. The value of \({E}_{\mathrm{a}}<\hspace{0.17em}\)40 indicate that it is physisorption and weak Van der Walls forces are involved during the adsorption of CV dyes on surface of carbon and activated carbon (Naseem et al. 2020). The value of \({E}_{\mathrm{a}}\) for adsorption of CV dyes on carbon and activated carbon was found to be 20 and 19 kJ/mol, respectively.

Conclusion

The present study offers a cost-effective and novel biosorbent based on onion waste for effective removal of carcinogenic crystal violet dye. Synthesized adsorbent was found to be highly porous with BET surface area of 292.8 m2/g. It was concluded that activated carbon is an efficient adsorbent in comparison with those reported in the literature with adsorption capacity of 18.6 mg/g. Adsorption was found to be well fitted with Freundlich model and followed a physisorption mechanism. From thermodynamics studies, it was concluded that adsorption is endothermic and spontaneous in nature. Since onion waste used in present work is locally available and environment friendly so it can be used on industrial scale as a cheaper alternative to commercial adsorbents.