Introduction

Aquatic ecosystems are necessary for human beings’ survival, agricultural irrigation and animal production. The rapid industrialization growth and urbanization potential risks are associated with contaminated water increased tremendously owing to industrial effluents; organic dyes, heavy metals (lead, arsenic, mercury, cadmium), pesticides, fertilizers, halogens etc. Organic dyes have been observed as alarming sources for water contamination, cationic dye methylene blue (MB) is commonly used in numerous industries like textile, food processing, paint, paper, pharmaceutical, cosmetic and printing. The presence of MB in freshwater resources seriously deteriorates ecological systems and human health, such as vomiting, nausea, eye burns, cyanosis, jaundice, tissue necrosis and mental confusion etc., through inhalation, impact on food chain and drinking water. Additionally, water-born pathogens like Gram positive Staphylococcus aureus (S. aureus) and Gram-negative Escherichia coli (E. coli) cause nosocomial infection in humans. Therefore, worldwide challenge is to ensure clean water in the present scenario thus, the elimination of dyes from an aqueous medium is imperative and essential (Sharma et al. 2015; Zulfikar et al. 2020; Moosavi et al. 2020; Khan et al. 2014; Rafatullah et al. 2010; Moniri Javadhesari et al. 2019).

Even though various physiochemical methodologies, membrane separation, coagulation, adsorption, photo-oxidation, chemical oxidation and electrochemical processes have been documented to decompose organic pollutants from aqueous systems but some are expensive, high energy-consuming and produce secondary hazardous pollution. Thus, to promote existing technologies non-toxic and inexpensive semiconductor photocatalysis has received tremendous attention to control aqueous contaminants (Ikram et al. 2022a; Cheng et al. 2020). Photocatalysis depends on redox reactions caused by photoinduced electrons (e) and holes (h+) on the surface of the heterogeneous photocatalysts. Under this condition, several reactive oxygen species involving water and oxygen are generated because photocatalysts are used practically with water vapor under aerobic conditions. Reactive oxygen species (ROS) are the species to which oxygen converts with high reactivity like singlet oxygen (O2), superoxide anion radical (O2−), hydrogen peroxide (H2O2) and hydroxyl radical (OH). Later, these radicals cause to remove the organic pollutant (dye degradation) from contaminated water (Nosaka and Nosaka 2017; Taghizadeh et al. 2020).

Over the past few decades, nanoscience has proven to be an affordable, scalable and effective tool to synthesize nanomaterials used as photocatalysts and antibacterial to eliminate environmental pollutants. Numerous metal nanomaterials, including silver, gold, platinum, palladium etc., have been widely used as photocatalysts, resulting in high synthetic cost. Therefore, inexpensive metal oxides, zinc, copper, magnesium, nickel and titanium dioxide etc., have been extensively used for photocatalytic dye degradation due to their physicochemical properties; small size, high surface area, and controlled morphology (Nagaraju et al. 2016; Fatima et al. 2017; Ghazal et al. 2021).

One of the existing metal oxides, non-toxic and environmental friendly MgO gained considerable attention for multidimensional applications, photocatalyst, antibacterial, water decontamination, in solar cells and supercapacitors based on superior surface reactivity, chemical and thermal stability, wide energy band gap, low refractive index and dielectric constant (Chanu et al. 2020; Aziz and Karim 2019; Balakrishnan et al. 2020; Sutradhar et al. 2011). In addition, MgO NPs show excellent bactericidal potential because of their low volatility and high-temperature tolerant properties (Ammulu et al. 2021). Various synthesis routes; hydrothermal, sol–gel, laser vaporization, wet chemicals, microwave irradiations, and sonochemical, have been exploited to synthesize MgO nanostructures (Fouda et al. 2021). The eco-friendly and cost-efficient co-precipitation process permits modification in particle size distribution, morphology, agglomeration and surface area, all of which are influenced by pH, reaction temperature, reagent type and concentration. Furthermore, various shapes like lamellar hexagonal, needle, rod, and tube have been obtained by the co-precipitation method (Calderón et al. 2020). Conversely, photocatalytic efficiency is hindered by a wide-bandgap in the ultraviolet (UV) region, which limits the high recombination of photoinduced charge carriers (e–h+) under visible light. Additionally, weak adsorption property and a strong inclination to agglomeration also cause limitations of photocatalytic activity. Besides this, antibacterial activity is also limited, hindering the extensive application of MgO as abactericide (Zeng et al. 2020; Julkapli and Bagheri 2016; Cai et al. 2017).

