1 Introduction

The removal of heavy metals from wastewater has been an important research area in recent years due to its negative effects on public health [1]. Cd(II) and Pb(II) pollutants originating mainly from industries such as refining, smelting, metal mining, electroplating, and electrolysis are non-biodegradable and carcinogenic to human health [2, 3]. The limits allowed by the World Health Organization for Cd and Pb in drinking water are 0.003 and 0.01 mg/L, respectively [4]. Many techniques have been used to eliminate the negative effects of Cd and Pb heavy metals.

The adsorption method, which is suitable for the removal of heavy metals, has advantages such as cost-effectiveness, high dynamic selectivity, and removal of non-biodegradable pollutants [5]. In the last decade, a wide variety of low-cost and effective adsorbents have been applied for heavy metal removal [6,7,8,9,10]. As an effective adsorbent, AC is a good choice to remove polar and non-polar compounds and a wide variety of organic and inorganic pollutants from the gaseous or aqueous phase [7, 11,12,13,14,15,16,17,18,19].

ACs are generally obtained by conventional or microwave heating by physical or chemical activation processes. Compared to conventional heating, in the case of microwave heating, in which heat is transferred to the samples via electromagnetic waves, homogeneous and rapid heating is obtained due to the heat transfer from the inner core to the surface of the sample in the heating process [20]. Recently, the preparation of ACs by microwave activation has become a viable alternative due to their unique properties compared to conventional methods [21,22,23]. Activated carbon can be produced using various activating agents such as zinc chloride [24, 25], KOH [26], and sodium hydroxide (NaOH) [27]. KOH, which is among the chemical reagents for the activation of activated carbons, is widely preferred due to its high specific surface areas and its ability to produce many micropores [28, 29].

Almost all carbon adsorbents are important for the adsorption of heavy metals with their surface chemistry and active surface functional groups [30]. Besides, increasing the surface area alone may not be sufficient to improve the adsorption capacity. Recently, various modification approaches such as functional group grafting, nanoparticle deposition, and element doping have been proposed [31]. Recently, doping with atoms such as phosphorus, nitrogen, oxygen, sulphur and boron had an important place in the modification of carbon materials. Although activated carbon is widely used in removing heavy metal ions in aqueous solutions, studies are continuing to increase the adsorption performance of AC. It has been stated that the doping of functional groups such as nitrogen and oxygen on the surface of adsorbent samples, generally after pyrolysis or chemical modification processes, will contribute to the complexation of heavy metal ions and contribute to an increase in adsorption capacity [32, 33]. As a result of surface modification with nitric acid, oxygen-surface groups such as carboxylic acids, ketones, phenols, lactones, and quinones are included in the carbon structure, while nitrogen functional groups are also included in the structure [34, 35]. The incorporation of heteroatoms into the graphite structure due to the difference in electronegativity creates an electroactive structure useful for various applications, depending on the change in electronic charges of the original π-electron network [36]. To overcome this disadvantage of the relatively high-cost commercial AC, researchers focused on various agricultural wastes as suitable raw materials for AC production [37].

Almond shells, one of the important agricultural materials, are generally considered waste. Turkey ranks seventh in the world almond production with 85,000 mt per year [38]. Almond shells, which are a lignocellulosic material and are composed of cellulose, silica, lignin and carbohydrates, are plentiful, inexpensive and readily available [39, 40]. Cd(II) and Pb(II) adsorption have been done with almond shells in the literature [3, 39, 41,42,43,44]. However, their adsorption capacity is low. For example, the adsorption capacity of AC and Cd(II) and Pb(II) ions based on almond shells obtained by NaOH activation were found to be 7 and 9 mg/g, respectively [39]. These adsorption capacity values obtained are low. In this study, the higher adsorption capacity of Cd(II) and Pb(II) ions with different activation and modification processes were aimed.

In this study, a two-step method was developed to prepare an effective adsorbent for Cd (II) and Pb (II) adsorption. In the first stage, AC was produced from the almond shells, which is agricultural waste, by KOH activation and microwave heating. In the second stage, the obtained ACs are modified with nitrogen and oxygen as a result of hydrothermal heating with nitric acid. Thus, effective adsorbents for Cd (II) and Pb (II) adsorption were prepared. The obtained samples were characterized by FTIR, SEM, EDS, TG–DTA and nitrogen adsorption.

