Introduction

The word nanotechnology refers to the synthesis of novel materials on a nanoscale (1 to 100 nm), compared to the material in its bulk form. They exhibited higher capacity and surface area (ratio of area to volume) [1, 2].

Nanotechnology finds application across multiple domains such as optics [3], chemical sectors [4], electronics [5], energy research [6], photocatalysis [7, 8], efficient drug delivery systems [9], sensor technology, solar energy harvesting, and fuel cells [10], along with environmental uses [11, 12]. It is also utilized in hydrogen storage mechanisms, supercapacitors [13], biomedical fields including in vitro antialzheimer's studies [14], and the food industry [15].

The scientific community is very interested in the synthesis of AgNPs because of their wide variety of applications [1, 16, 17]. AgNPs have demonstrated antibacterial efficacy against numerous infectious and harmful pathogens, including multidrug-resistant bacteria [2]. As a result of the improved antibacterial activity of Ag at the nanoscale, AgNPs are incorporated into numerous types of products, such as the medical and healthcare fields, clothing, cosmetics, dental products, catheters, dressings, as well as surgical and food-handling instruments [18, 19]. In addition, AgNPs are applied as potential sensors not only for heavy metals detection [20, 21] but also for various ecological sensing purposes. This is because AgNPs are simple, adaptable, and inexpensive materials [22].

A wide range of physical and chemical methods are employed in the production of nanoparticles (NPs). For the synthesis of silver nanoparticles (AgNPs), physical methods like lithography, irradiation, laser ablation, evaporation, and condensation are commonly used [23,24,25]. These techniques might utilize thermal energy (physical vapor deposition), mechanical energy (ball milling) [26], electrical energy (electrical arc discharge), or light energy (laser ablation) [27]. Physical methods are advantageous due to the reduced toxicity of the reducing and stabilizing agents used, and they also produce AgNPs with small crystallite sizes and high purity. However, the downsides include substantial energy consumption and potentially low yield rates [28, 29]. In contrast, several chemical techniques are also utilized for AgNPs synthesis, including chemical reduction [30], the sol–gel method [31], microemulsion techniques [32], photochemical methods [33], electrochemical synthesis, and microwave-assisted synthesis [34]. While these chemical approaches may lead to high production costs and potentially hazardous by-products, they are capable of producing NPs that are free from aggregation and have a high yield [35, 36].

Biological syntheses are favored today because they are secure, hygienic, affordable, simple to scale up and eco-friendly [37]. It does not need external reducing, capping, and stabilizing agents, so that, it does not require harmful or dangerous chemicals [38, 39]. The biological manufacturing of nanoparticles incorporates the adoption of multicellular and unicellular biological entities such as bacteria, actinomycetes, fungi, plants, viruses and yeasts [40, 41]. Recent studies have shown that the bio-synthesis of NPs using extracts from plants is an appealing substitute for conventional chemical synthesis and the more difficult microbe culturing and isolation procedures [42, 43], where the combinations of compounds contained in plant extract behave as reducing and stabilizing agents in the synthesis process. Although the complexity of their chemical composition, biological molecules have the advantage of being eco-friendly [44]. In plant extracts, bioactive alkaloids, phenolic acids, polyphenols, proteins, carbohydrates, and terpenoids are expected to be important in reducing the metal ions and then stabilizing them Fig. 1 [45, 46].

Fig. 1
figure 1

Biological resources work as reducing and stabilizing agents in the metal nanomaterials synthesis

Vachellia tortilis subsp. raddiana (Savi) Kyal. & Boatwr. (Syn: Acacia tortilis subsp. raddiana (Savi) Brenan) (acacia raddiana) grows as wild flora in the Siwa Oasis and Aswan (Elephantine Island). By the end of the twenty-first century, Egypt's oases will have an entirely different plant life thanks to the Toschka canal, which will redirect the Nile River from Lake Nasser (south of Aswan on the Nile Valley) to the Kharga Oasis and then the Farafra Oasis in the Western Desert. This project is expected to reclaim and cultivate about 500,000 acres [47]. The acacia raddiana plant offers benefits such as year-round availability and cost-effectiveness. Moreover, its leaf extract is rich in phenolic compounds, including flavonoids, tannins, alkaloids, and saponins [48].

In the preparation of nanoparticles utilizing plant extracts, the extracts are simply added to a metal salt solution at the optimal temperature. Within minutes, the reaction was completed. AgNPs and numerous other metals have been produced via this mechanism Fig. 2 [49].

Fig. 2
figure 2

Mechanism of AgNPs synthesis using plant extract

This research concentrated on detecting heavy metals using the synthesized AgNPs as sensors, owing to the toxic and detrimental effects these elements can have on the environment. The elements investigated include the following…

Mercury is a heavy metal that may be harmful to people's health and is a hazardous element in the environment. Mercury was ranked among the top ten substances or chemical groups that the World Health Organization assessed to be of the greatest public health concern [50, 51]. Due to the presence of mercury in water and soil samples in large quantities, it accumulates in the ecological food chain. As a result, both the human population and other living organisms are negatively impacted [52]. There are several sources of mercury as cinnabar rocks, which are formed through volcanic activity or the natural weathering of rock. It has up to 86% of its content mercury which releases mercury in various forms to the environment [53, 54]. As well, human activity through coal combustion, electrical power production and industrial waste disposal is the main source of mercury contamination in the environment [45]. Also, the biologically harmful form of methyl mercury (MeHg) which accumulates in the tissue of fish and birds and is released to the environment by microorganisms that live in soil and water [55].

An essential mineral that is available in dietary supplements and is a part of a balanced diet is copper (II) ion. However, excessive Cu2+ ion concentrations in humans can be hazardous and cause serious illnesses like dyslexia and hypoglycemia [56]. Numerous industries generate Cu2+ ions throughout their production methods, which can get into the food chain and build up in people [57, 58].