To strengthen the properties of metal oxides according to requirements, several methods such as tuning, doping with carbon-based materials, polymers, other metals and nonmetals have been suggested to be a promising approach. Doping can significantly improve photocatalytic activity by reducing recombination probabilities of e and h+ (Chanu et al. 2020; Jorfi et al. 2018; Shaheen et al. 2021). Polymers including polyacrylic acid (PAA), polyvinyl alcohol (PVA), poly (methyl methacrylate), polyvinyl pyrrolidone (PVP), etc., have been widely used as dopants owing to low cost, ease of processing (Biswal et al. 2021; Rouabah et al. 2021; Bdewi et al. 2016). Organic polymers doped with inorganic nanomaterials have attracted significant concern to show enhanced properties. PAA exhibited a strong ability to remove heavy metal ions, organic dyes from wastewater, and possesses improved antibacterial properties due to the presence of carboxyl group (COOH). Moreover, PAA based-nanocomposites (PAA-TiO2) have been extensively applied in solar cells, wastewater treatment, protective covering and optical devices (Rouabah et al. 2021; Tang et al. 2020; Shaik et al. 2016). Moreover, various elements (gold, copper, nickel, iron, chromium, zirconium, silicon, cobalt) have been preferred as dopants for MgO nanomaterials to adjust their optical, electronic and morphological properties (Taşer et al. 2021). In this study, Ag was doped with MgO NPs to extend pholocatalytic activity and bactericidal potential because Ag has a negative influence on the growth of metal oxides, enhanced ROS generation and interaction among bacterial cells and nanostructures (Cai et al. 2017; Aydoghmish et al. 2019).

In view of the above, pristine and doped MgO NPs with various concentrations wt% of Ag (0.03 and 0.06) and fixed amount of PAA (0.06%) were synthesized using the co-precipitation process. These synthesized products were used as photocatalysts to decompose MB dye and as bactericides to kill E. coli and S. aureus using ager diffusion technique.

Experimental part

Materials

Poly (acrylic acid (C3H4O2))n, magnesium chloride hexahydrate (MgCl2.6H2O, 99%), sodium hydroxide (NaOH, 98%) and silver nitrate (AgNO3, 99.8%), obtained from Sigma Aldrich (Germany) were used.

Synthesis of MgO and Ag: PAA-MgO

0.5 M of MgCl2.6H2O was used to synthesize MgO NPs via co-precipitation method under vigorous stirring at 80 \(^\circ \)C for an hour. Afterwards, the required quantity of NaOH was added dropwise to adjust pH > 10, due to which nanostructures settled in the form of a precipitate. Later, these precipitates were centrifuged several times with deionized (DI) water at 7500 rpm, dried overnight at 150 \(^\circ \)C and crushed to get a fine powder. Similarly, to synthesize Ag: PAA-MgO NPs various amount of wt% Ag (0.03 and 0.06%) wt% and PAA (0.06%) were incorporated as illustrated in Fig. 1.

Fig. 1
figure 1

a Schematic illustration of Ag: PAA-MgO NPs synthesis, b chemical structure of reactants

Photocatalytic activity

The photocatalytic performance of pristine and doped MgO NPs was evaluated by MB dye decolorization. Initially, an aqueous solution of MB dye was prepared, and pH was adjusted using NaOH/H2SO4 solution to study dye degradation over pH 4–12. Subsequently, 10 mg photocatalysts were added in suspension under vigorous stirring in dark to ensure adsorption equilibrium between MB dye and photocatalysts. Later, solutions were exposed to a visible light source Hg lamp (400 W, 20 cm) for up to 120 min, and ~ 3 mL of irradiating suspension was periodically removed every 30 min to determine photocatalytic dye degradation through a UV–visible spectrophotometer. According to Beer–Lambert law, dye concentration is directly proportional to its absorbance monitored in the absorption band (λmax = 665 nm). The optimum MB dye absorbance was determined as a function of time intervals, and degradation (%) was calculated as:

$$ {\text{Degradation }}\% \, = \, \left( {C_{{\text{o}}} - C_{{\text{t}}} } \right)/C_{{\text{o}}} \, \times \, 100\% $$

where Co and Ct are MB concentrations before and after light irradiation.

Bactericidal evaluation

Agar based diffusion approach was exploited to evaluate bactericidal behaviour of pristine and doped MgO by inhibition zone measurement contrary to Gram-positive (S. aureus) and Gram-negative (E. coli) by swabbing 0.5 McFarland on mannitol salt agar and MacConkey (MSA and MA), respectively. Samples of sheep milk (mastitis-positive) were collected from local farms and veterinary clinics in Punjab, Pakistan, refined on 5% blood agar (SBA) and maturated at 37 °C for 24 h. To isolate S. aureus and E. coli, the cultured isolates were streaked in triplicate on MSA and MA. Under aseptic conditions, sterile cork borer was deployed for 6 mm diameter wells on the MSA and MA plates with different sample concentrations (0.5 and 1.0 mg/0.05 mL) of Ag: PAA-MgO (0:0–1, 0:0.06–1, 0.03:0, 0.06–1, 0.06:0.06–1) filled as minimum and maximum dose into each well correlated to DI water (0.055 mL) and ciprofloxacin (0.005 mg/0.05 mL) as positive and negative controls, correspondingly.

Materials characterization

The crystal structure and phase information of synthesized samples was determined through XRD with Cu Kα radiation (λ = 0.0154 nm and 2θ = 10°–70°). Chemical analysis and functional groups were undertaken using an FTIR spectrometer (4000–480 cm−1) Surface morphology and Interlayer spacing of prepared nanostructure were inspected through EDX spectrometer and HR-TEM JEOL JEM 2100F. UV–vis spectrophotometer (Genesys 10S) was employed to examine optical properties ranging from 210 to 450 nm.

Results and discussion

The phase purity and crystallinity of pristine and doped MgO NPs were analyzed through XRD in the 2θ = 10 − 70° range (Fig. 2a). Diffraction peaks at 18.7° (001), 38.0° (002), 51.2° (012), 59.0° (110) 62.5° (111) were attributed to a hexagonal phase of MgO NPs (JCPDS no 96–900-2349), and broadness of peaks indicated size reduction (Munusamy et al. 2020). Furthermore, peaks at 32.0° (111), 45.9° and 57.0° (221) corresponded to the cubic phase of MgO NPs (JCPDS no 01–076-1363). The monoclinic MgCO3 diffraction peak was revealed at 27° (-202) evidenced by (JCPDS no 00–020-0669). The addition of PAA resulted in the suppression of crystallization and peaks broadness due to its amorphous nature (Liew et al. 2016; Mantilaka et al. 2014). Furthermore, upon Ag doping, additional diffraction peaks at 29° (211) can be observed (JCPDS no 1–0856), and intensity decreases as the full width at half maximum (FWHM) increases which exhibits influence on crystallinity of MgO NPs. Meanwhile, peaks shifting towards smaller angles demonstrated inter-layer d-spacing increment (Cai et al. 2017). FTIR spectral analysis was performed to access functional groups observed in pristine and doped MgO NPs; corresponding spectra were plotted between 4000 and 500 cm−1 as elaborated in Fig. 2(b). Pristine MgO NPs spectrum revealed O–H stretching attributed to its hygroscopic nature, C–O stretching and Mg–O bending and stretching vibrations at 3699, 1450, 867 and 548 cm−1, respectively (Ikram et al. 2021; Tlili et al. 2021; Arshad et al. 2017). Moreover, upon PAA doping, adsorbed water molecules and surface O–H groups manifested their presence by a band with a large half-width at ∼3600–3000 cm−1 and an additional peak observed at 1395 cm−1 assigned to symmetric stretching of COO (Hu et al. 2015; Marasini et al. 2021). There was no notable shift in the transmittance spectra with Ag doping. The selected area diffraction (SAED) pattern was recorded by directing electron beams on NPs that revealed distinct diffraction rings, corresponding to the polycrystalline nature of MgO as illustrated in Fig. 2c–f (Das et al. 2018).