2 Materials and method

Almond shells obtained from the Dursunbey district of Balıkesir province were used in the experimental study. Nitric acid (63%), NaOH and hydrochloric acid (HCl) (37%) chemicals were obtained from Merck. Potassium iodide (KI), iodine, starch, and sodium thiosulfate (Na2S2O3.5H2O) chemicals were purchased from Tekkim (Turkey). All chemicals of analytical purity were used in this study.

2.1 AC preparation by microwave heating using KOH

First of all, the almond shells used in the experimental study were washed with distilled water to remove impurities and then the almond shells were dried in an oven at 105 °C were ground with a blender. The obtained ground almond shells were stored in a glass jar to be used in the production of AC. Ground almond shells were mixed with KOH at a ratio of 1:1 with impregnation of 12 h in a 100-mL flask and 10 mL of distilled water was added. Then, these samples were subjected to carbonization by microwave heating method with microwave processing times of 10 min and microwave heating powers of 750 W under nitrogen gas. The samples obtained after microwave heating were washed with distilled water until pH 7. After filtration, drying was carried out in an oven at 105 °C for 24 h. The resulting sample was named KOH + ASM. The iodine number test was used to determine the surface area and microporosity of ACs. The iodine number test is used to determine the adsorption capacity of ACs. The widely used sodium thiosulfate volumetric method was used for iodine adsorption [45].

2.2 Nitrogen and oxygen doping by hydrothermal treatment

Nitric acid was added at 1:1, 1:2, 1.3, and 1:4 nitric acid/water ratios to add nitrogen and oxygen to approximately 0.5 g of KOH + ASM taken into a flask. Hydrothermal heating at 80 °C for 24 h was carried out in a magnetic stirrer. After this process, the samples were washed with distilled water up to pH 6–7. The resulting samples were then dried in an oven at 105 °C for 24 h. The KOH + ASM sample treated with 1:2 HNO3 was labelled KOH + ASM + 1:2 HNO3, and the KOH + ASM sample treated with 1:4 HNO3 was labelled KOH + ASM + 1:4 HNO3.

2.3 Characterization

With a Bruker VERTEX 70v spectrophotometer FTIR, the functional groups of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples were determined in the wavelength range of 4000–500 cm−1.

The surface morphology of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples were examined by SEM (Quanta FEG 250).

An energy-dispersive spectroscopy coupled to a scanning electron microscope (Quanta FEG 250) was used to determine the content of carbon, nitrogen, and oxygen atoms in the structure of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples.

The textural properties of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples were determined by nitrogen adsorption at − 196 °C with an Autosorb I device (Nova 2000, Quantahrome Instrument, Beach, USA). Isothermal data obtained by the Brunauer-Emmet-Teller (BET) method [46] were analyzed. Pore ​​diameters and pore volume were evaluated using the Barrett-Joyner-Halenda technique [47].

Thermal analysis of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples was performed in Shimadzu DTG-60H Simultaneous DTA-TG device with a heating rate of 10 °C min−1 between 30 and 900 °C.

The percentages of carbon (C), hydrogen (H), nitrogen (N), and sulfur (S) in the structure of the samples were determined with the CHNS analyzer (Vario EL-III from M/s Elementar, Germany). The percentage of oxygen atoms was found from the sum of the percentages of C, H, N, and S.

2.4 Determination of point of zero charge (pHpzc)

To determine the pHpzc values of KOH + ASM, KOH + ASM + 1.2 HNO3 and KOH + ASM + 1.4 HNO3 samples, 50 mL of 0.1 M potassium nitrate (KNO3) was added to a series of flasks. Then, the pH of these solutions was adjusted in the range of 2 to 10 with 0.1 N HCl or 0.1 M NaOH solution. After the pH of these solutions was fixed, the relevant pH was recorded. Then, 0.1 g adsorbent was added to the bottles. After 24 h at room temperature, the final pH' values were read. The pHpzc value of the adsorbent was determined from the graphs obtained from the first and last pHs.

2.5 Adsorption studies