Lead (Pb) is the most prevalent harmful heavy metal in the environment, that was found in our atmosphere [59]. Additionally, it is considered one of the five heavy metals that are commonly found in water, along with Hg, As, Cr, and Cd [60, 61]. Lead is still utilized in the creation of paint, and car batteries as well as in recovering lead metal electrodes [62, 63]. Therefore, the rate of paint deterioration and recycling of automotive batteries leads to increasing the amount of lead in both soil and water in particular places. Since lead is a hazardous metal, aquatic life is constantly at risk from its presence in the environment. High blood levels of Pb2+ can seriously harm a human's health, especially in young kids. Children's blood serum contains abnormally high levels of Pb2+ in a certain region which exceeds the recommended value of 1.00 µg/L [64, 65]. Consequently, accurate Pb2+ determination in biological and environmental materials is crucial.

High quantities of cobalt in the human body lead to cobalt toxicity, which has catastrophic consequences. Cobalt and its salts are found in a variety of products, including enamels, porcelain, acrylic paints on glass, grinding wheels, semiconductors, electroplating, hygrometers, and nuclear therapies [66]. Asthma, heart, thyroid, and liver issues are some of the negative symptoms of cobalt toxicity [67]. Moreover, it irritates the eyes and mucous membranes, making breathing through the nose extremely uncomfortable and frequently resulting in perforation of the nasal septum [68].

The mercury, copper, lead and cobalt contents of various samples have been investigated via a variety of methods including cold vapor atomic absorption [69], cold vapor atomic fluorescence spectroscopy [70], atomic absorption spectrometry [71], inductively coupled plasma atomic emission spectrometry [72], electrothermal atomic absorption spectrometry, atomic fluorescence spectrometry [73], fluorescent probes [74], inductively coupled plasma-mass spectrometry [75] and electrochemical detection [76]. Among them, the development of sensors to measure, monitor, and detect heavy metals in environmental samples is a crucial part of today's technology.

Numerous studies are concentrating on the fascinating field of creating hydrophilic noble metal nanoparticles capable of binding and coordinating with heavy metal ions. Among various noble metals, silver nanoparticles stand out as the most appropriate candidates for plasmonic analyte detection [77, 78]. The type of capping agent used significantly affects the nanomaterial's hydrophilic or hydrophobic properties, as well as its tendency to aggregate or self-assemble [79]. Additionally, the presence of specific functional groups can enhance the particles' interactions with nearby substances, thereby increasing their selectivity and sensitivity towards these substances [80]. Surface functionalization is a crucial strategy for enhancing selectivity and sensitivity in the detection and removal of pollutants in water contaminated with heavy metals [81].

So, using AgNPs, colourimetric sensing of cobalt, copper, lead, and mercury is an efficient, fast, ecologically safe, and highly active technique [82].

This study presents a simple, quick, and eco-friendly method for synthesizing silver nanoparticles (AgNPs) using aqueous extracts of acacia raddiana leaves. It focuses on examining various parameters in the biosynthesis process to establish optimal synthesis conditions. The study also investigates the potential of the synthesized AgNPs as colorimetric sensors for detecting cobalt, copper, lead, and mercury ions. This study stands apart from previous research in several ways. Notably, acacia raddiana has not been previously employed in nanoparticle synthesis. The physical and chemical properties (such as size and shape) of the nanoparticles synthesized in this study are in line with standard benchmarks. Additionally, this study achieves a quicker response time for Cu2+, Hg2+, Co2+, and Pb2+ ions compared to earlier studies. Furthermore, the selection of the study area aligns with Egypt's Vision 2030, specifically under the “Environmental Sustainability” section, which focuses on “the sustainable and integrative environment.” This is reflected in the study's goal to treat water contaminated with heavy metals using simple methods, aiming to conserve water resources amidst global water scarcity issues.

Materials and methods

Materials

All used chemicals were of analytical grade. Silver nitrate (AgNO3, PRATAP, UFC, PVT. LTD, India), concentrated nitric acid (HNO3 65%, DOP, Torkiye), Ammonium hydroxide (NH4OH 30%, DOP, Torkiye), copper sulphate pentahydrate (Cu SO4. 5H2O, DOP, Torkiye), mercuric sulphate (HgSO4, S. d. FiNE-CHEM Ltd, India), nickel chloride hexahydrate (Ni Cl2. 6H2O, Oxford Lab. Reagent, India), cobalt nitrate hexahydrate (Co (NO3)2. 6H2O, Loba Chemie PVT LTD, India), chromium nitrate nonahydrate (Cr (NO3)3. 9H2O, Loba Chemie PVT LTD, India), cadmium nitrate tetrahydrate (Cd (NO3)2. 4H2O, RIEDEL–DE HAEN AG SEELZE-HANNOVER) and lead nitrate (Pb (NO3)2, UFC, PVT. LTD, India).

Procedure

Plant extract preparation

Vachellia tortilis subsp. raddiana (Savi) Kyal. & Boatwr. (Syn: Acacia tortilis subsp. raddiana (Savi) Brenan) (acacia raddiana) leaves were obtained from Elephantine Island in Aswan Government, Egypt, specified by Prof. Mohamed Gabr Sheded, Professor of Plant Ecology & Flora, Botany Department, Faculty of Science, Aswan University.

The plant leave is available in Aswan University Herbarium (ASW. Herbarium) with NO. 11822. The samples were collected with the permission of Aswan University which is considered the main research body in the Aswan government.

Ten g of acacia raddiana leaves, as shown in Fig. 3, were initially rinsed with distilled water to remove impurities. The leaves were air-dried for two days and then ground into a powder. This powder was then combined with 100 mL of distilled water and boiled for 25 min. After allowing the mixture to cool at room temperature, it was filtered using Whatman filter paper no. 41. The filtrate obtained was used as the plant extract.

Fig. 3
figure 3

Acacia raddiana plant

Phytochemical analysis of acacia raddiana leaf extract

