1 Introduction

Organic and inorganic pollutants endanger human life by inducing many diseases in aquatic environments and human health, notably mutagenic, poisonous, teratogenic, and carcinogenic implications [1, 2]. As a result, even at extremely low concentrations, impacts on numerous human health diseases such as kidney, brain, liver, reproductive system, central nervous system, and epigenetic modifications might arise. According to the US Environmental Protection Agency, phenolic chemicals are potential poisons, including nitrophenols, chlorophenols, and alkylphenols [3].

Phenolic compounds and nitro-organics are among the most dangerous organic contaminants. Pesticides, herbicides, textiles, pharmaceuticals, and detergents are all raw sources of toxins in water [3, 4]. Conventional treatment methods like sedimentation and flocculation, as an example, are insufficient to ensure good water quality [5]. Besides phenols, dinitroaniline and its isomers are released into the environment via industrial waste or as degradation products of herbicides, pesticides. They have been listed as priority pollutants in many countries. These compounds can undergo complex environmental transformations at trace levels after entering the environment, posing potential environmental hazards. Also, nausea, dizziness, and headache can be caused by acute or chronic nitroaniline exposure because of their widespread industrial use [6].

Due to their distinctive qualities, including specific shape, size, and surface area [7], silver nanoparticles (AgNPs) seems to have several unique characteristics, including surface plasmon resonance (SPR), electric conductivity, antimicrobial activity against a wide range of bacteria, and effective photocatalytic action [8, 9].

In this context, global environmental awareness and strict legislation are driving research towards sustainable process implementation. For the fabrication of AgNPs, many biomimetic approaches are being considered. Chemical and physical procedures are among them. They are, however, costly, time-consuming, and hazardous to the environment since their cytotoxicity is strictly dependent on their size and shape [10]. Green synthesis is offered as a straightforward, cost-effective, and ecologically friendly technique of production [11]. Subsequently, the utilization of fruit waste and food waste/by-products as a source of lowering chemicals has grown increasingly appealing due to its potential economic benefits. The valorization of food waste is a progressive direction of resource-saving. Various wastes have been used for the synthesis of AgNPs, such as banana peel [12], papaya peel [13], tea wastes [14], Ambrosia maritima [15], and orange peel [16] have opened a novel method for developing an alternative methodology for the preparation of AgNPs.

Coffee waste is essentially rich in tannins, polyphenols, and caffeine, and it also contains appreciable amounts of carbohydrates, alkaloids, and flavonoids [17]. In 2019/2020, world coffee consumption is estimated at 169.34 million bags, 0.7% higher than in 2018/2019 as COVID-19 presents a considerable downside risk to global coffee consumption. Currently, demand is estimated to exceed production, projected at 168.86 million bags, by 0.47 million bags in the coffee year 2019/2020 [18, 19]. With this massive production, this type of waste is a significant pollution risk when deposited in landfills across the globe. However, environmentally and renewable phenol-rich agricultural and food waste products mainly contain antioxidants which are considered as a pure source of natural and sustainable additives to functionalize materials for water treatment, biomedical, biorefinery, and energy applications [20].

Thus, coffee waste extract can be used as an excellent reducing and stabilizing agent for the preparation of AgNPs [21]. This green method can be considered a tremendous and environmentally method for the preparation AgNPs, but it has some limitations [22]. For example, yield is limited, the lateral size is high, or using harsh conditions during preparation. More relevant studies based on coffee materials are proposed for the green fabrication of AgNPs with their diverse applications in different fields such as antibacterial activity [23], photocatalytic degradation [24], and supercapacitance investigations [25].

In the present context, the impositions of the CWE in terms of green and sustainable materials to induce the formation of AgNPs matching with circular economy concepts were discussed. Since CWE is used in extract form, without extra chemically reducing agents, this is an easy way to exhibit reproducible, scalable, economic imperative and requires no specialized laboratory equipment or complex apparatuses. CWE was fully characterized and used to degrade phenol compounds with the aid of citric acid and remove the hazardous compound, 2,4-dinitroanilines. Also, the electrochemical investigation was defined, and the antibacterial features against the infected microbes were also evaluated.

2 Experimental section

2.1 Preparation of coffee waste extract (CWE)