The adsorption of Cd(II) and Pb(II) ions from an aqueous solution with nitric acid-treated KOH + ASM adsorbents was investigated. In the first step, stock solutions were prepared with calcium nitrate tetrahydrate for Cd(II) containing 1000 mg/L metal ions and lead(II) nitrate chemicals for Pb(II) and these solutions were diluted to the initial concentrations of 25, 50, 100, and 200 mg/L. The effect of pH on Pb(II)/Cd(II) adsorption on nitrogen- and oxygen-doped AC was investigated in the pH range of 2.0–8.0 by adjusting with 0.1 M HCl and 0.1 M NaOH solutions.

Stock solutions of Pb(II) and Cd(II) prepared in the initial concentration range of 25–200 mg/L were shaken at 100 rpm with 0.2 g adsorbent for 120 min at 30 °C. Then, kinetic adsorption experiments were performed with t = 15, 30, 45, 60, 90 and 120 min. Thermodynamic adsorption experiments were carried out at 30, 40, and 50 °C, respectively. Pb(II) and Cd(II) concentrations were determined by atomic absorption spectroscopy (Perkin Elmer, USA).

The adsorption capacity (mg/g) was calculated as follows.

$${q}_{e}=\left[\frac{\left({C}_{i}-{C}_{e}\right)}{M}\right]xV$$
(1)

Co and Ct (mg/L) are the initial and final concentrations of heavy metal, and m and V are the mass of the adsorbent (g) and the volume (L), respectively.

3 Results and discussion

3.1 Characterization studies

Figure 1 shows the FTIR spectra for KOH + ASM (a), KOH + ASM + 1:2 HNO3 sample (b), and KOH + ASM + 1:4 HNO3 sample (c). For the nitric acid-treated samples, the band associated with O–H stretching or N–H stretching vibrations appeared in the range of 3200–3600 cm−1. However, this band could not be seen in the FTIR spectrum for KOH-ASM. The band around 2904 cm−1 for KOH + ASM + 1:2 HNO3 sample (b), and KOH + microwave + KOH + ASM + 1:4 HNO3 sample (c) is due to stretching vibration of aliphatic C-H, but this band is KOH + ASM not found in the FTIR spectra. The bands at about 1730 cm−1 for the KOH + ASM + 1:2 HNO3 sample (b), and KOH + microwave + KOH + ASM + 1:4 HNO3 sample after nitric acid activation can be attributed to the presence of carbonyl groups. The peaks around 1315 and 1050 cm−1 for all samples originate from the C–OH and C = O groups [48]. This peak intensity is quite low for KOH-ASM. In the FTIR spectra, it is seen that there are significant differences on the surface of AC samples, especially in the 1000–1800 cm−1 range, after KOH-activated microwave heating and after hydrothermal heating with nitric acid. Chingombe et al. stated that as a result of the activation of the carbon structure with nitric acid, the addition of acidic groups to the structure causes the opening of the rings in the amorphous carbon [49]. It has been stated that if N atoms are attached to a C atom, absorption will occur in the range of 1200–1600 cm−1 in the FTIR spectrum [50]. As a result of the activation with nitric acid, the bands whose intensity increased in the range of 1300 to 900 cm−1 were interpreted as the presence of structures containing various O surface groups and N–O bonds, and the surface acidity of the carbon sample increased [37, 51]. A similar situation is also valid for this study. These results show that functional groups containing oxygen and nitrogen are attached to the KOH–ASM surface as a result of oxidation with nitric acid.

Fig. 1
figure 1

FTIR spectra for KOH + ASM (a), KOH + ASM + 1:2 HNO3 sample (b), and KOH + ASM + 1:4 HNO3 sample (c)

Figure 2 shows SEM micrographs for KOH + ASM (a, b), KOH + ASM + 1:2 HNO3 sample (c, d), and KOH + ASM + 1:4 HNO3 samples (e, f). SEM micrograph of the KOH + ASM sample can be seen to develop a rough and heterogeneous surface by gasification reaction during pyrolysis as a result of activation with KOH [43]. On the other hand, SEM micrographs for KOH + ASM + 1:2 HNO3 sample (c, d), and KOH + ASM + 1:4 HNO3 samples (e, f) show significant changes on the surface, similar to FTIR spectra. It can be stated that a more homogeneous and layered structure is formed on the carbonaceous surface, possibly due to the collapse or coalescence of pores due to nitric acid activation [52]. Besides, it can be seen from the SEM images that compared to the KOH + ASM + 1:2 HNO3 sample (c, d), KOH + ASM + 1:4 HNO3 samples (e, f) exhibits a more homogeneous and regular structure, possibly due to the more dilute nitric acid. FTIR results also support this situation.