The acacia raddiana leaf extract was subjected to various standard tests to detect different phytochemicals [83,84,85]. The methods used for these tests are described as follows:

  • Tannins: A mixture of 50 mg of the extract in 5 mL of distilled water was heated in a water bath and then filtered. The addition of ferric chloride to the filtrate until it turned dark green confirmed the presence of tannins.

  • Saponins: 0.2 g of the plant extract was boiled in 5 mL of distilled water. The formation of persistent foam was an indication of saponins.

  • Steroids: 20 mg of the extract was mixed with 1 mL of methanol, filtered, and then treated with 1 mL of concentrated H2SO4. A yellow-green fluorescence signified the presence of steroids.

  • Terpenoids: 0.5 g of the extract was combined with 2 mL of chloroform, followed by the gradual addition of concentrated H2SO4. A reddish-brown color at the interface indicated terpenoids.

  • Flavonoids: 0.2 g of plant extract was dissolved in diluted NaOH, changing the solution from yellow to colorless upon gradual addition of HCl, a sign of flavonoids.

  • Anthraquinone: 0.5 g of the extract was mixed with 5 mL of chloroform, shaken for 5 min, and filtered. Adding a 10% ammonia solution to the filtrate, and observing a change to pink, violet, or red in the ammonia layer indicated anthraquinone.

  • Phenolic compounds: To 50 mg of the extract, 3 mL of a 10% lead acetate solution was added. The large white precipitate formed suggests that phenolic chemicals are present.

Synthesis of AgNPs

Five mL of acacia raddiana leave extract was mixed with 95 mL of a (5 mM) AgNO3 solution, and the obtained mixture was stirred at 70 °C for 2 h. As shown in Fig. 4, the colour of the solution changes from pale yellow to reddish brown. The resulting precipitate was separated by adding ethanol and decantation the clear solution, then dried at 50–80 °C.

Fig. 4
figure 4

Acacia extract and silver nanoparticles formation

Effect of pH

In this part of the study, 5 mL of acacia raddiana leaf extract and 95 mL of a 5 mM AgNO3 solution were mixed, and their pH was adjusted to a range between 4 and 10 using 1 M HCl and 1 M NaOH. The resulting mixture was then stirred at a temperature of 70 °C for 2 h.

Effect of temperature

Here, the temperature of the mixture, consisting of 5 mL of acacia raddiana leaf extract and 95 mL of a 5 mM AgNO3 solution, was modified to 50, 70, and 90 °C. This was done at the previously determined optimal pH, and the mixture was stirred for 2 h.

Effect of extract volume

The volume of the extract was varied from 1 to 10 mL, which was then combined with 95 mL of a 5 mM AgNO3 solution at the optimum pH and temperature. Following this, the mixture was stirred for 2 h.

Effect of stirring time

For this aspect, the synthesis of AgNPs was examined over stirring times of 0.5, 1, 2, 3, or 4 h. This was conducted using 95 mL of a 5 mM AgNO3 solution, maintaining the optimal pH, temperature, and extract volume settings.

Characterization techniques

The synthesized AgNPs were analyzed using a Bruker AXS D8 X-ray diffraction (XRD) system from Germany, employing Cu Kα radiation at a wavelength of 0.154 nm. Field Emission-Scanning Electron Microscopy (FE-SEM, QUANTAFEG250, The Netherlands) was utilized at a voltage of 20 kV. Additionally, a JEOL (JEM-HR-2100 ELECTRON MICROSCOPE, USA) Transmittance Electron Microscope (TEM) was used for further examination. Fourier Transform-Infrared (FTIR) analysis was conducted using a JASCO 3600 (Tokyo, Japan), assisted by Agilent Technologies' Cary 630, to measure spectral transmittance at room temperature. These spectral measurements covered a range from 400–4000 cm−1 with a spectral resolution of 2 cm−1, aiming to identify and analyze the functional groups present in the plant extract. The particle size distribution and charge characteristics of the AgNPs were assessed using a Zeta sizer Ver. 7.03 (temperature 25 °C, count rate 293.2 kcps, measurement position 2 mm). Furthermore, an EDAX APEX and a UV-1800 TOMOS spectrophotometer from China were employed at room temperature to determine the maximum wavelength (λ max.) of the synthesized AgNPs.

Study of sensing activity

Six different metal salts were used to test the green synthesized AgN Ps' ability to detect metal ions, i.e. [Cu SO4. 5H2O, HgSO4, Ni Cl2.6H2O, Co (NO3)2. 6H2O, Cr (NO3)3. 9H2O, Pb (NO3)2 and Cd (NO3)2. 4H2O] were dissolved in distilled water to get a standard solution (0.1 M) for every salt for the colorimetric investigation. To a 1 mL light brown suspension of AgNPs (9.2 × 10–4 M), 2 mL of each metal salt solution (0.001 M) was added. The effect of pH was investigated at pH 2, 7 and 10 using a solution of 1 M NaOH or HNO3. At the optimum conditions of pH, the influence of dose was investigated in the range of 25 to 500 ppm, the resulting suspensions were analyzed by spectrophotometry from 200—1000 nm. The concentration effect of metal salt solution was also studied from 1 × 10–7 to 1 × 10–2 M. Additionally, the effect of time was studied for each concentration from 0 to 15 min.

Real sample analysis

The synthesized AgNPs were applied to analyze a real wastewater sample. This sample was sourced from the Egyptian Company for Chemical Industries-KIMA, located in Aswan Governorate, Upper Egypt. The water was collected from the effluent pit (82 BS211) unit and then filtered through double-ring filter paper no. 102 to remove suspended particles before analysis. The detection of each metal was conducted using the AAS technique under optimal conditions.

Results and discussion

Phytochemical analysis of leaf extract

Table 1 presents the findings from the analysis of phytochemical constituents in the leaf extract. The study revealed a high presence of saponins, alkaloids, and phenolic compounds, along with moderate levels of tannins and flavonoids; however, anthraquinone and terpenoids were absent. These compounds are essential for converting silver ions into silver nanoparticles through various functional groups like hydroxyl, ketone, and aldehydes [86, 87]. They also serve as stabilizing agents.

Table 1 Phytochemical analysis of acacia raddiana leaf extract

Characterization of AgNPs

UV–Vis spectroscopy

AgNPs exhibit a surface plasmon resonance (SPR) peak at 400–500 nm, which may be utilized to confirm the formation of AgNPs using UV–Vis spectroscopy [88]. According to Fig. 5, the maximum absorbance peak in the absorption spectra of AgNPs is located at 423 nm.