To prepare CWE, the collected coffee waste powder was brought to the laboratory, washed with pure water and filtrated using Whatman filter paper (0.45 μm) to obtain the pure powder, which dried at 45 °C overnight. About 5 g dry powder was mixed with 50 mL deionized water and 10 mL absolute ethanol, then stirring at 80 °C for 90 min. After that, the solution was filtered again to eliminate visible impurities and then centrifuge at 6000 rpm. The pleasant odor extract was stored in a refrigerator at 5 °C and ready for subsequent experiments.

2.2 Fabrication of biogenic silver nanoparticles

To prepare a solution of zero-valent silver nanoparticles (AgNPs), 100 mL of the prepared extract (CWE) was placed in a 500 mL conical flask and kept under vigorous magnetic stirring for 5 min then added 100 mL dropwise of silver nitrate solution (AgNO3; 5 mM, molecular weight, 169.87 g/mol, pure white crystal, ACS reagent ≥ 99.0%). In this state, CWE was used as a reducing and stabilizing agent for AgNPs under the effect of temperature (75 °C). After complete addition, it was noted that the color was gradually converted to faint brown, which depicted the formation of AgNPs. It was also remarkable that the faint brown color was turned to a greenish color and fixed after 160 min of the chemical reaction, affirming all Ag ions’ complete reduction process. The powder of nanoparticle was separated at 8000 rpm for 15 min and washed with water. The centrifugation and washing process was repeated three times to give the AgNPs. Finally, the obtained powder of AgNPs was dried using a freeze dryer (Martin Christ, Germany) at − 60 °C overnight and then was used for further characterization and application.

2.3 The main characterization of CWE and CWE capped AgNPs

HPLC method was used to detect main compounds in CWE, and the experimental was typically conducted as published elsewhere [26, 27].

UV–vis spectrophotometer (ATI Unicam 5625 UV/VIS Vision Software V3.20) was used to screen the as-synthesized AgNPs in the range of 200–800 nm.

ThermoFisher Nicolete IS10 (USA) was used to analyze the chemical functional groups of CWE and CWE cap AgNPs using Fourier transforms infrared (FT-IR) in the range of 4000–500 cm−1 at a resolution of 1 cm−1. X-ray diffraction (XRD; Bruker, B8-advance, X-ray diffractometer) performed at a voltage of 40 kV and a current of 30 mA with Cu Ka radiation which used to determine the structure and crystallinity of nanoparticles. Transmission electron microscopy (JEOL, JEM-2100, Japan) was used to examine the particle size, shape, and morphology of the prepared AgNPs. The surface texture and the elemental study was recognized using a scanning electron microscope-energy dispersive X-ray (SEM-EDAX; JEOL JSM-6510/v, Japan).

2.4 Photocatalytic evaluation study

Photocatalytic activity of AgNPs was explored through phenol photodegradation using a stock solution from phenol (50 ppm). About 20 mL of the stock solution was charged into eight different 50 mL Erlenmeyer flasks. Then different doses of the as-prepared AgNPs (3, 5, 7, 9, and 12 mg) were added. About 8 mL citric acid stock solution (ACS reagent, ≥ 99.5%) was added to each flask by flow rate process [18]. The mixture in each flask was stirred continuously at room temperature under dark conditions for 40 min to achieve adsorption–desorption equilibrium before being exposed to a visible light lamp. The handmade visible light photoreactor consists of 2 X 50 Watt visible light in a closed box and light scattered on the top of the reactor. The rate of phenol degradation and the importance of AgNPs in the rapid photocatalytic degradation were revealed through photo spectroscopy analysis. Taking known amount from these stocks in each experiment to identify the reduction behavior of 2,4 dinitroaniline (2,4 DNA). The first three experiments were conducted at room temperature with a constant concentration of citric acid (8 mL) and various dosage of AgNPs (3, 5, and 7 mg, respectively) at a continuous 30 min. The three remaining experiments were conducted at room temperature with a constant concentration of AgNPs (7 mg) and varying the contents of citric acid (4, 6, and 8 mg, respectively) at 40 min.

Double-beam UV–vis detected the remaining concentration, and the degradation percentage D (%) was calculated using the following relation:

$$D\left(\%\right)=[\left({{C}_{o}-{C}_{t}}\right)/{{C}_{o}}] \times 100$$
(1)

where Co is the starting concentration of the pollutant before adding the catalyst and Ct is the concentration of the pollutant after degradation at time t.

2.5 Antibacterial activity

Using a well-agar diffusion process, antibacterial tests were conducted in vitro against many bacterial species, including E. coli and P. aeruginosa, S. aureus, and B. subtilis. To achieve a uniform shape in a Petri dish, these bacteria were cultivated on nutrient agar. Then, 10 mL of the as-prepared AgNPs is mounted in a 6 mm hole in agar and ciprofloxacin discs (10 g) in the same tray as standard antibiotics. Eventually, all Petri dishes were held to 37 °C for 24 h before being tested for the zone of inhibition; this procedure was repeated three times.

2.6 Electrochemical investigation

All electrochemical measurements of AgNPs were performed in a 1 M Na2SO4 solution with a three-electrode cell setup that included a working electrode, a reference (Ag/AgCl), and a counter electrode (Pt coil). A homogeneous slurry of produced AgNPs active nanomaterial (90%) and poly (vinylidene difluoride) (average Mw ~534,000, Sigma Aldrich) (10%) in a 0.35 mL N-methyl pyrrolidone (ReagentPlus®, 99%, Sigma-Aldrich) as a solvent was used to make the working electrode. The slurry was poured onto a sheet of stainless steel (current collector) and allowed to dry at 85 °C after being sonicated for roughly 20 min at room temperature. Cyclic voltammetry (CV), galvanostatic charge/discharge (GCD), and electrochemical impedance spectroscopy (EIS) were used to examine the properties of the AgNPs as a supercapacitor electrode. GCD and CV measurements were carried at various current densities ranging from 0.56 to 3.80 A g−1 and with a scan rate range from 10 to 100 mV s−1 in between 0–1 V potential window, respectively. EIS measurements were carried at a steady-state no-load potential with a sinusoidal noise amplitude of 10 mV in the frequency range 105 to 0.1 Hz. EC-Lab V11.4 software was used to obtain EIS parameters.

2.7 Statistical analysis

The means ± SD were performed in this research, and the required figures were represented as three separate tests. An analysis of variance was recognized by using the difference for each particular test. However, the significance level of 0.05 error (p < 0.05) was statistically considered.

3 Results and discussion

3.1 Phytochemical screening

Before using any substance in any chemical reaction or using it as a substitute for harmful chemical substances, it is necessary to verify its components to determine how it is used and its reaction conditions. Thus, Table 1 summarizes the results of a qualitative phytochemical study of coffee waste extract (CWE). The data revealed active components in the pure extract of CWE with low concentrations of carbohydrates, alkaloids, proteins, amino acids, saponins, and flavonoids. Furthermore, tannins and phenols can be used in high concentrations in chlorogenic acid, gallic acid, and caffeic acid [17, 19, 26]. This proves the waste’s effectiveness and potential to preserve the active ingredients in the used coffee powder.

Table 1 The test of the active phytochemical components in aqueous extract of coffee waste (CWE)

The quantitative study of adequate tannins and caffeic acid responsible for reducing metallic Ag+ to Ag0 [28, 29] is shown in Table 2. Anything other than that, such content played the dual role of reductant and stabilizing agent for the produced AgNPs attributable to the reducing affinity associated with the electron donation potential, including the hydroxyl groups of phenol compounds [19, 30, 31]. The chemical structure, configuration, and several phenolic hydroxyl groups are primarily responsible for stabilizing and reducing the ions of silver to zero-valent particles. Similarly, findings explored the quantitative and qualitative total tannins and phenols in different extracts using green chemistry to prepare metal nanoparticles [32].

Table 2 Total secondary metabolites content in CWE

3.2 HPLC examination

HPLC technique of pure coffee waste extract included gallic acid, chlorogenic acid, and caffeic acid. Their concentration and chemical structure are shown in Fig. 1 and Table 2. These components can be applied in therapeutic roles such as antimicrobial, antioxidant, anti-inflammatory, loss weight, and blood pressure adjustment [33].

Fig. 1
figure 1

HPLC chromatogram of effective compounds in CWE, including the chemical structures of effective compounds in the CWE