Fig. 2
figure 2

SEM micrographs for KOH + ASM (a, b), KOH + ASM + 1:2 HNO3 sample (c, d), and KOH + ASM + 1:4 HNO3 samples (e, f)

EDS and C, H, N, S elemental analysis are commonly used to determine which chemical elements are present in a sample and in what proportion. Figure 3 shows the EDS spectra for KOH + ASM (a), KOH + ASM + 1:2 HNO3 sample (b), and KOH + ASM + 1:4 HNO3 samples (c). The EDS elemental analysis percentages in Table 1 indicate the presence of approximately 50% carbon and approximately 40% oxygen atoms in all samples. However, the C,H,N,S elemental analysis percentages in Table 1 indicate the presence of approximately 40% carbon and approximately 50% oxygen atoms in all samples. Also, EDS results in Table 1 confirms that the N atoms are 3.81% and 1.91% for the KOH + ASM + 1:2 HNO3 and KOH + ASM + 1:4 HNO3 samples, respectively. However, the percentage of N atoms for the same samples by the C,H,N,S elemental analysis were 0.581% and 0.441%, respectively. EDS and C, H, N, S element analysis results showed that acidic oxygen groups and nitrogen atoms increased on the surface of the samples as a result of hydrothermal treatment with nitric acid.. For the KOH + ASM + 1:4 HNO3 sample, the increase of acidic oxygen groups on the surface is consistent with the FTIR spectrum.

Fig. 3
figure 3

EDS spectra for KOH + ASM (a), KOH + ASM + 1:2 HNO3 sample (b), and KOH + ASM + 1:4 HNO3 samples (c)

Table 1 EDS and C,H,N,S elemental analysis values for the components of the KOH + ASM, KOH + ASM + 1:2 HNO3 sample, and KOH + ASM + 1:4 HNO3 samples

TG/DTG analyses are used to determine how the mass of a sample changes over time with temperature. This measurement provides information about phase transitions, physical phenomena such as adsorption and desorption, and chemical phenomena such as thermal degradation and solid–gas reactions [53]. Figure 4 shows the TG–DTA spectra for samples KOH + ASM (a), KOH + ASM + 1:2 HNO3 (b), and KOH + ASM + 1:4 HNO3 (c). For these analyses, samples were heated from room temperature to 900 °C. From the TG and DTA curves of the KOH + ASM 1:2 HNO3 (b) sample, 14.16% and 54.58% weight losses were observed in the regions 34.76–272.9 °C/295.07–521.82 °C, respectively. At the same time, 31.72% and 39.99% weight losses were observed in the KOH + ASM 1:4 HNO3 (c) sample at 41.25–308.28 °C/319.28–650.23 °C regions, respectively. Weight loss at low temperatures is related to the loss of physically adsorbed water and volatile components. Another weight loss refers to the dissociation of the carbon skeleton and the dissociation of carbonyl groups and residue of small molecules [54]. That is, In case of TGA measurement the 2nd weight-loss can be attributed to the degradation of cellulose, hemicellulose, and lignin in the structure and the removal of gaseous products and volatile components from the structure during decomposition. The peaks at 300 °C in the DTA curve of these samples represent the hemicellulose degradation of the structure [55]. In addition, it was stated that cellulose and lignin degradation occurred in the temperature range of 280–400 °C and 140–900 °C [56].

Fig. 4
figure 4

TG–DTA spectrums for KOH + ASM (a), KOH + ASM + 1:2 HNO3 sample (b), and KOH + ASM + 1:4 HNO3 (c) samples