Fig. 5
figure 5

UV–visible spectroscopy for silver nanoparticles synthesized using 95 mL (5 mM) of AgNO3 mixed with 5 mL of acacia extract at pH10 and stirring time 2 h

The band gap of AgNPs can be estimated using the absorption spectra obtained from the UV–Vis spectrophotometer of the AgNPs suspended solution. The onset wavelength of absorption was determined by extrapolation of the baseline and the absorption edge as shown in Fig. 6. The band gap was calculated by Eq. (1) [89]:

$${\text{E}}=\frac{hc}{\lambda }$$
(1)

where h is Plancks constant (6.626 × 10–34 Js), c is the speed of light (2.998 × 108 m/s) and \(\lambda\) is the cutoff wavelength of light × 10–9 m (510 nm). There is a conversion factor that should be used in calculations (Joule to eV where 1 eV = 1.63 × 10–19).

Fig. 6
figure 6

Tauc’s plot of the absorption spectra of AgNPs

Another method for estimating the band gap is Tauc's equation (Eq. 2) [90] as follows:

$${\left(h\upsilon \alpha \right)}^{n}=A(h\upsilon -{E}_{g})$$
(2)

Here, depending on the nature of the transition, the plank constant, light frequency, absorption coefficient, proportional constant, energy gap, and power index are each represented by h, ʋ, α, A, Eg, respectively.

Tauc Eq. (2) converts to Eq. (3) as follows:

$$h\upsilon =\frac{hc}{\lambda }=\frac{1240}{\lambda }$$
(3)

By substituting h and c with their values, the equation becomes:

$${\left(\alpha \frac{1240}{\lambda }\right)}^{n}=(\frac{1240}{\lambda }-Eg)$$
(4)

According to Eq. (4), the absorption value in the UV–vis spectrum is represented as (α), and the detection wavelength is λ. Plotting the (αhν)2 versus optical band gap energy, the Eg was estimated by extrapolating a straight line to the (αhν)2 = 0 axes [90,91,92]. Figure 6 illustrates that the band gap for AgNPs is 2.599 eV.

Zeta potential and size distribution

The synthesized AgNPs' stability was evaluated using zeta potential measurements, with a higher positive or negative value suggesting greater nanoparticle stability [93]. The distribution of size, both by intensity and mass, is depicted in Fig. 7a, b, presenting a Z-average (± SD) of 77.35 ± 50.4 (r. nm). The AgNPs exhibited a negative zeta potential of − 32.2 mV, as shown in Fig. 7c, indicative of high stability. Prior studies suggest that a strong negative zeta potential enhances repulsion between nanoparticles, promoting their stable dispersion and contributing to their colloidal quality [93]. Furthermore, the stability of AgNPs influences their size, with reduced stability leading to particle aggregation and an increase in particle size [94].

Fig. 7
figure 7

a Size distribution by intensity, b size distribution by mass of the synthesized AgNPs and c zeta potential of the synthesized AgNPs

FTIR spectroscopy for AgNO3, acacia raddiana leaves extract and AgNPs

The functional groups or biomolecules that are responsible for the reduction of silver ions to AgNPs could be identified with the Fourier transform infrared (FTIR) spectroscopy. As depicted in Fig. 8. This can be achieved by comparing the intensity of AgNPs bands with standard AgNO3 and acacia values. The proportionate change in the band that was observed after silver nitrate treatment is probably indicating that the functional groups participated in the formation of AgNPs [95].

Fig. 8
figure 8

FTIR of acacia leave, silver nitrate and the synthesized silver nanoparticles

FTIR analysis for acacia leaves illustrates that four main peaks were observed at 1057, 1655, 2927 and 3446 cm−1. The first peak (1) is related to C–N amine and the peak at 1655 cm−1 for the carbonyl groups in amide linkages or stretching vibration of C=O group neighbor to carbon–carbon double bonds (C=C) [96]. C–H stretching appeared at 2927 cm−1 indicating the presence of alkanes [97] and the vibration band at 3446 cm−1 corresponding to the O–H bond possibly arising from water.

The AgNO3 sample analysis shows peaks as follows, 1357 cm−1 related to the N–O of the nitrate group and 3476 cm−1 corresponding to the O–H bond possibly arising from water [98].

Comparing AgNPs to Acacia extract and AgNO3, only four peaks formed. The peak at 1655 cm−1 is related to the carbonyl groups (C=O) which formed in low intensity compared with the same peak in acacia leaves which indicates the reaction takes place between AgNO3 and the extract. The second peak was observed at 2373 cm−1 which was attributed to the amino or amide groups and a stretching vibration band formed at 3476 cm−1 for O–H of water. Finally, a peak was observed at 670 cm−1 for Ag which confirms the AgNPs formation. The peaks at 1357 and 1773 cm−1 attributed to N–O and amino groups disappeared compared with the FTIR analysis of AgNO3 and AgNPs. The results indicate that a majority of the carbonyl, hydroxyl, amino, and amide groups present in the components of the plant extract attach to the surface of the synthesized AgNPs, functioning as capping agents to ensure stabilization. Based on these observations, it is noted that AgNPs demonstrate hydrophilic characteristics [99, 100].

X-ray diffraction analysis (XRD)

Effect of pH

XRD patterns can be used to investigate the nature or crystalline composition of biosynthesized AgNPs. XRD examination of AgNPs biosynthesized at varying pH levels (4–10) using a 5 mM AgNO3 solution mixed with 5 mL of the extract, stirred for 2 h at a temperature of 70 °C, is presented in Fig. 9.

Fig. 9
figure 9

Effect of pH on AgNPs synthesis using 95 mL (5 mM) AgNO3 mixed with 5 mL of acacia raddiana extract at 70 °C and stirring time 2 h