3.3 UV–vis spectroscopy, PL, and FTIR spectrum of CWE and AgNPs

The formation of AgNPs was initially confirmed by UV–vis spectroscopy and monitoring the absorption wavelength of CWE before and after using it to prepare AgNPs. As shown in Fig. 2a, the Uv–vis spectra of CWE displayed two distinct peaks at 278 and 321 nm. The synthesized AgNPs via CWE showed a broad peak at 465 nm (Fig. 2b) due to the surface plasmon resonance (SPR) absorption of AgNPs, which can also be attributed to the accumulated oscillations of free electrons located at the surface of metallic nanoparticulate validated the development of AgNPs [34]. Otherwise, curve at 270 nm (medium), 354 nm (weak), and 465 nm (strong), which described to the quadrupole, out-of-plane dipole, and in-plane dipole plasmon resonance of hexagonal AgNPs [35]. The theoretically calculated bandgap for the prepared AgNPs was 2.67 eV.

Fig. 2
figure 2

UV–vis spectral range of a CWE, b AgNPs by a greenway, and c photoluminescence emission spectrum of CWE (blue) and CWE stabilized AgNPs (red)

It has been literaturally and experimentally defined that the synergistic fingerprint region, which confirms this phenomenon by AgNPs, is primarily found in the wavelength range from 400 to 450 nm [36]. The transformation of silver metal ions Ag+ into silver nanoparticles Ag0 through the active biomolecules presented in CWE results in the generation of AgNPs [12]. Thus, the green synthesized AgNPs stabilized via CWE have a plateau at 270 nm due to the wavelength shifting for CWE from 278 to 270 nm. Irradiating the metal surface with an electron, photon, or laser beam will cause silver to illuminate [37], with confirmed emission peak positions ranging from 300 to 550 nm. Despite the fact that many studies of AgNPs have been reported, we could find few reports on their luminescence study [38, 39].

Figure 2c shows the PL properties of both CWE and CWE stabilized AgNPs. CWE in water exhibits two significant peaks at 376 and 438 nm. The peak of CWE stabilized AgNPs is of lower intensity and shifted to 440 nm. This is probably due to the formation of AgNPs, and it can be concluded that AgNPs under visible light could reduce the rate of electron and hole recombination. The CWE curve’s amplitude decreases and becomes broader, indicating a bio-interaction between CWE and AgNO3 to form the well-stabilized AgNPs.

The PL of Ag or any noble metal excites electrons from occupying d bands in states above the Fermi Level. Consequently, electron/phonon and hole/phonon scattering lose the energy and, eventually, photoluminescence recombination of an electron from such an occupied sp band with a hole [37]. The interband transition is also thought to be direct owing to the minor photon momentum. The emission is caused by direct recombination of conduction band electrons with holes in the d band scattered to a momentum state much more diminutive than Fermi momentum (KF).

In Fig. 3, the FTIR spectrum showed that –OH hydroxyl stretching vibration group is dominant because phenols in CWE are related to the broad peak at 3422 cm−1 [40]. Asymmetrical and symmetrical stretching modes resulting from aliphatic alkane groups are also seen at a wavenumber of 2928 and 2857 cm−1 [41], respectively. The absorption peaks that appeared at 1748 and 1649 cm−1 correlate to aliphatic esters and caffeine, respectively, and they coincided with the HPLC results [42].

Fig. 3
figure 3

FTIR spectrums of a CWE and b AgNPs

The intensity of 1500 cm−1 relates to the aromatics’ C–C stretching in the ring. Meanwhile, the bands exhibited at 1388–1148 cm−1 are ascribed to the vibration stretching type II-based arabinogalactan carbohydrate peak [43]. On the other side, the O–H band that refers to the presence of carboxylic acids appears at 915 cm−1. The ß-type of glycosidic linkages arising from carbohydrates rings is affirmed by the existence of a band between 850 and 805 cm−1, which depicted the fingerprint of CWE [44]. The peak observed at 738 cm−1 indicated the alkynes group’s presence (–C = C-H: C-H bending). In the case of AgNPs coated by CWE, the intensity of such peak was lower than that of CWE spectra with broader which validate the formation of AgNPs. The spectra of AgNPs are displayed below the CWE spectra. The spectrum shows the changes in the chemistry of CWE. The spectrum also shows several peak shifts and intensity shape changes of the bands between fingerprint zones of 800–1500 cm−1. This transition of chemical changes is attributed to the reduction of Ag+ to Ag0 due to phenolic activity, respectively.