Fig. 2
figure 2

a XRD pattern, b FTIR spectra, cf SAED pattern of pristine and doped MgO NPs

The optical characteristics were evaluated using a UV–vis spectrophotometer in the wavelength range 200 − 700 nm. Consequently, MgO absorption bands observed at ~ 313 nm can be endorsed to oxygen vacancies F22+ center (Pathak et al. 2016). This optical absorption spectra of MgO NPs in the UV region indicated its smaller size (Ulwali et al. 2021). Moreover, absorption peaks of PAA wt% (0.06) and Ag (0.03 and 0.06%) doped MgO NPs were found around 328–341 nm. Results showed that upon doping absorption increases accompanied by redshift, suggesting morphological effects having several active sites or might be quantum confinement effect. Since MgO is a direct bandgap semiconductor, bandgap energy (Eg) values (3.96–3.63 eV) were determined by Tauc's equation, as depicted in Fig. 3.

Fig. 3
figure 3

a Absorption spectra, b band gap energy plot of pristine and doped MgO

The morphology of synthesized products was analyzed by TEM analysis as shown in Fig. 4a–d.

Fig. 4
figure 4

TEM microstructures of Ag (%): PAA (%)-MgO. a 0:0–1, b 0:0.06–1, c 0.03:0.06–1, d 0.06:0.06–1

The randomly oriented hexagonal structure of the control sample (MgO) is shown in Fig. 4a. The addition of PAA to MgO demonstrated network formation, overlapped to aggregated hexagonal NPs (Fig. 4b). This aggregation is represented by strong and dense collectives NPs, whilst the loosely joined NPs represent the agglomeration that may be broken by mechanical force. As the addition of polymer to NPs causes agglomeration/aggregation, leading to reduce the potential improvement in mechanical properties of NPs owing to the interfacial area restriction (Ashraf et al. 2018). Subsequently, incorporation of Ag into PAA-MgO showed agglomeration of a non-uniformly distributed polymer network with NPs, which increased gradually with an increasing amount of Ag (Fig. 4c, d).

The calculated d-spacing using Gatan software of synthesized product is represented in Fig. 5a–d. The doped free sample (MgO) has inter-layer spacing ∼ 0.17 nm (Fig. 5a), well-matched with XRD crystallographic plane (012). PAA doped MgO showed no noticeable change in calculated lattice spacing (Fig. 5b), confirming the overlapping of chain with MgO as stated earlier. The Ag addition to PAA-MgO shows a significant increase in d-spacing from ∼ 0.17 to 0.23 nm, indicating proper Ag doping in network-based NPs (Fig. 5c, d).

Fig. 5
figure 5

Inter planar spacing calculated from HR-TEM images of Ag (%): PAA (%)-MgO, a 0:0–1, b 0:0.06–1, c 0.03:0.06–1, d 0.06:0.06–1

The atomic arrangement of synthesized NPs was measured with mapping results which explained uniformly dispersed Ag, Cu, Ca, Na, Cl, Mg and O in higher doped specimens (Fig. 6a). To elucidate the elemental composition of synthesized NPs, energy-dispersive X-ray (EDX) spectrometry was employed (Fig. 6b–e). Mg, O and Cl peaks confirmed MgO preparation from MgCl2.6H2O precursor. Additionally, Na, Cu and Au peaks were assigned to NaOH solution for adjusting pH, copper grid and coating material to coat non-conductive samples, respectively (Alaizeri et al. 2021).

Fig. 6
figure 6

a Mapping of (0.06: 0.06–1) depicted all components distribution, be EDX of 0:0–1, 0:0.06–1, 0.03:0.06–1 and 0.06:0.06–1 respectively