The AgNPs synthesized at pH8 and pH10 show only four peaks at 2θ 38.18, 44.25, 64.72, and 77.40° corresponding to the AgNPs which agrees with the previous research [95, 101, 102]. The main peak at 2θ 38.18 for AgNPs prepared at pH10 is the highest intensity compared with other synthesized samples. Two peaks at 2θ 27.3 and 31.8° appeared for pH4 and pH6 samples may imply the presence of bio-organic molecules of the aqueous extract of the plant on the surface of AgNPs or due to the existence of Ag+ ion isn’t reduced [103, 104]. Therefore, the alkaline medium improved the ability of reduction and stabilizing agents in the leaf extract, on contrast, the acidic medium is unsuitable for AgNPs formation [105]. The synthesis of AgNPs under alkaline pH conditions offers several benefits, including enhanced stability, a higher yield of nanoparticles, faster growth, and an improved reduction process [106]. In plant extracts, the OH groups are crucial for their role as reducing and stabilizing agents in AgNPs synthesis. Therefore, a basic pH environment facilitates a greater participation of OH groups in the reduction reaction, which in turn improves the efficiency of the reduction process [107].

The crystallite sizes were determined by Scherer Eq. (5) to be 20.20, 10.05, 20.24 and 30.72 nm for pH4, pH6, pH8 and pH10, respectively.

$${\text{D}}=\frac{k\lambda }{\beta cos\theta }$$
(5)

where D is crystallite size, k is constant (0.89 < k < 1), λ is the wavelength of the X-ray source (0.1541 nm), β is the full width at half maximum (FWHM) and θ is the diffraction angle that corresponding to the lattice plane.

Effect of reaction temperature

The impact of temperature on the synthesis process was examined at 50, 70, and 90 °C, maintaining a pH of 10 and using a combination of 5 mM AgNO3 solution with 5 mL of extract, stirred for 2 h.

As shown in Fig. 10, the sample synthesized at 70 °C shows a pure phase of AgNPs without any additional peaks of a second phase compared with 50 and 90 °C which exhibit a peak of second phase at 2θ = 32.2. The effect of temperature has little impact on the crystallite size of the produced samples. The crystallite sizes were calculated to be 23.70, 21.75 and 23.60 nm for 50, 70 and 90 °C, respectively. From these results, 70 °C is chosen as the optimum temperature because it gives the pure form of AgNPs with the smallest crystallite size. Previous research indicates that the ideal temperature for successful AgNPs synthesis falls between 60 and 80 °C [108].

Fig. 10
figure 10

Effect of temperature on synthesis of AgNPs using 95 mL (5 mM) of AgNO3 mixed with 5 mL of acacia raddiana leave extract at pH10 and stirring time 2 h

Effect of extract volume

Due to the significant role that leaf extract plays in the Ag+ ion reduction, their volume up to a certain point is effective in the synthesis of AgNPs. For this study, varying volumes of leaf extract (1, 2.5, 5, 7.5, and 10 mL) were tested at pH 10 with a 5 mM AgNO3 solution, stirred for 2 h at 70 °C.

As illustrated in Fig. 11, the intensity of the AgNPs peaks increases from 1 mL to be maximum at 2.5 mL then gradually decreases to be minimum at 10 mL.

Fig. 11
figure 11

Effect of extract volume in synthesis of AgNPs Using 95 mL (5 mM) of AgNO3 at pH10, 70 °C and stirring time 2 h

The peak intensity increased from 1 to 2.5 mL because the number of active molecules in the acacia raddiana leaf extract responsible for AgNO3 reduction increased. In contrast, the decrease in intensity peaks above 2.5 mL is due to the presence of extract components that have not been used in the reduction process [109]. The optimal extract volume was determined to be 2.5 mL, aligning with past findings that suggest smaller volumes are more effective for nanoparticle synthesis [110].

Effect of stirring time

Additionally, the stirring time's effect was explored over a range from 0.5 to 4 h, using the same conditions of pH, AgNO3 concentration, extract volume, and temperature. The AgNPs synthesized at 2 h show the sharpest main peak at 2θ 38.21° compared with the other samples. The crystallite sizes were determined to be 20.24, 35.34, 35.35, 24.40 and 30.72 nm at 0.5, 1, 2, 3 and 4 h, respectively. Increasing the time from 0.5 to 2 h increases the main peak intensity of the synthesized AgNPs, which decreases gradually at 3 and 4 h as shown in Fig. 12.

Fig. 12
figure 12

Effect of stirring time on the synthesis of silver nanoparticles using 95 mL (5 mM) of AgNO3 mixed with 2.5 mL of acacia raddiana at pH10, 70 °C

AgNPs synthesis mechanism

The synthesis of AgNPs is facilitated by the presence of various organic compounds in biological systems, capable of donating electrons for the conversion of Ag+ ions to Ag0. These compounds include carbohydrates, fats, proteins, enzymes, phenols, flavonoids, terpenoids, alkaloids, and others. The specific active components responsible for reducing silver ions vary based on the extract used. In hydrophytes, the dehydrogenation of acids (like ascorbic acid) and alcohols (such as catechol) plays a role. In mesophytes, transformations like keto to enol conversions (observed in compounds like cyperaquinone, dietchequinone, and remirin) are involved. Similarly, xerophytes plants may utilize either or both of these pathways to provide the necessary electrons for AgNPs transformation, as illustrated in Fig. 13 [111].

Fig. 13
figure 13

Mechanism of AgNPs synthesis

Scanning electron microscopy (SEM)

SEM Micrograph reveals the AgNPs morphology. The AgNPs synthesized at optimum conditions (pH10, 70 °C, 2.5 mL of acacia leaf extract and stirring time 2 h) were characterized by SEM micrograph as shown in Fig. 14a, b. It reveals that most of the synthesized nanoparticles are spherical with some irregular particles. Figure 14c displays the energy dispersive X-ray (EDX) spectrum, employed to assess the purity and composition of the green-synthesized AgNPs. The presence of AgNPs is confirmed by the prominent Ag peak in the EDX spectra at 3 keV [112]. Elemental analysis revealed a high silver content in the sample (73.86 wt%). Additionally, the absence of an N signal from AgNO3 suggests that acacia raddiana leaves effectively reduced Ag+ to Ag0.

Fig. 14
figure 14

a, b SEM micrographs of synthesized AgNPs; c energy dispersive X-ray (EDX) spectrum of synthesized AgNPs