3.4 XRD and morphological studies

Figure 4a shows an XRD for the green synthesized AgNPs in the XRD range of 20–80o. It is observed that the synthesized AgNPs has four strong peaks at 2θ = 37.580, 43.730, 64.040 and 76.940 corresponding to the planes (111), (200), (220), and (311), respectively) [36, 45]. These obtained peak planes are for face cubic crystal (FCC) structure as matched with (JCPDF Card No-087–0720) which agreed with the literature [46]. These observed peaks are in accordance with those published elsewhere [47], implying the smaller scale, crystalline composition, and high purity of AgNPs produced by the green method.

Fig. 4
figure 4

a XRD pattern, b HR-TEM, (inside SAED), and c particle size distribution curve of AgNPs

The interplanar spacing (d spacing) was calculated and compared with JCPDF as shown in Table 3 by using Bragg’s Law equation:

Table 3 d-spacing standard and calculated from XRD pattern with the plane
$$d=\frac{n\lambda}{2\;\mathit{sin}\;\theta}$$
(2)

d = spacing (A0), n = order of diffraction = 1, λ = 1.5418 the incident wavelength of the XRD, and θ = the Bragg angle. (D) The average crystalline size of AgNPs is calculated from full-width at half maximum (FWHM) using Debye-Scherer equation:

$$D=\frac{K\lambda }{ \beta {{\kern-0.3em}}^{1}\!\left/{{\kern-0.3em}}_{2}\right. COS\theta }$$
(3)

as K = 0.9 (a sharp grain factor) and β = the entire width of the XRD peak at half maximum. Thus, it can be observed that the calculated crystal average size is estimated to be 18.9 nm.

The morphology and appearance of AgNPs are shown in TEM images (Fig. 4b), which are ascribed to monodispersed spherical and hexagonal shaped AgNPs to some extent (yellow circles) [48]. This unique morphology makes it synergistic in electrochemical supercapacitor (ESS), where ions are absorbed and intercalated onto the surface of the active materials, leading to developed electrochemical performance [49]. Inside Fig. 4b, the selected area diffraction (SAED) of AgNPs in which these bright spots formed four significant planes, which are also in agreement with the graph of XRD. Additionally, the calculated size for the analyzed AgNPs is less than 20 nm (13.62 nm) according to the size distribution curve (Fig. 4c), which is typically following the obtained data from XRD.

In Fig. 5, the morphological surface of CWE and AgNPs coated by the steric effect of CWE was assessed using the SEM tool. Remarkably, CWE has a smooth and porous surface [50]; this surface makes it more sparkle as a stabilizer and reducing agent (Fig. 5a). By examining EDAX graphs to outline the elemental contents of each prepared sample, it is revealed that CWE has main elements with their atomic percentage. It can be seen that from the EDAX graph (near SEM) for CWE, there are many elements with their atomic percentages, including C (60.96%), N (18.99%), O (19.93%), and K (0.12%).

Fig. 5
figure 5

SEM of a CW powder with relative EDX and b SEM of AgNPs and beside EDX analysis

On the other hand, the surface structure is entirely different after using stabilizing agent. The surface of CWE has many small particles of AgNPs deposited onto and penetrated the surface of extract, implying that CWE has the potential effect of preparing AgNPs with very small size and is well-stabilized forms (Fig. 5b). Additionally, these hexagonal particles with irregular distribution of AgNPs form sheets or clusters are formed [51]. The high purity of the generated AgNPs affirming the potentially important role of CWE as the percentage of Ag equal percent 100 is also confirmed by AgNPs EDAX.

3.5 Degradation of phenol