The photocatalytic MB dye degradation with synthesized photocatalysts were shown 56.92, 65.20, 46.96 and 38.13% in neutral medium (pH = 7), 41.74, 37.21, 36.86 and 31.82% in acidic medium (pH = 4) and 59.69, 92.05, 93.37, 92.91% in basic medium (pH = 12) respectively (Fig. 7). Acquired results depicted synthesized NPs absorb light to generate electron–hole pair that can oxidize or reduce organic dye. The photodegradation rate depends upon electrostatic interaction among dye molecules and catalysts surface (Kong et al. 2010). The pH of the solution is a key factor for photocatalysis that influences the surface charge of dye molecules and catalysts. In an acidic medium, positively charged catalysts surface oppose cationic species adsorption. The surface becomes negatively charged between cationic dye and negatively charged catalyst in the basic medium due to strong electrostatic interaction. As MB is a cationic dye, alkaline pH favours its high degradation by negatively charged surface MgO catalyst while modest degradation in acidic medium (Ikram et al. 2022b; Gh et al. 2015). Later, with PAA doping, degradation efficiency increases based on carboxyl group (–COOH), which favours ionic, covalent, hydrogen bonding with NPs, ionization of –COOH depends on pH and ionic strength (Liew et al. 2016). Results suggested that the degradation efficiency of Ag: PAA-MgO was higher than pristine MgO NPs, and the highest photocatalytic activity was achieved by 0.03% Ag doping, this was because the degradation efficiency decreased as Ag concentration increased. Furthermore, Ag loading can occupy active sites on the MgO surface, thus, resisting oxygen adsorption (Cai et al. 2017). In addition, dye degradation rate reduces because the high-level concentration of materials causes particle aggregation, which significantly reduces active sites on catalyst surfaces (Alharthi et al. 2020).

Fig. 7
figure 7

Photocatalytic dye degradation (%) by Ag (%): PAA (%)-MgO in a neutral, b acidic and c basic medium

The photocatalytic dye degradation in an aqueous solution mainly takes place through photogenerated electron–hole (e–h+) pair, hydroxyl (OH) and superoxide (O2) radicals (Zheng et al. 2019). To determine the photocatalytic activity of MgO NPs and the influence of reactive species on MB dye degradation, the possible photocatalytic dye degradation mechanism was explained below (Shaheen et al. 2021). The photocatalytic activity of MgO NPs begins with photoexcitation of e from valence band (VB) to conduction band (CB), generating h+ in VB. The introduction of Ag and PAA to MgO decreased the Eg, so the photogenerated electrons in MgO can easily transfer towards lower CB of (PAA-MgO), similarly holes will move towards higher potential of PAA-MgO as shown in Fig. 8.

$$ {\text{MgO }} + {\text{ hv}} \to {\text{MgO }}({\text{e}}^{ - } + {\text{ h}}^{ + } ) $$
(1)
Fig. 8
figure 8

Schematic illustration of photocatalysis mechanism of pristine and doped MgO NPs

The photogenerated e reacts with dissolved molecular oxygen (O2) adsorbed on its surface, forming superoxide radical anions (O2).

$$ {\text{e}}^{ - } + {\text{ O}}_{{2}} \to {\text{O}}_{{2}}^{ \cdot - } $$
(2)

Furthermore, these O2•− radicals react with water (H2O) molecules and produce oxidizing agents like hydroperoxyl (H2O) and OH radicals, acting as reactive agents to degrade organic contaminants.

$$ {\text{O}}_{{2}}^{ \cdot - } + {\text{ H}}_{{2}} {\text{O}}^{ \cdot } \to {\text{HO}}_{{2}}^{ \cdot } + {\text{ OH}}^{ \cdot } $$
(3)

Simultaneously, photogenerated h+ in VB reacts with H2O and hydroxide anions (OH) to form highly active OH radical.

$$ {\text{h}}^{ + } + {\text{ H}}_{{2}} {\text{O}} \to {\text{OH}}^{ \cdot } + {\text{ H}}^{ + } $$
(4)
$$ {\text{h}}^{ + } + {\text{OH}}^{ - } \to {\text{OH}}^{ \cdot } $$
(5)

Hence, \({\text{O}}_{{2}}^{ \cdot - }\) and \({}^{ \cdot }{\text{OH}}\) radicals strongly oxidize organic contaminants into non-hazardous products (CO2, H2O, etc.).

$$ ({\text{O}}_{{2}}^{ \cdot - } ,{\text{ HO}}^{ \cdot } ) + {\text{Organic dye }}\left( {{\text{MB}}} \right) \to {\text{CO}}_{{2}} + {\text{H}}_{{2}} {\text{O}} $$
(6)