Table 2 gives the BET surface areas, pore volumes and pore diameters for KOH + ASM, KOH + ASM + 1:2 HNO3, and KOH + ASM + 1:4 HNO3 samples. As can be understood, the surface areas for all samples are quite small. A specific surface area value of 22.9 m2/g was obtained for the KOH + ASM sample. Besides, an iodine number value of 571 mg/g was found for the same sample. Generally, BET surface area values ​​obtained for carbon samples and iodine numbers are expected to be close to each other. However, the surface area value is quite low. There is a similar situation in a study conducted for the production of AC by chemical activation from walnut shells, which are structurally similar to almond shells [57]. An iodine number of 458 mg/g was obtained versus a BET surface area value of 22.25 m2/g for walnut shells. The possible reason for this situation was attributed to the effect of degassing treatment on the sample structure for BET analysis. A similar explanation can be made for this study as well. It can also be seen that the addition of hydrothermal nitric acid to the KOH + ASM sample also reduces the surface area. The possible reason for this can be explained by the fact that acid solutions fill the pores on the carbon surface. However, as shown by the FTIR results, there are more distinct functional groups for the KOH + ASM + 1:2 HNO3 and KOH + ASM + 1:4 HNO3 samples. As known. In adsorption applications, not only the size of the surface area but also the surface functional groups are important. The pore sizes found from the pore size distributions of the samples obtained using the BJH method are in the range of 1.64 and 1.55 nm. It has been stated that oxygenated groups fixed on the pore walls as a result of acid activation affects the reduction of the size of the pores [58]. As a result of the activation with nitric acid, the microporous structure is either blocked or the porous structure is deteriorated due to the pore blockage of the nitrogen or oxygen groups grafted on the pore entrance and walls [59].

Table 2 BET surface areas, pore volumes and pore diameters for KOH + ASM, KOH + ASM + 1:2 HNO3 sample, and KOH + ASM + 1:4 HNO3 samples

3.2 Adsorption study

The effect of nitric acid concentration at 1:1, 1:2, 1:3 and 1:4 acid/water dilution ratios for Pb(II) and Cd(II) adsorption with KOH + ASM is given in Table 3. From the qe and % adsorption results obtained for the adsorption of Pb(II) and Cd(II) on the adsorbents obtained by hydrothermal nitric acid treatment at 80 °C on the KOH + ASM sample, the adsorption of Pb(II) and Cd(II) ions is highly affected. From the data obtained in Table 3, the KOH + ASM + 1–2 HNO3 sample for Cd (II) adsorption and KOH + ASM + 1–4 HNO3 sample for Pb (II) adsorption was chosen as models.

Table 3 Effect of nitric acid concentration for Pb (II) and Cd(II) adsorption with KOH + ASM

The pH-dependent adsorption capacity for the adsorption of KOH + ASM + 1:2 HNO3 with Cd (II) and KOH + ASM + 1:4 HNO3 with Pb(II) 0.1 M HCl or NaOH at a pH range of 2–8 at 30 °C with 0.2 g adsorbent at an initial concentration of 100 mg/L and the results are given in Fig. 5. For Pb(II) and Cd(II), an increase in adsorption capacity is observed as the pH of the solution increases from 2 to 8. pH 5 in the adsorption of KOH + ASM + 1:2 HNO3 with Cd (II), and pH 6 in the adsorption of KOH + ASM + 1:4 HNO3 with Pb (II) gave the best adsorption capacity. The groups on the surface of the obtained nitrogen- and oxygen-doped adsorbents can coordinate with the nitric acid-modified active groups Cd(II) and Pb(II) and remove them more effectively from aqueous solutions. The zero charge point (pHzpc) value of the nitrogen- and oxygen-doped adsorbents obtained can also explain the pH effect. The pHzpc value for the KOH + ASM sample that was not treated with nitric acid was 6.95. However, the pHzpc values obtained for the KOH + ASM + 1:2 HNO3 and KOH + ASM + 1:4 HNO3 samples were 3.72 and 3.85, respectively. These values indicate that the relevant adsorbent surfaces are acidic. Therefore, the surface is protonated if the solution pH is lower than pHzpc. Conversely, if the solution pH is higher than pHzpc, the surface becomes aprotic [6061]. As a result, when the surface charge is deprotonated with pH > pHzpc, the resulting negatively charged surface attracts Pb(II) and Cd(II) ions, and thus there is an increase in the adsorption capacity [62]

Fig. 5
figure 5

Effect of pH on Cd (II) by KOH + ASM + 1:2 HNO3 and Pb(II) ion adsorption by KOH + ASM + 1:4 HNO3 at 30 °C