Transmitting electron microscopy (TEM)

TEM analysis was conducted to examine the morphology and size of the AgNPs under optimal conditions (pH 10, 70 °C, 2.5 mL of acacia leaf extract, and a stirring time of 2 h), as shown in Fig. 15a–d. The AgNPs were observed to have both rod-like and spherical shapes with smooth surfaces. The size distribution, displayed in Fig. 15e, indicates that the AgNPs range from 8 to 41 nm, predominantly clustering around 10–25 nm.

Fig. 15
figure 15

ac TEM images of synthesized AgNPs, d selection electron diffraction pattern (SEAD) and e particle size distribution curve

Table 2 gives a comparison of the silver nanoparticles synthesis condition produced using acacia raddiana leaf extract with the previous studies. It is clear that, the synthesized AgNPs in this study give results that are close to the earlier research as shown in Table 2. The particle size of the synthesized AgNPs in the present study has a small particle size range (8–41 nm) compared to the previous studies.

Table 2 Comparison between the current study and previous ones in the silver nanoparticle synthesis

Sensor activity of AgNPs

Silver nanoparticle–metal ions interaction

It is widely known that prepared AgNPs have a brownish-yellow colour in an aqueous solution caused by the stimulating effect of surface plasmon resonance vibrations (SPR band) in AgNPs [119]. To evaluate the sensing abilities of the AgNPs to the metals Cu2+, Cd2+, Cr3+, Hg2+, Co2+ and Pb2+, 1 mL of 10−3 M metal ion was mixed with 1 mL of AgNPs suspension. As revealed in Figs. 16a–f and 17 as well as Table 3, upon addition of synthesized AgNPs to different solutions of metal ions, Cu2+ ions show a change in AgNPs colour from brownish-yellow to pale yellow resulting in a change in the absorbance band of AgNPs from 423 nm to 352 nm as shown in Fig. 16a. Figure 16b and c illustrate that Cd2+, as well as Cr3+ ions, do not noticeably affect the biologically synthesized AgNPs. The fast response of AgNPs to Hg2+ was observed when the solution colour changed from brownish-yellow to colourless, indicating the high selectivity and specificity of AgNPs for Hg2+ as illustrated in Fig. 16d. In addition, Fig. 16e and f, Co2+and Pb2+ ions show a change in AgNPs colour from brownish-yellow to pale red for Co2+ and yellowish red for Pb2+ resulting in a change in the absorbance band of AgNPs from 423 nm to 438 and 429 nm for Co2+and Pb2+, respectively. The interaction of AgNPs with these metal ions is explained as follows:

  1. (i)

    The Cu2+ ion possesses a high standard reduction potential (Eo), indicating that copper ions can oxidize Ag0. This reaction causes a color shift in the AgNPs from yellowish-brown to a very pale yellow, which is likely due to Ag NP aggregation [120].

  2. (ii)

    For the Hg2+ ion, the color disappearance in the silver nanoparticle solution is primarily attributed to a redox reaction involving Ag0 and Hg2+, which have standard potentials of 0.8 V (Ag+/Ag) and 0.85 V (Hg2+/Hg) respectively [121]. Two mechanisms are proposed for AgNPs' interaction with mercury. Initially, the addition of Hg2+ leads to the coating of AgNPs' external surface with Hg0, reducing absorbance and shifting the Surface Plasmon Resonance (SPR). Alternatively, the process could involve amalgam formation between AgNPs and Hg ions, a plausible reaction given the minor difference in electrochemical potentials between Hg2+ and AgNPs (0.8 V vs. 0.85 V), facilitating amalgam production and under-potential deposition [122, 123].

  3. (iii)

    Regarding Co2+ ions, the introduction of Co (II) results in AgNP aggregation, changing their color from brownish-yellow to pale red. This change is attributed to covalent coordination bonds formed by catechol molecules (from the plant extract) on the AgNPs surface with Co2+ ions [124].

  4. (iv)

    In the case of Pb2+ ions, the notable decrease and shift in the AgNPs' absorbance band post the addition of Pb (II) ion are likely due to AgNP aggregation. It is recognized that aggregation of nanoparticles leads to a shift in the Localized Surface Plasmon Resonance (LSPR) peak absorbance towards a higher wavelength maximum [125].

Fig. 16
figure 16

UV–Vis spectra of synthesized AgNPs Solution with a Cu2+, b Cd2+, c Cr3+, d Hg2+, e Co2+ and f Pb2+

Fig. 17
figure 17

Colour of metals under study with AgNPs

Table 3 Response of AgNPs as a sensor to heavy metals under investigation

Effect of pH

For the six metals, the impact of pH was examined between the ranges of 2, 7, and 10 as shown in Fig. 18. Concerning mercury, the brownish-yellow colour of AgNPs disappeared at all studied pHs as illustrated in Fig. 18a. In the case of copper, Fig. 18b, a colour disappearance was observed at pH 2 and 10 as well a very pale yellow colour was obtained at pH 7. Figure 18c and d demonstrate that cobalt and lead show a shift in the absorbance band at pH 7 however at pH 2 and 10, give negligible results. Regarding Cd2+ and Cr3+ there are no significant results observed with pH change as shown in Fig. 18e and f).

Fig. 18
figure 18

UV–Vis spectra green synthesized AgNPs solution with a Hg2+, b Cu2+, c Co2+, d Pb2+, e Cd2+ and f Cr3+ at different pH

Effect of AgNPs dose on Hg2+, Cu2+, Co2+ and Pb2+ detection

The effect of the AgNPs dose was studied for Hg2+, Cu2+, Co2+ and Pb2+ ions in the range 25, 50, 100, 250 and 500 ppm as shown in Fig. 19. The results indicated that mercury at doses 25, 50, 100 and 250 ppm disappear the absorbance band of AgNPs but at 500 ppm no change occurs as illustrated in Fig. 19a. According to copper, Fig. 19b, the peak of the AgNPs at 423 nm disappeared at 50 ppm and shifted to a lower wavelength (from 423 to 352 nm) at 25 ppm, but the other doses give the same curve with different absorbance values. For cobalt, Fig. 19c, doses 25, 50 and 100 ppm give a shift in the band (from 423 to 438 nm) with a difference in intensity of the absorbance band while, no change occurs in 250 and 500 ppm. In the case of lead, Fig. 19d, 25 and 50 ppm give absorbance bands at 429 nm but the doses 100, 250 and 500 give two absorbance bands at 413 and 429 nm.