The degradation of phenol using citric acid was extended in this context in the presence and absence of the green prepared AgNPs to reveal their effects. The fact that there is almost no difference in absorbance of phenol solution at λmax = 269 nm in a blank assay without AgNPs indicates a sluggish reduction rate for a phenolic solution. The observed phenol degradation rate after 42 min is only 8% (the data are summarized in Fig. 6a and Table 4). When the same experiments were repeated at the presence of different concentrations of AgNPs simultaneously, there was a significant decrease in the absorbance, implying that phenol is reduced significantly by citric acid in the presence of AgNPs. So, it can be concluded that AgNPs’ surface plasmon resonance (SPR) property allows them to serve as an electron relay center, effectively assisting the transition of electrons from citric acid to phenol and, as a result, increasing the degradation rate [52].

Fig. 6
figure 6

UV spectra of phenol degradation at different conditions (regarding Table 4) (a), UV spectral degaradtion of phenol [20 mL volume, 8 mL of citric acid, 12 mg AgNPs] (b), and the breakdown rate (%) of AgNPs at optimal dose (12 mg) (c)

Table 4 Degradation (%) of phenol in the absence and presence of AgNPs combined with citric acid (at standard time 42 min)

Remarkably, the efficient degradation of phenol has occurred while using AgNPs with a concentration of more than 3 mg. Thus, the phenol degradation achieved a maximum in less than 15 min. Therefore, the dosage of AgNPs affects the speed rate at which phenol degrades (Table 4). As shown in Fig. 6b, the maximum rate for phenol degradation is achieved using 12 mg of AgNPs combined with 8 mL of citric acid (0.1 M). These findings point to AgNPs being synergistic in effectively degrading phenol with citric acid, a unique and novel approach for phenol degradation, and attain 94.6% (Fig. 6c).

3.5.1 The mechanism of phenol photodegradation

The surface area is one of the contributors to enhancing photocatalytic degradation of pollutants [53]. Due to the large surface area of AgNPs (29.3 m2.g−1), AgNPs have high photocatalytic activity, which is attributed to the fact that increasing the number of surface activation sites available and thus enable the efficient transport of photogenerated electron–hole pairs to the adsorbed species. Besides, AgNPs are penetrated by the visible-light radiation and absorb more photons, consequently producing electron–hole pairs on the surface, leading to direct and indirect oxidation of phenol [54]. On the surface of AgNPs, hydroxyl ions (OH) and hydroxyl radicals OH are generated when phenol molecules contact water as a result of the indirect oxidation of water molecules. At the same time, OH can attack the phenyl ring, which immediately opens to produce muconic acid. Following the degradation process, releasing CO2 and H2O, formic acid and oxalic acid are formed as final mineralization products. The hypochromic effect broadens and shifts the absorption profile from 270 nm to a bit of 265 nm, indicating the formation of muconic acid [55]. Otherwise, molecular oxygen can scavenge photogenerated conduction band \(\left({e}_{cb}^{-}\right)\) electrons to form superoxide anion radicals \(({O}_{2}^{.-})\). This reaction would provide an additional pathway to degrade phenol molecules. Again water react with \(({O}_{2}^{.-})\) to generate H2O2 and OH ions. Following the generation scenario, H2O2 broken by the \(\left({e}_{cb}^{-}\right)\) to OH (radical) and OH (ions), which react with \(\left({h}_{vb}^{+}\right)\) to stimulate additional •OH radicals. As a result, essential \(\left({O}_{2}^{.-}\right)\) and OH combined with \(\left({h}_{vb}^{+}\right)\) are highly active species and responsible for repeatedly attacking organic contaminants, and easy photodegradation can attain [56]. Many of the end products of phenol degradation are short-chain organic acids like acetic, formic, and oxalic acid [57]. Nevertheless, some of the most identified intermediates are benzoquinone, along with phenol, 2-chloro-2-nitro-trimethylphosphine oxide, 4-ethylbenzoic acid, succinic acid, and hexadecanoic acid [58].

3.5.2 Photoreduction of 2,4 dinitroaniline (2,4 DNA)

The effect of catalyst dose

Figure 7 (a–c) shows the effect of different doses of AgNPs (3, 5, 7 mg) on the removal efficiency of 2,4 DNA at a constant time of 30 min. As can be seen from the data, raising the AgNPs catalyst dosage from 3 to 5 to 7 mg increases the removal performance from 60.7 to 82.72%, respectively. Meanwhile, the removal efficiency of 2,4 DNA is sharply increased to 97.6% (Fig. 7d) upon increasing the dose of AgNPs to 7 mg.