The effect of Pb(II) and Cd(II) ions on nitric acid-modified KOH-ASM adsorbents with 25, 50, 100, and 200 mg/L initial metal concentration was investigated. Pb(II) ions at pH 6 at 30 °C and Cd(II) ions at pH 5 were contacted with 0.2 g adsorbent for 120 min. Figure 6 shows the effect of initial concentration and contact time upon adsorption of KOH + ASM + 1:2 HNO3(a) with Cd (II) and KOH + ASM + 1:4 HNO3(b) with Pb(II) ions at 30 °C. It can be seen that the adsorption capacity of heavy metals also increases with any increase in the initial solution concentration. The effect of contact time for the adsorption of Pb(II) and Cd(II) metal ions on nitric acid-modified KOH-ASM adsorbents was performed in the range of 15–120 min. It can be seen that the adsorption capacity of both Pb(II) and Cd(II) ions tends to increase over time from 15 to 90 min and then remains almost constant. Therefore, a reaction time of 90 min was considered in subsequent experiments.

Fig. 6
figure 6

Effect of initial concentration and contact time on Pb (II) by KOH + ASM + 1:4 HNO3 (a) and Cd(II) ion adsorption by KOH + ASM + 1:2 HNO3 (b) at 30 °C

Langmuir and Freundlich isotherm equations were used to determine the adsorption type of Cd(II) and Pb(II) ions and to determine the maximum adsorption capacity of the respective adsorbents. The linear formulation for the Langmuir isotherm model related to the monolayer coverage of the adsorbent surface is given below [63].

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

where qe is the amount (mg/g) adsorbed on the adsorbent; Ce denotes the adsorbate concentration (mg/L) after adsorption, qm expresses the maximum adsorption capacity (mg/g) and KL isotherm coefficient (L/mg).

The equilibrium results obtained for both Pb(II) and Cd(II) adsorption are quite compatible with the Langmuir isotherm model due to the high correlation coefficient in the range of 0.996–0.989 at almost all temperatures. Langmuir isotherm models obtained for the adsorption of Cd(II)(a) and Pb(II)(b) ions are shown in Fig. 7. For Cd(II) ion, the Qm and KL values of KOH-ASM-1:2 HNO3 adsorbent obtained at 30, 40, and 50 °C temperatures were determined as 106.38, 108.69, and 128.20 mg/g and 0.021, 0.032, and 0.068 L/mg, respectively.

Fig. 7
figure 7

Langmuir isotherm models obtained for the adsorption of Cd(II) (a) and Pb(II) (b) ions

In addition, Qm and KL values of KOH-ASM-1:4 HNO3 adsorbent for Pb(II) ion obtained at 30, 40, and 50 °C temperatures were determined as 76.33, 74.07, and 75.75 mg/g and 0.019, 0.013, and 0.015 L/mg, respectively.

The linear formulation of the Freundlich isotherm model, which assumes that the adsorbent surface is multilayered by adsorbate molecules, is presented below [64].:

$${\mathrm{lnq}}_{\mathrm{e}}={\mathrm{lnK}}_{\mathrm{F}}+\frac{1}{\mathrm{n}}{\mathrm{lnC}}_{\mathrm{e}}$$
(3)

where Ce is the adsorbate in solution (mg/L); qe is the adsorbate concentration on the surface of the adsorbent (mg/g); Kf and n represent Freundlich constants.

Table 4 gives the Langmuir and Freundlich parameters of both Cd(II)(a) and Pb(II)(b) adsorption. As can be seen from Table 5, the correlation coefficient for the Freundlich isotherm of both Pb(II) and Cd(II) adsorption is in the range of 0.875–0.960 at the respective temperature ranges.

Table 4 a Langmuir and Freundlich isotherm parameters for Cd(II) adsorption on KOH + ASM + 1:2 HNO3. b Langmuir and Freundlich isotherm parameters for Pb(II) adsorption on KOH + ASM + 1:4 HNO3
Table 5 Comparison of the maximum adsorption capacities of Pb(II) and Cd(II) ions with adsorbents of different structures