Fig. 19
figure 19

Effect of dose of AgNPs on a Hg2+, b Cu2+, c Co2+, and d Pb2+ detection

Sensitivity and UV–vis studies

By checking the colour transformation of the system and measuring the UV-vis absorbance reading, 1 mL of various concentrations of an aqueous solution of metal ions (10-2 to 10-7 M) was mixed with 1 mL of 4.6×10-4 M AgNPs solution at room temperature to evaluate the method's sensitivity and determine the lowest detectable concentration of Hg2+, Cu2+, Co2+, and Pb2+ in an aqueous solution. The general trend for the four studied metal ions (Hg2+, Cu2+, Co2+, and Pb2+) is identical as illustrated from Figs 20, 21, 22, 23 where raising the concentration of metal ions lowers the absorbance peaks of AgNPs.

Fig. 20
figure 20

UV–Vis spectra of synthesized AgNPs in the presence of a 10–2, b 10–3, c 10–4, d 10–5, e 10–6 and f 10–7 M of Hg2+with time, Respectively and g the change of sensor colour with Hg2+ concentration

Fig. 21
figure 21

UV–Vis spectra of synthesized AgNPs in the presence of a 10–2, b 10–3, c 10–4, d 10–5, e 10–6 and f 10–7 M of Cu2+ with time, respectively and g the change of sensor colour with Cu2+ concentration

Fig. 22
figure 22

UV–Vis spectra of synthesized AgNPs in the presence of a 10–2, b 10–3, c 10–4, d 10–5, e 10–6 and f 10–7 M of Co2+with time, respectively and g the change of sensor colour with Co2+ concentration

Fig. 23
figure 23

UV–Vis spectra of synthesized AgNPs in the presence of a 10–2, b 10–3, c 10–4, d 10–5, e 10–6 and f 10–7 M of Pb2+with time, respectively and g the change of sensor colour with Pb2+ concentration

From Fig. 20a and b, 1 × 10−2 and 1 × 10−3 M of mercury (II) transform the brownish yellow colour of AgNPs solution to colourless, whereas 1 × 10−4 M and 1 × 10−5 M, change the colour to pale yellow as indicated in Fig. 20c and d). On the other hand, several repeated experiments confirmed that 1 × 10−6 and 1 × 10−7 M of mercury (II) give little change of colour response to AgNPs as shown in Fig. 20e and f. The colour change of various concentrations of Hg2+ ions with AgNPs are illustrated in Fig. 20g.

For copper, Fig. 21a, at 1 × 10-2 the brownish-yellow colour of AgNPs solution changed to colourless and the absorbance band of AgNPs disappeared. 1 × 10−3 and 1 × 10−4 M changed the brownish yellow colour of AgNPs solution to pale yellow and a shift to a lower wavelength occurred from 423 to 352 nm as shown in Fig. 21b and c, whereas 1 × 10−5, 1 × 10−6 and 1 × 10−7 M, Fig. 20d–f, no colour alteration of AgNPs was observed. Figure 21g illustrates the colour of AgNPs with different concentrations of copper ions.

On behalf of cobalt, as illustrated in Fig. 22a–d, 1 × 10-2 M, 1 × 10−3 M, 1 × 10−4, and 1 × 10−5 altered the colour of AgNPs from brownish yellow to pale red, whereas 1 × 10−6 and 1 × 10−7 M exhibit no variation in the AgNPs colour as shown in Fig. 22e and f. Figure 22g shows the colour change of AgNPs with different concentrations of cobalt.

In the case of lead, Fig. 23a–c, 1 × 10−2, 1 × 10−3 and 1 × 10−4 M change the brownish yellow colour of AgNPs solution to very pale red, while the 1 × 10−5 M converts the colour to yellow as illustrated in Fig. 23d. 1 × 10−6 and 1 × 10−7 M, Fig. 23e and f, maintain the colour of AgNPs. The colour change of AgNPs with lead is shown in Fig 23g.

The influence of time on the colour of the metal-AgNPs was studied in the range of 0-15 min. The four studied metals show fast response to AgNPs where the colour change is recorded at just metal addition (0 min.) to AgNPs. After 3, 6, 9, 12, and 15 min, the colour becomes constant for Hg2+ and Cu2+ whereas the colour of Pb2+ and Co2+ changed from pale red to pale yellow.

Dynamic range

For a sensing device to be quantitatively useful, it must be demonstrated that its response changes depending on the analyst's concentration. A linear correlation can be seen in the nanosensor calibration plots for Hg2+, Cu2+, Pb2+ and Co2+ ions at low concentration ranges as shown in Figs. 24, 25, 26, 27.

Fig. 24
figure 24

a, b Linear range of Hg2+ ion

Fig. 25
figure 25

a, b Linear range of Cu2+ ion

Fig. 26
figure 26

a, b Linear range of Pb2+ ion

Fig. 27
figure 27

a, b Linear range of Co2+ ion

Equation (6) was used to calculate the detection limit (LD) and quantification limit (LQ).

$$\mathrm{LD \,or\, LQ}=\frac{kSb}{m}$$
(6)

where Sb and m are the linear calibration curve's slope and standard deviations, respectively. For the determinations LD and LQ, the constant K is equal to 3 and 10, respectively [126]. The calculated LD and LQ for Hg2+, Cu2+, Pb2+ and Co2+ ions are described in Table 4.

Table 4 Calculated values of LD, LQ and Sandell's sensitivity

Sandell's pre-calculated sensitivity, Table 4, was described as the analyst concentration (in µg mL−1), which will absorb 0.001 in a path length cell 1 cm [126, 127] and which is expressed as g cm−2, calculated using Eq. (7):