Fig. 7
figure 7

Photoreduction of 2,4 DNA using (a) 3 mg, (b) 5 mg, and (c) 7 mg, (d) pseudo-first-order kinetic model of 2,4 DNA and their relative breakdown (%), and (e) fitting curve of kinetics

Therefore, it can be concluded that the excitation process improves as the catalytic dosage increases, providing more active sites with significant surface area besides the irradiation through the visible light and the effect of citric acid that can act as an extra reducing agent through flow rate addition. Therefore, it increases the number of hydroxyl radicals, improving the removal efficiency of 2,4 DNA [59]. The strength of the 2,4 DNA absorption peaks at 346 nm decreased significantly with increasing the irradiation time until it is wholly lost, with no intermediate.

Effect of citric acid concentration

Even though citric acid is weaker than other organic acids as formic, mandelic, and acetic acid, it has been widely utilized as a hole scavenger in addition to its chelating agent [60]. Various concentrations from working solution of 0.1 M citric acid; 4, 8, and 12 mL by flow rate to the total reaction medium. The catalyst and 2,4 DNA are used to demonstrate the effect of citric acid on removing 2,4 DNA, as shown in Fig. 8 (a–c). By increasing the concentration of citric acid from 4 to 12 mL, the removal efficiency of 2,4 DNA improves from 63.5 to 98.4%, depicting the efficiency of scavenging free radicals and antioxidant properties of citric acid, which provides sufficient conditions for rapid reduction of 2,4 DNA. Scheme 1 illustrates the simplistic mechanism for decomposition of 2,4 DNA. Also, the present results encourage comparing our green prepared AgNPs and other AgNPs catalysts that prepared from various wastes in the literature against the selected pollutants as interpreted in Table 5.

Fig. 8
figure 8

Photoreduction of 2,4 DNA using citric acid a 4 mL, b 6 mL, and c 8 mL, d degradation (%), and e fitting curve of 2,4 DNA kinetics data

Scheme 1
scheme 1

Photoreduction mechanism of 2,4 DNA

Table 5 Comparing current work and previous studies for AgNPs from wastes in photocatalytic activities against different pollutants

3.6 Antibacterial activity

It is well defined that bacterial infections cause the majority of the problems associated with infectious diseases, not only in terms of morbidity but also in medical costs [65, 66]. The overuse of antibiotics has been related to various problems, including bacterial resistance. Consequently, researchers aim to design a new way to reduce infectious diseases in developing and spreading [67].

Bioinspired AgNPs have been studied against many species of bacterial strains. Ciprofloxacin was selective against all bacteria studied, and the inhibition zone of the tested AgNPs against the microbial species is shown in Table 6 and Fig. 9.

Table 6 The inhibition zone by AgNPs and ciprofloxacin as standard antibiotics for gram-positive and Gram-negative bacteria
Fig. 9
figure 9

Antibacterial activity of AgNPs and ciprofloxacin standard antibiotics nominated bacteria with an inhibition zone of a P. aeruginosa, b S. aureus, c E. coli, d B. subtilis, and e possible pathway of AgNPs antibacterial effectiveness during attacking the bacteria

The results revealed that AgNPs are efficient against all utilized bacteria. It is also shown that P. aeruginosa is the most vulnerable to AgNPs, with a high percentage of inhibition zones of 50%, whereas B. subtilis has the lowest rate of inhibition zones, with 40% vs. 35% for the typical antibiotic at a concentration of 2 mg/L of the green synthesized AgNPs. As a result, human pathogenic bacteria were selected for testing the efficacy of AgNPs, and the resulted inhibition zone diameter, as shown in Fig. 9a, follows the order: P. aeruginosa > S. aureus > E. coli > B. subtilis.