The maximum adsorption capacities of the obtained adsorbents and Pb(II) and Cd(II) ions were compared with the other adsorbents described in the literature in Table 5 [39, 41,42,43, 65,66,67,68,69,70,71,72]. As can be seen in Table 5, Cd(II) and Pb(II) adsorption have been done with almond shells in the literature [3, 39, 41,42,43,44]. The Qe values obtained in this study are well above these values. This result shows that the respective adsorbents are highly effective in the adsorption of Cd(II) and Pb(II).

The kinetic mechanism for the adsorption of Pb(II) with KOH-ASM-1:4 HNO3 adsorbent and Cd(II) with KOH-ASM-1:2 HNO3 adsorbent was determined by pseudo-first-order and pseudo-second-order kinetic models.

The pseudo-first-order kinetic model equation is as follows [73]:

$${\mathrm{ln}(\mathrm{q}}_{\mathrm{e}}-{\mathrm{q}}_{\mathrm{t}})={\mathrm{lnq}}_{\mathrm{e}}-{\mathrm{K}}_{1}\mathrm{ t}$$
(4)

Here, qt (mg/g) and qe (mg/g) represent the adsorbed amount at any time t and equilibrium time and the rate constant K1 (min-1). The K1 and qe values ​​were calculated from the graph between ln(qe-qt) and t. The kinetic data obtained from the pseudo-first-order kinetic model equation obtained at 30, 40, and 50 °C temperatures for an initial heavy metal concentration of 100 mg/L are given in Table 6.

Table 6 a Kinetic parameters for Cd(II) adsorption with KOH + ASM + 1–2 HNO3. b Kinetic parameters for Pb(II) adsorption with KOH + ASM + 1–4 HNO3

At the same time, the adsorption of KOH-ASM-1:4 HNO3 adsorbent with Pb(II) and KOH-ASM-1:2 HNO3 adsorbent with Cd(II) was investigated using the following pseudo-second-order kinetic model equation [74].

$$\frac{\mathrm{t}}{{\mathrm{q}}_{\mathrm{t}}} = \frac{1}{{\mathrm{k}}_{2}{\mathrm{q}}_{\mathrm{e}}^{2}} + \frac{\mathrm{t}}{{\mathrm{q}}_{\mathrm{e}}}$$
(5)

Here, k2 (g/mg/min) denotes the rate constant. t/qt vs. The qe and k2 values were determined according to the t chart and the values ​​obtained at 30, 40, and 50 °C temperatures are given in Table 6. As can be seen from Table 6, R2 values in the range of 0.99–1.00 obtained for the pseudo 2nd order model show that the pseudo-second-order kinetic model is more suitable than the pseudo-first-order kinetic model.

For the adsorption of KOH-ASM-1:4 HNO3 adsorbent with Pb(II) and KOH-ASM-1:2 HNO3 adsorbent with Cd(II) adsorption, Gibbs free energy (ΔGo) entropy (ΔSo), and enthalpy (ΔHo) variations were analyzed by Eqs. (6) and (7) given below.

$$\Delta {\mathrm{G}}^{^\circ }=-\mathrm{RT}1\mathrm{nKc}$$
(6)
$$1\mathrm{nKa}=\frac{\Delta {\mathrm{S}}^{^\circ }}{\mathrm{R}}-\frac{\Delta {\mathrm{H}}^{^\circ }}{\mathrm{RT}}$$
(7)

Here, T and R represent temperature (K) and gas constant (8.314 J/mol K). Ka (L/g) is the equilibrium constant. ΔH and ΔS values were determined from the slope and intersection point of lnKc versus 1/T plot.

In Table 7, the values of thermodynamic parameters for the adsorption of KOH-ASM-1:4 HNO3 adsorbent with Pb(II) and KOH-ASM-1:2 HNO3 adsorbent with Cd(II) are given. The negative ΔG values indicate that heavy metal adsorption on the relevant adsorbents is spontaneous. Also, there is a high negative value for ΔGo with increasing temperature. It was understood from the positive ΔHo value that the adsorption of KOH-ASM-1:4 HNO3 adsorbent with Pb(II) and KOH-ASM-1:2 HNO3 adsorbent with Cd(II) had an endothermic structure. Also, the positive ΔSo indicates that the randomness at the adsorbent-liquid interface increases during adsorption.

Table 7 a Thermodynamic parameters for Pb(II) adsorption. b Thermodynamic parameters for Cd(II) adsorption