$$S=n\frac{M}{\varepsilon }=\frac{M .\,Wt\times\, No \,of \,atoms}{Molar \,absorpitivity \,of \,coloured \,species}$$
(7)

The above equation can be interrupted as the following Eqs. (8, 9 and 10):

$${\text{S}}=\frac{{10}^{-3}}{{\upvarepsilon }_{s}}$$
(8)
$${\varepsilon }_{s}=\frac{\varepsilon }{M.\,Wt\, of\, determinant}\times 1000$$
(9)
$$\varepsilon =\frac{A}{C.d}$$
(10)

where εs is the specific absorptivity and its value in µg/cm corresponds to the determinant in a cuvette with an optical length of 1 cm, ε is the molar absorptivity, C is the molar concentration of the determinant, and d is path length (1 cm) [128].

The absorbance signals of the AgNPs sensor with different concentrations of Hg2+ were investigated across a 10–2-10–7 M range. It was observed that Hg2+ showed linearity from 1 × 10–7–1 × 10–4 M (Fig. 24) with R2 0.9814, LD 1.322 × 10–5, LQ 4.4 × 10–5 and Sandell’s sensitivity 5.5 × 10–3 µg cm−2.

For Cu2+, Fig. 25, linearity was observed from 1 × 10–7–1 × 10–4 M, with R2 0.9874, LD 1.37 × 10–7 and LQ 4.5 × 10–7 and Sandell’s sensitivity 1.05 × 10–5 µg cm−2.

Lead ion, Fig. 26, exhibited a linearity from 1 × 10–7–1 × 10–5 M with R2 0.999, LD 1.63 × 10–5, LQ 5.44 × 10–5 and Sandell’s sensitivity 1.46 × 10–3 µg cm−2.

In the case of cobalt, Fig. 27, exhibits linearity in the range 1 × 10–7– 1 × 10–4 M, where the R2 is 0.999, LD, 1.34 × 10–4, LQ 4.486 × 10−4 M and Sandell’s sensitivity 6.8 × 10–3 µg cm−2. For Hg2+ and Pb2+, 1 × 10–5 M is the concentration that saturate the AgNPs sensor, whereas for Cu2+ and Co2+ the concentration saturating the AgNPs sensor is 1 × 10–7 and 1 × 10–4 M, respectively.

Matrix effect

To examine the impact of the metals on each other, mixtures of metal–metal solutions were prepared by mixing 1 × 10−3 M of a given metal ion with 1 × 10–3 M of Cu2+, Cd2+, Co2+, Cr3+, Hg2+, Ni2+ or Pb2+. The total volume in all cases was adjusted to a graduated volume.

For Hg2+, Fig. 28, it can be detected that no interference occurs with all metals under study showing that the test technique has a very high level of sensitivity and selectivity for Hg2+

Fig. 28
figure 28

Sensitivity of AgNPs toward mercury with other metals under study

Figure 29 shows the resulting data whenever Cu2+ is the given ion. It can be detected that only in the case of Cu2+/Ni2+ and Cu2+/Cd2+/Ni2+ mixtures no interference occurred.

Fig. 29
figure 29

Sensitivity of AgNPs toward copper with other metals under study

Concerning Pb2+, Fig. 30, it can be detected that only in the case of Pb2+/Co2+ mixtures no interference occurred.

Fig. 30
figure 30

Sensitivity of AgNPs toward cobalt with other metals under study

Figure 31 represents the resulting data of Co2+ ions. It can be observed that all metals under study cause interference.

Fig. 31
figure 31

Sensitivity of AgNPs toward lead with other metals under study

Comparison with previous literature

Table 5 presents a comparison of the current study with existing literature regarding the efficiency and capability of the synthesized AgNPs in detecting Hg2+, Pb2+, Co2+, and Cu2+ ions. The results show that the AgNPs synthesized in this study, without any modifications, offer a quicker response time for these four metal ions than those reported in other studies. Additionally, they exhibit relatively low detection limits, demonstrating the sensitivity of the prepared AgNPs towards Hg2+, Cu2+, Co2+, and Pb2+ ions. However, interference was observed in the detection of copper, lead, and cobalt ions in the presence of other metals, which represents a limitation of this study.

Table 5 Analytical performance of the AgNPs sensor with previously reported sensors for the Hg2+, Pb2+, Co2+ and Cu2+

Real sample analysis

Table 6 shows the efficiency of the AgNPs as colouring sensor for the heavy metals under study in wastewater samples. The percentage efficiency of AgNPs toward Pb is 42.43%, Cu is 100.72% and Co is 42.33%. While mercury isn’t found in the sample.

Table 6 The efficiency of the AgNPs as colouring sensor for the heavy metals under study in wastewater samples (KIMA)

Conclusion

The acacia raddiana leaf extract is rich in secondary chemical constituents (phenols, tannins, alkaloids, saponins and flavonoids). These chemicals behave as reducing and stabilizing reagents for synthesized AgNPs. The influence of leave extract volume, pH, temperature and time on the interaction response and morphology of the synthesized AgNPs are examined. The AgNPs synthesized at pH10, for 2 h with extract volume 2.5 mL and temperature 70 °C give sharp peaks and are more crystalline than the other samples. The AgNPs surface acquired a negative charge according to the zeta potential results which was found to be − 32 mM. The AgNPs have mostly a spherical structure with particle sizes between 8 and 41 nm. The synthesized AgNPs can be utilized to detect mercury, copper, lead and cobalt with LD and LQ 1.322 × 10–5 M and 4.4 × 10–5 M for mercury, 1.37 × 10–7 M and 4.5 × 10–7 M for copper, 1.63 × 10–5 M, 5.44 × 10–5 M for lead and 1.34 × 10–4 M, 4.486 × 10–4 M for cobalt, respectively. Hg2+ can be detected in the presence of all metals under study individually or together. Co2+ cannot be detected in the presence of all metals under study individually or together. Cu2+ can be detected in the presence of Ni2+ individual and Cd2+ + Ni2+ together. Pb2+ can be detected in the presence of Co2+ only. Future studies should explore additional modifications to AgNPs to enhance the sensitivity of colorimetric detection of heavy metals and to reduce potential interferences.