The bactericidal potential of pristine and doped MgO NPs was evaluated against S. aureus and E. coli using a well diffusion assay, as shown in Table 1. Significant inhibition regions were noticed as (1.55–5.15 mm), (2.10–10.05 mm) for E. coli and (0–11.60 mm), (1.30–16.75 mm) for S. aureus at a minimum and maximum concentrations, separately. Correspondingly, the results were compared using − ve control DI water (0 mm) and + ve control ciprofloxacin (11.25 mm) inhibition regions for E. coli and S. aureus. Results depicted MgO NPs superior bactericidal performance towards E. coli than S. aureus because the cell wall of E. coli consists of a primarily thin layer of peptidoglycan and outer membrane, but S. aureus bacteria consists of a thick layer of peptidoglycan (Tang and Lv 2014). Further, upon PAA doping, carboxylic and hydroxyl groups presence enhanced the ROS generation, facilitating Mg metal ions discharge and, consequently, bacterial cell death (Albalwi et al. 2021). Experimental results showed that PAA dopant improves the antibacterial activity of MgO towards S. aureus bacteria (Beyli et al. 2018). Furthermore, Ag doping exhibited more substantial bactericidal effects because Ag has a detrimental influence on metal oxides grain development, resulting in particle size reduction and increased contact among MgO NPs and bacterial cells [19].

Table 1 Antibacterial activity of Ag: PAA-MgO NPs (0:0–1, 0:0.06–1, 0.03:0.06–1, 0.06:0.06–1)

The bactericidal activity of MgO NPs against S.aureus (Gram-positive) and E.coli (Gram-negative) was performed. Gram-positive bacteria contain a dense protective peptidoglycan layer irrespective of the thin layer with the additional outer membrane of Gram-negative bacteria (Slavin et al. 2017), as illustrated in Fig. 9. The bactericidal potential is linked with ROS generation dependent upon factors including surface area, crystallinity, surface oxygen vacancies and diffusion capability (Karthik et al. 2019). The oxygen vacancies on MgO NPs surface adsorb O2 originated from bacteria reacting with e to generate O2•− radical, which further reacts with H2O to generate H2O2, and OH. However, due to excess ROS generation, enzymes cannot neutralize it, thus causing oxidative stress on bacterial cells leading to cell necrosis (Bhattacharya et al. 2021). Moreover, the positively charged surface of MgO NPs used as a potential antibacterial agent towards negatively charged bacterial cell membrane by electrostatic action, membrane distortion, cytoplasmic material leakage, DNA degradation, and proteins denaturation (Das et al. 2018; Li et al. 2022) (Fig. 9).

Fig. 9
figure 9

Schematic antibacterial mechanism expression of MgO NPs

Conclusion

In this study, different Ag concentrations and fixed amounts of PAA-MgO NPs (0:0–1, 0.0.06–1, 0.03:0.06–1 and 0.06:0.06–1) were synthesized via a simple co-precipitation process to determine antibacterial and photocatalytic activity. XRD pattern endorsed hexagonal and cubic structure of MgO, indicating a decrease in crystallinity by the incorporation of dopants. Meanwhile, Mg-O vibrations at 867 and 548 cm−1 and polycrystalline nature was affirmed using FTIR and SAED. HR-TEM and EDS studies confirmed hexagonal nanoparticles morphology of MgO, overlapping of polymer with MgO, and Ag doping increased agglomerations in PAA-MgO. The interplanar spacing increased gradually from 0.17 to 0.23 nm upon Ag doping, and no significant change was observed upon PPA doping, confirming the network overlapped with MgO. The elemental composition confirmed the presence of Mg, O, C and Ag. UV spectra revealed redshift upon doping led to gradual decrease in band gap energy from 3.96 to 3.63 eV. MB dye degradation (%) implies the enhanced visible-light-driven photocatalytic performance in the order Ag: PAA-MgO > PAA-MgO > MgO. The optimum dye degradation rate (93%) was observed for Ag: PAA-MgO. Furthermore, the bactericidal potential of prepared NPs was identified against S. aureus and E. coli bacteria, while upon doping, superior antibacterial activity towards S.aureus was observed gradually.