3.3 Mechanism of adsorption

Heavy metal adsorption of AC is not only related to the surface area but also the active groups formed on the carbon surface. From FTIR and EDS analyses, it was stated that nitrogen- and oxygen-containing functionalities were formed on the carbon surface as a result of nitric acid hydrothermal activation. At the same time, the specific BET surface area results obtained were quite low. Thus, interactions between active sites bound to nitrogen and oxygen atoms formed on the surface of the relevant adsorbents and Pb(II) and Cd(II) ions become important. Meanwhile, the basicity of the carbon surface contributes to the adsorption of Pb(II) and Cd(II) ions throughout the whole process. The surface chemistry of activated carbons affects their acid–base character and adsorption capacity [75]. As mentioned earlier, oxygenated groups and nitrogen atoms are included in the structure as a result of the treatment of the carbon sample with nitric acid. The electronegativity values for C, O, and N are different from each other. As a result of the lower electronegativity of the C bonds with the doping of nitrogen and oxygen atoms to the carbonaceous structure, Lewis base sites and Lewis acid sites on the carbon atoms are likely to form on the surface. These Lewis base sites can serve as important active sites, especially in the adsorption reactions of positively charged Pb(II) and Cd(II) ions. Moreover, more electronegative oxygen atoms attached to the nitrogen atom are likely to contribute favourably to the Lewis base sites by attracting the commonly used electrons [76]. The obtained pHzpc results also showed that the surface charge of the respective adsorbents was acidic. In addition to the oxygen and nitrogen functional groups on the surface, the electrostatic attraction between the groups can also contribute to the adsorption process of Pb(II) and Cd(II) ions. It is understood from the BJH results that the obtained ACs have a microporous (0–2 nm) structure. Atomic radius values for Pb(II) and Cd(II) ions are expressed as 0.154 and 0.175 nm, respectively [77]. Therefore, the sizes of these ions are in the pore size range of ACs, indicating that a pore-filling mechanism is involved in this adsorption process. Also, since the pH of the solution is higher than the pHzpc value of the obtained KOH + ASM + 1:2 HNO3 and KOH + ASM + 1:2 HNO3 adsorbents, the corresponding adsorbent surfaces are negatively charged. Depending on this result, there will be an electrostatic interaction between the negatively charged adsorbent and the positively charged ions [13, 78]. Thus, there will be an increase in adsorption capacity. The heavy metal adsorption process with the obtained adsorbents is given in Fig. 8.

Fig. 8
figure 8

The heavy metal adsorption process with the obtained adsorbents

4 Conclusion

In this study, in order to increase the Cd(II) and Pb(II) adsorption efficiency, the production of AC based on almond shells by microwave heating with KOH activation and then the modification of AC with nitrogen and oxygen as a result of hydrothermal heating with nitric acid was carried out. In the FTIR spectra, it is seen that there are significant differences on the surface of AC samples, especially in the 1000–1800 cm−1 range, after KOH-activated microwave heating and after hydrothermal heating with nitric acid. SEM micrographs for KOH + ASM + 1:2 HNO3 sample (b) and KOH + ASM + 1:4 HNO3 samples (c) show significant changes on the surface, similar to FTIR spectra. It can be stated that a more homogeneous and layered structure is formed on the carbonaceous surface, possibly due to the collapse or coalescence of pores due to nitric acid activation. EDS and C, H, N, S element analysis results showed that acidic oxygen groups and nitrogen atoms increased on the surface of the samples as a result of hydrothermal treatment with nitric acid. The pHzpc value for the KOH + ASM sample that was not treated with nitric acid was 6.95. However, the pHzpc values obtained for the KOH + ASM + 1:2 HNO3 and KOH + ASM + 1:4 HNO3 samples were 3.72 and 3.85, respectively. The obtained isotherm and kinetic results showed that the adsorption of Cd(II) and Pb(II) on nitrogen- and oxygen-doped activated carbons followed Langmuir isotherm and pseudo-second-order kinetics. Qm values obtained for Cd(II) and Pb(II) adsorption were 106.38 mg/g and 76.33 mg/g, respectively. At the same time, the adsorption mechanism of Pb(II) and Cd(II) on the respective adsorbents was evaluated.