Gram-positive bacteria’s thick cell wall with peptidoglycan layers (80 nm) enables AgNPs to penetrate more directly with the outer bacterial membrane than gram-negative bacteria’s lipopolysaccharides (1–3 mm in thick), which protect the cell surface [68]. The membrane of gram-positive bacteria ruptures and kills them due to the difference in bacterial cell wall structure [69, 70]. AgNPs’ antibacterial efficacy is attributable to their small size and high surface-to-volume ratio, allowing these nanoparticles to interact directly with bacterial membranes with minimal size (less than 25 nm). The cytoplasmic membrane is broken by direct contact of AgNPs with the bacterial cell wall. Various cytoplasmic biomolecules, such as proteins, carbohydrates, and amino acids, appear in the cytoplasm exposure after treatment with AgNPs. As reported in the antibacterial mechanistic is inferred that AgNPs promoted large cell wall pits that inactivate the respiratory chain due to membrane permeability [71]. Another common explanation for the mechanism is that the bacterial cell membrane’s electric potential is altered when AgNPs bind to carboxyl and phosphate groups, causing ion and molecule massive leakage and consequently cell death [72]. Also, the deterioration in bacteria’s cell wall is based on the interaction of AgNPs with DNA, enzymes, and proteins involved in the metabolic pathway of bacteria, causing significant metabolism to stop and death [73]. In our system, AgNPs are associated with triggering the activation of reactive oxygen species (ROS) abundance, leading to oxidative stress, lipid peroxidation, protein oxidation, and DNA damage [74]. Figure 9b is a simple diagram representing the possible pathway of AgNPs while tackling the cell wall of bacterial species.

3.7 Electrochemical capacitance

As known, an essential aspect in estimating a material’s electrochemical capacitance is the galvanostatic charge/discharge (GCD) calculation. The GCD curves for synthesized AgNPs electrodes of supercapacitors with current densities ranging from 0.56 to 3.80 Ag–1 are shown in Fig. 10a. As shown in Fig. 10b, the Nyquist plot of the synthesized AgNPs electrode demonstrates a medium semicircle with acceptable Rct (781) in the high-frequency zone and ESR of 1.2 in the low-frequency zone. As shown in Fig. 10c, the specific capacitance of the synthesized AgNPs electrode was high, with an estimated value of 280 Fg−1 at a current density of 0.56 Ag−1, which is better than other references using a high molar ratio of aqueous electrolyte (Table 7). Electrochemical impedance spectroscopy (EIS) measurements were employed to assess the device’s electrochemical behavior.

Fig. 10
figure 10

GCD of synthesized AgNPs at a specific current from 0.56 to 3.80 Ag−1 (a), Nyquist plots of synthesized AgNPs developed with 1 M Na2SO4 (b), the calculated Csp and η% at a specific current from 0.56 to 3.80 Ag−1 for synthesized AgNPs (c), and the capacitance retention for synthesized AgNPs (d)

Table 7 Some previous work and electrochemical performance for nanostructured composites electrodes

In assessing supercapacitor electrodes, long cycle life is a necessary requirement. After 1000 cycles, the charge–discharge rate and capacitance of the synthesized AgNPs electrode showed minimal degradation, with 94.8% capacitance retention.

4 Conclusions

Given the promising efficiency and eco-benign nature of biogenic synthesis, the waste extract (coffee waste extract (CWE)) was successfully used to fabricate AgNPs under ambient conditions within a short reaction time and one-step procedure. There is a quick and environmentally friendly method for preparing silver nanoparticles meaning the whole procedure was conducted in distilled water with no use of hazardous reagents or organic solvents. CWE and CWE coated AgNPs were fully characterized by UV–vis, FTIR, XRD, and TEM SEM-EDAX techniques. HPLC depicted that CWE has many natural compounds available to reduce silver ions to nanoparticles, and hydroxyl-bearing compounds cap these nanoparticles and prevent them from agglomeration. The biogenic route furnished the hexagonal AgNPs in the nano range of less than 50 nm and crystalline. The biogenic AgNPs showed promising photocatalysts and an antibacterial agent for many infected microbes. The benign synthesis of AgNPs was further used as a catalyst for accelerating the removal of phenols in the presence of citric acid. It was depicted that AgNPs displayed higher catalytic activity and antibacterial features. Moreover, AgNPs can be conserved as photoreduction agents due to their efficient photoreduction of 2,4 dinitroaniline (2,4 DNA) with a short time. At 0.56 A g−1, AgNPs exhibited 280 F g−1 and showed cyclic stability 94.8% capacitance retention. As a result, the synthesis of AgNPs using CWE (useless wastes) is dependable, efficient, stable, scalable, reproducible, and appropriate for various areas.