1 Introduction

In the pursuit of environmentally friendly and sustainable solutions to the global energy crisis, the utilization of solar energy conversion to produce chemical fuels shows great potential [1]. The need for green energy sources becomes increasingly important as fossil fuel costs rise and evidence of global climate change caused by the emission of harmful greenhouse gases becomes apparent. Among the various alternative energy options, the photo-catalytic production of hydrogen using the solar spectrum has emerged as a highly favorable strategy due to its clean, cost-effective, and eco-friendly characteristics [2,3,4,5]. The use of semiconductor nanostructured materials, which possess adjustable band gaps and high exciton binding energy, is particularly attractive due to their exceptional properties and promising technological applications [6]. Since Fujishima and Honda’s initial demonstration of photo-electrochemical hydrogen generation, extensive research efforts have been dedicated to exploring the semiconductor photocatalytic evolution of hydrogen [7, 8].

Hydrogen, an environmentally friendly and valuable fuel in the fight against global warming, is a natural resource that cannot be directly utilized [9]. However, it can be generated through various methods using different sources, including biomass, nuclear, renewable and non-renewable resources, and raw materials such as water, coal, natural gas, and alcohols [10]. The primary form of hydrogen produced is referred to as “Gray hydrogen”, which is predominantly derived from natural gas and light hydrocarbons. However, its production process contributes to substantial carbon dioxide emissions [11]. In the chemical industry, four common technologies are employed to produce Gray hydrogen from fossil fuels: (i) steam reforming, (ii) partial oxidation, (iii) dry reforming, and (iv) gasification. Steam reforming involves the conversion of hydrocarbons into a mixture of hydrogen, carbon dioxide, and carbon monoxide at high temperatures through an endothermic process [12].

Another issue confronting our planet is water pollution, particularly due to the release of hazardous and cancer-causing soluble organic pollutants by industries such as tanneries, paper and pulp, pharmaceuticals, and the textile industry [13, 14]. Therefore, it is essential to eliminate these contaminants prior to discharging wastewater into the environment. The limitations of conventional methods for treating wastewater arise from their inefficiency, high costs, or the generation of additional pollutants [15]. Organic dyes, such as Bromophenol blue (4-PB) and Toluidine blue, pose a significant chemical risk as pollutants in our environment [16, 17]. These dyes have detrimental effects on both the natural environment and human well-being. 4-PB, a synthetic dye that is non-biodegradable and hazardous, is extensively utilized as a coloring agent, acid-base indicator, and in agarose gel electrophoresis [18]. Its release into water bodies contributes substantially to water pollution [19]. The presence of Bromophenols in the ecosystem has been associated with severe consequences due to their properties that can cause genetic damage, mutation, and cancer [18, 20]. On the other hand, Toluidine blue is a positively charged dye that belongs to the phenothiazine compound class. It is widely used in molecular biology as a marker for tissues rich in nucleic acid, as well as in the textile and medical industries as a catalyst in various reactions [17, 21].

In order to tackle the urgent concerns, catalysis technologies have been chosen as a solution to alleviate their adverse consequences [22]. The release of organic dyes into industrial wastewater stands out as a major cause of water pollution. Thus, it is crucial to identify an efficient approach for reducing these organic dyes, while selectively separating and recovering them in alignment with the principles of green chemistry [23, 24]. Achieving this necessitates the development of novel materials possessing optimized properties that strike a balance between eco-efficiency and performance, as well as considerations of processing, manufacturing, recyclability, and cost-effectiveness [25]. Incorporating nanocomposites with core-shell nanostructures presents a promising opportunity to significantly enhance catalytic properties, thereby surpassing the limitations associated with monometallic catalysts [26].

The extensive adoption of nanoparticles can be attributed to their remarkable characteristics, which encompass optical, electrical, and catalytic properties, along with their notable high surface area-to-volume ratio [27, 28]. The integration of magnetic and plasmonic components in materials has sparked significant interest among researchers, with iron oxides like Fe3O4 or γ-Fe2O3 as the magnetic component and noble metals like gold (Au) and silver (Ag) as the plasmonic component [29]. These materials exhibit unique properties stemming from their magnetic and optical features, making them highly versatile for diverse applications in fields such as biomedicine, catalysis, optoelectronics, and biology [30, 31]. According to Abdullah et al. the inclusion of NiO–Fe3O4 nanoparticles led to improved adsorption effectiveness in the removal of harmful Pb (II) and Hg (II) ions [32].

In nanoparticle synthesis, there are generally two primary approaches: physical methods and chemical and biological methods. Nevertheless, the use of physical and chemical methods for this purpose has been linked to certain disadvantages, including elevated expenses, toxicity concerns, and environmental hazards [27, 33]. Consequently, scientists have been exploring the viability of biological methodologies in nanoparticle synthesis [34]. Biogenic sources, such as plants, actinomycetes, microorganisms, fungi, and algae, have been harnessed for the biological synthesis of nanoparticles. Recent research indicates that plant extracts, in particular, show promise as a sustainable and environmentally friendly alternative for the production of nanomaterials [35, 36]. Green approaches are widely considered appealing for the synthesis of transition metal nanoparticles in various applications. This is primarily due to their simplicity, cost-effectiveness, and utilization of renewable plant resources [37]. Additionally, plant extracts contain a diverse array of metabolites, such as polyphenols, which aid in the bioreduction of metal ions as well as providing stability and capping for the nanoparticles. Consequently, plant-based methods are favorable for the production of large-scale metal nanoparticles. Furthermore, nanoparticles derived from plants exhibit greater stability and more defined characteristics in terms of shape and size compared to traditional chemical methods [38]. Ocimum basilicum L. leaf extract was employed in the eco-friendly production of Fe3O4/NiO nanocomposite, serving both as a reducing agent and a stabilizer for the nanoparticles. This plant species, belonging to a group of medicinal and aromatic plants, holds significant economic importance globally. It has been traditionally used in folk medicine and finds various applications in foods and the pharmaceutical industry [39, 40].

The novelty of this study lies in the utilization of the aqueous extract of Ocimum basilicum leaves as a green synthesis method for producing the Fe3O4/NiO nanocomposite (Fe3O4/NiO NC). This approach offers an environmentally friendly and sustainable alternative to traditional synthesis methods, reducing the reliance on harsh chemicals and promoting the use of natural resources. Additionally, the comprehensive characterization of the synthesized nanocomposite, along with the evaluation of its catalytic activity for organic dye degradation and hydrogen evolution under visible light irradiation, contributes to the understanding of its unique properties and potential applications. The exploration of different concentrations of Fe3O4/NiO to determine optimal conditions further adds to the novelty of this study, providing valuable insights into maximizing the efficiency of hydrogen production. Overall, the combination of green synthesis, multifunctional nanocomposite, and efficient photocatalytic properties represents the distinctive novelty of this research (Scheme 1).

Scheme 1
scheme 1

Schematic representation of the synthesis process for Fe3O4/NiO nanocomposite

2 Materials and methods

2.1 Materials

Ocimum basilicum leaves were collected from Algeria. Ferric chloride (FeCl3, 99.9%) and Nickel (II) nitrate hexahydrate (Ni(NO3)2·6H2O, 99.99%) Sodium Hydroxide (NaOH, 97%) ethanol (C2H5OH, 95%), bromophenol (BrC6H4OH, 99%), toluidine blue (C15H16ClN3S, 80%), and Methylene Blue (C16H18ClN3S, 95%) was purchased from Sigma–Aldrich, Germany.

2.2 Leaf extract preparation

Ocimum basilicum leaves were collected from Annaba, in northern Algeria. The leaves were thoroughly washed multiple times to remove any associated debris and then crushed. Subsequently, 10 g of the crushed leaves were dissolved in 100 mL of distilled water and left at room temperature for 24 h. Finally, the resulting extract was filtered through filter paper and stored at 4 °C for subsequent experiments.

2.3 Biosynthesis of Fe3O4/NiO nanocomposite

To synthesize Fe3O4/NiO nanocomposites, a blend comprising 5 g of FeCl3 and 5 g of Ni(NO3)2,6H2O was mixed with a pre-prepared extract derived from Ocimum basilicum leaves. Subsequently, the resulting mixture was continuously stirred and heated at 70 °C for approximately 2 h. Throughout this process, increments of 2 M NaOH were gradually introduced to regulate the solution’s acidity until a noticeable color change was observed, signifying the formation of a brown precipitate. The separation of this precipitate was accomplished using a centrifuge operating at 3000 rpm for 5 min. After obtaining the precipitate, it underwent several rinses with distilled water (DW) to eliminate any impurities. Following this, the damp powder was dried by placing it in an oven at 80 °C overnight. The ultimate Fe3O4/NiO nanocomposite was achieved by subjecting the dried powder to annealing in an oven at 500 °C for 3 h. This annealing procedure played a crucial role in enabling the formation and stabilization of the targeted nanocomposite structure [41].

2.4 Characterization of Fe3O4/NiO nanocomposite

Various techniques were employed to examine the properties of the synthesized Fe3O4/NiO NC. The structural and chemical characteristics of the plant extract and the Fe3O4/NiO NC were investigated using Fourier transform infrared spectroscopy (FTIR) (Nicolet iS5 model). X-ray diffraction (XRD) (Benchtop model from Proto Manufacturing Company) was utilized to analyze the structural properties of the materials. The Scherrer formula, D = Kλ/(β cos θ), based on the full width at half maximum intensity (FWHM), was used to calculate the crystallite size of the samples [42].

In the formula, the letters ‘K’ and ‘D’ represent the form factor (0.9) and the crystallite size (0.15418 nm, CuK), respectively. FWHM refers to the full width at half maximum, and the diffraction angle is denoted by θ. Furthermore, scanning electron microscopy (SEM, JEOL JSM 840 A, Japan) was employed to examine the morphology and size of the materials. EDX analysis was utilized to acquire the elemental composition (EDX, JEOL, Japan). The optical characteristics of the Fe3O4 nanoparticles (NPs) and Fe3O4/NiO NC were further investigated using UV–Vis spectroscopy (SECOMAM 9600 model) in the 200–800 nm region.

2.5 Photocatalytic activity

The photocatalytic characteristics of Fe3O4/NiO NC were examined through the utilization of an aqueous solution containing methyl blue (MB), 4-bromophenol (4-BP), and toluidine blue (TB) dyes under sunlight irradiation. Solutions of 250 mL of MB, 4-BP, and TB, each with a concentration of 30 parts per million (PPM), were prepared separately. For the experiment, Pyrex beakers were filled with 3 mL of dye solutions, including MB, 4-BP, and TB, separately. Subsequently, each dye solution was individually mixed with 3 mg of Fe3O4/NiO NC. The impact of contact time was assessed by varying the time intervals (0, 20, 40, 60, 80, 100, 120, and 140 min). Subsequently, the Fe3O4/NiO NC were separated from the mixture via centrifugation, and the absorbance spectra of the MB, 4-BP, and TB dye solutions were measured using a UV–Vis spectrophotometer within the 200–800 nm range. The percentage of photodegradation for the MB, 4-BP, and TB dyes was calculated using the following equation:

$$\%Degradation= \frac{{A_{0} - A_{{\left( t \right)}} }}{{A_{0} }} \times 100~$$
(1)

where A0 and A(t) denote the initial absorbance and the absorbance over time of the dye, respectively.

2.6 Efficiency of dye photodegradation in subsequent cycles

To assess the stability and reusability of the photocatalyst, the photodegradation experiment was repeated five times. At the end of each run, the remaining photocatalyst nanoparticles were separated from the solution through centrifugation. Subsequently, the nanoparticles were washed with distilled water and dried for 8 h at 50 °C. In order to determine the optimal conditions for dye degradation using Fe3O4/NiO NC, 30 mL of TB dye solution (C = 30 PPM) was treated with 3 mg of the catalyst under sunlight irradiation. The effect of contact time on the degradation process was investigated, and it was found that the optimum duration for dye degradation using Fe3O4/NiO NC was 140 min. To assess any potential structural changes, XRD analysis was performed on the dried catalyst after the initial and final experiments.

2.7 Hydrogen evolution

This research aimed to investigate the efficiency of H2 evolution using Fe3O4/NiO NC material in a water-based medium. To facilitate the photocatalytic process, ethanol was used as a sacrificial substrate, which means it acted as a sacrificial agent to capture the electrons generated during the photocatalytic reaction. This sacrificial substrate played a crucial role in promoting charge separation, enhancing the overall efficiency of the process. In order to provide the necessary illumination for the photocatalytic reaction, visible light was employed. Specifically, light-emitting diodes (LEDs) with a wavelength of 420 nm were used (PLS-LED100, Beijing Perfect Light Technology Co., Ltd.). The light intensity was standardized at 0.1 W cm2 across all experimental procedures to ensure consistency and comparability of the results. The evaluation of H2 evolution performance was conducted within a closed gas circulation system. The photocatalyst powder, ranging from 0.1 to 0.7 g, was dispersed in a mixture consisting of 400 mL of pure water and 400 mL of ethanol (50% volume). This specific mixture was chosen to optimize the conditions for hydrogen production.

To ensure optimal incident photon flux, adjustments were made to the Xe lamp and gas system. The incident photon flux refers to the rate at which photons (light particles) strike the photocatalyst surface. It is an important factor in determining the efficiency of the photocatalytic reaction. The gas generated during the process, including the hydrogen produced, was analyzed using a gas chromatograph (Agilent-8860) equipped with a molecular TDX-01 sieve-column. The gas chromatograph allowed for accurate quantification and analysis of the generated gases. Argon was used as the carrier gas in the chromatograph. A graphical schematic of the hydrogen evolution process can be seen in Fig. 1, providing a visual representation of the experimental setup and process flow.

Fig. 1
figure 1

Graphical schematic of the hydrogen evolution process catalysed by Fe3O4@NiO NC

3 Resultant and discussion

3.1 UV–Vis spectroscopy and bandgap analysis

Figure 2 presents the UV-Vis absorption spectra of the Fe3O4/NiO NC, offering valuable insights into its optical properties.

Fig. 2
figure 2

a UV–Vis absorption spectra of Fe3O4/NiO NC, b Energy dependence of (αhv)1/2 for Fe3O4/NiO NC

In Fig. 2a, the absorption spectrum in the visible range exhibits a peak at λmax = 396.3 nm, indicating the nanocomposite’s ability to absorb light in the visible region. This suggests its potential for various optoelectronic applications. Additionally, the band gap energy of the Fe3O4/NiO NC was determined using the (αhν)1/2 versus energy function (eV) plot, as depicted in Fig. 2b. Analysis of the data yielded an estimated band gap energy of 2 eV.

The band gap energy is a critical parameter in characterizing the semiconductor behavior and optical properties of materials. The obtained value of the energy gap signifies that the nanocomposite possesses a suitable band gap for absorbing light in the visible range [43]. The observed absorption in the visible spectrum and the determined band gap energy validate the successful synthesis of the Fe3O4/NiO NC. The synthesized Fe3O4/NiO NC exhibits an observed band gap of 2 eV, despite the wider band gaps of its individual components, Nickel (II) oxide nanoparticles (NiO NPs) [43] and Iron (II, III) oxide nanoparticles (Fe3O4 NPs) [44]. This can be attributed to multiple factors, including interfacial effects, size confinement, and the unique characteristics of the green synthesis approach utilized during fabrication. This narrowed band gap holds promise for potential applications in various fields, such as optoelectronics and catalysis, where tailored band gaps are desirable [45].

3.2 XRD analysis

X-ray diffraction (XRD) analysis was carried out to investigate the crystallography and structure of Fe3O4/NiO NC. The XRD analysis revealed distinct diffraction peaks at specific 2θ positions, notably 30.36° and 57.51°, corresponding to the crystal planes (220) and (422), respectively. These findings indicate the presence of a cubic structure in the Fe3O4 nanoparticles, as per the standard pattern of Fe3O4 NPs (JCPDS.75-0449) (Fig. 3).

Fig. 3
figure 3

XRD patterns of Fe3O4/NiO NC showing diffraction peaks at specific 2θ angles

The XRD pattern also exhibited distinct peaks at 2θ equal to 37,25°, 43,28°, 62,88°, 75,42°, and 79,41°, which corresponded to the crystal planes (111), (200), (220), (311), and (222), respectively, as indicated by JCPDS.47-1049. This pattern corresponds to the cubic structure of NiO and provides strong evidence for the formation of Fe3O4/NiO NC. The obtained results indicate an average crystallite size of 25.7 nm for the Fe3O4/NiO NC, determined using the Scherrer formula.

3.3 FTIR analysis

Figure 4 presents the FT-IR (Fourier Transform Infrared) analyses conducted on Ocimum basilicum leaf extract and the synthesized Fe3O4/NiO NC. The FTIR spectrum of the Ocimum basilicum extract showed a peak at approximately 3401 cm−1, which can be attributed to the stretching mode of hydroxyl groups in phenols [20]. Similarly, the absorption peaks detected in the range of 3276 cm−1 in the spectrum of the Fe3O4/NiO NC can be ascribed to O–H stretching vibrations [46]. The peak observed around 2919 cm−1 is attributed to symmetric and asymmetric C–H stretching [47]. The observed peak at 1614 cm−1 is likely associated with the skeletal vibration of C=C [48]. Since the Fe3O4 nanoparticles were prepared in an aqueous solution, unreacted Fe and O atoms on the particle surface would bind with OHˉ and H+ ions, resulting in a high density of hydroxyl groups (–OH) on the surface [49, 50]. These hydroxyl groups can easily break and react with other positively charged species for surface functionalization. The absorption band at 509 cm−1 are associated with Ni–O vibration bond [51, 52], while the other peak at 768 cm−1 corresponds to C–H bending vibrations [53, 54].

Fig. 4
figure 4

FT-IR spectra of a Ocimum basilicum leaves extract, b Fe3O4/NiO NC

3.4 SEM analysis

To investigate the morphology and size distribution of Fe3O4/NiO NC, scanning electron microscopy (SEM) was utilized. The SEM image of Fe3O4/NiO NC is presented in Fig. 5a.

Fig. 5
figure 5

a Scanning electron microscopy (SEM) images and particle size of Fe3O4/NiO, b particle size diameter and c EDX pattern of Fe3O4/NiO NC

The results revealed that Fe3O4/NiO NC exhibits a spherical shape with slight agglomeration, which can be attributed to the interaction of functional groups present in the leaf extract used during the synthesis process. The average size distribution of Fe3O4 NPs is approximately 55 nm. The EDX profiles of the Fe3O4/NiO NC formation are illustrated in Fig. 5c. The analysis revealed the atomic levels of iron, nickel, and oxygen content to be 5.37%, 42.82%, and 51.81%, respectively. The disparity in Ni and Fe mass percentages in the Fe3O4/NiO nanocomposite may stem from incomplete reactions, differing precipitation rates, or sample heterogeneity. X-ray diffraction (XRD) characterization revealed 2:5 peaks Fe3O4/NiO, indicating that the precipitation rate of NiO was faster than Fe3O4. This observation suggests that Ni needed only one electron to be precipitated, while Fe3O4 required three electrons to first precipitate Fe2O3, which was then converted to Fe3O4 through reduction. These findings provide further insights into the synthesis process and highlight the importance of considering different factors that could influence the elemental distribution in the nanocomposite [55].

3.5 Photocatalytic evaluation

3.5.1 Photocatalytic degradation efficiency

Following the obtained findings, this investigation has validated the efficacy of the nanocomposite in both adsorption and photocatalysis for the decomposition of toluidine blue (TB), 4-bromophenol (4-BP), and methyl blue (MB) dyes under sunlight at ambient temperature (Fig. 6).

Fig. 6
figure 6

UV–Visible spectra of organic dyes and their Photodegradation efficiency versus reaction time: a, b 4-BP dye, c, d MB and e, f TB dye using Fe3O4/NiO

The absorption peaks of all the dyes used in the experiment gradually diminished over time without any alteration in the maximum absorption wavelength. As shown in Fig. 6a, c, and e, the UV–Vis analysis revealed absorption characteristics at λmax = 590 nm, 661 nm, and 630 nm for 4-BP, MB, and TB, respectively. The obtained results demonstrate the remarkable ability of Fe3O4/NiO NC to effectively degrade TB, 4-BP, and MB dyes, with degradation rates of 99.3%, 99.0%, and 95.0%, respectively, as depicted in Fig. 6b, d, and f. The degradation process was carried out over a 140-minute duration, employing a pseudo-first-order kinetic model (Eq. 2) [56]:

$$\text{ln}\left(\frac{C_t}{C_0}\right)=t\times k$$
(2)

In the equation, k represents the pseudo-first-order rate constant, and t denotes the irradiation time. Figure 7 illustrates the first-order kinetic plot of ln (Ct/C0) versus time, showcasing the degradation of 4-BP, MB, and TB dyes by the Fe3O4/NiO NC. The estimated rate constants for Fe3O4/NiO NC were approximately 0.035 min−1, 0.031 min−1, and 0.025 min−1 for TB, 4-PB, and MB, respectively.

Fig. 7
figure 7

First-order kinetic plot of \(\text{ln}\left(\frac{C_t}{C_0}\right)\) versus time of Fe3O4/NiO NC in the degradation of 4-BP, MB and TB dyes

The degradation percentage reflects the extent of degradation or removal of the target compounds or pollutants within a given timeframe. A higher degradation percentage indicates a more effective degradation process, implying a larger rate constant (K). Conversely, a lower degradation percentage corresponds to a lower rate constant, indicating a slower degradation process. Therefore, the degradation percentage and the rate constant are closely related, with higher degradation percentages generally associated with larger rate constants, signifying a more efficient degradation process. Conversely, lower degradation percentages correspond to lower rate constants, suggesting a less effective degradation process.

This study demonstrates the effectiveness of the green-synthesized Fe3O4/NiO NC as a highly efficient catalyst for the photodegradation of various dyes, outperforming previous catalysts (Table 1) in terms of degradation rates for TB, 4-BP, and MB. These findings have important implications for the development of eco-friendly and efficient wastewater treatment methods to remove organic pollutants from industrial effluents and contribute to environmental sustainability. Further research on the application of Fe3O4/NiO NC in larger-scale treatment processes is warranted to explore its potential for practical implementation in environmental remediation.

Table 1 Comparison of dye degradation performance with previous studies

3.5.2 Recycling performance

The Fe3O4/NiO NC photocatalyst’s recyclability is crucial for its effectiveness in water remediation applications. To evaluate its reusability, the photocatalyst was dried and employed in a second photocatalysis experiment under the same conditions as the initial cycle. The results of the photocatalyst’s recyclability over five consecutive cycles are presented in Fig. 8a. The data indicate that the Fe3O4/NiO NC photocatalyst demonstrated excellent efficacy and reusability in degrading toluidine blue (TB) dye. However, a slight decrease in photocatalytic activity was observed after five cycles, with degradation percentages of TB dropping from 99.3 to 97.1% (Fig. 8b). This decline could be attributed to catalyst loss during the washing and centrifugation steps as well as the adsorption of intermediate species generated during the photocatalysis process [61, 62]. Furthermore, Fig. 8c clearly demonstrates that the essential X-ray diffraction (XRD) peaks of the Fe3O4/NiO NC photocatalyst were maintained before and after photodegradation, as evidenced by the XRD data following five photocatalytic cycles. This suggests that the photocatalyst did not undergo any significant modifications that affected its diffraction peaks.

Fig. 8
figure 8

a Different cycles of TB degradation ratio (C0/C) vs. exposure time, b Reusability (degradation efficiency vs. number of cycles) under visible light irradiation. c XRD analysis of Fe3O4/NiO of pure and reused after 5th cycles

3.5.3 Mechanism of photocatalytic activity

Figure 9 depicts the proposed mechanism for the photocatalytic degradation of 4-bromophenol (4-BP), methyl blue (MB), and toluidine blue (TB) dyes utilizing Fe3O4/NiO NC under sunlight exposure.

Fig. 9
figure 9

Possible photocatalytic degradation mechanism of 4-BP, TB and MB dyes under sunlight irradiation using Fe3O4/NiO nanocomposite

Semiconductor nanoparticles, when exposed to oxygen or air, exhibit efficient removal of diverse organic pollutants. When activated by light (hν), the NiO-capped Fe3O4 nanoparticles generate electron-hole pairs, where the electrons (e¯) from the NiO lowest unoccupied molecular orbital (LUMO) level migrate to the Fe3O4 conduction band (CB), while the photoinduced holes (h+) transfer from the Fe3O4 valence band (VB) directly to the NiO highest occupied molecular orbital (HOMO) level. These photogenerated charge carriers (h+ and eˉ) initiate a series of photocatalytic intermediate reactions [63]. Water molecules are transformed into hydroxyl radicals (OH), and dissolved oxygen molecules produce superoxide anion radicals (O2), both of which are triggered by the photogenerated charge carriers [64]. The interaction between the photogenerated holes and O2 can lead to the formation of hydroperoxyl radicals (–OOH) and hydrogen peroxide (H2O2). Furthermore, organic pollutants adsorbed on the surface of the photocatalyst may undergo direct oxidation. Equations (3, 4, 5, 6, 7, 8 and 9) illustrate the potential processes involved in the photocatalytic degradation of dyes utilizing Fe3O4/NiO NC [65].

$${\text{Fe}}_{3} {\text{O}}_{4} + hv \to h_{{{\text{VB}}}}^{ + } + e_{{{\text{CB}}}}^{ - }$$
(3)

A superoxide radical anion is formed

$$e_{{CB}}^{ - } + {\text{O}}_{2} \to {\text{O}}_{2}^{{ \cdot - }}$$
(4)

Neutralization of OH– group into OH by the hole

$$h_{{\left( {{\text{VB}}} \right)}}^{ + } + {\text{H}}_{2} {\text{O}} \to {\text{H}}^{ + } + {\text{OH}}^{ - }$$
(5)
$${\text{H}}^{ + } + {\text{O}}_{2}^{{ \cdot - }} \to {\text{HO}}_{2}^{ \cdot }$$
(6)
$${\text{HO}}_{2}^{ \cdot } + {\text{HO}}_{2}^{ \cdot } \to {\text{H}}_{2} {\text{O}}_{2} + {\text{O}}_{2}$$
(7)
$${\text{H}}_{2} {\text{O}}_{2} + hv \to 2{\text{OH}}^{ \cdot }$$
(8)
$$4 - BP/TB/MB + {\text{OH}} \to degradation\,product + {\text{CO}}_{2} + {\text{H}}_{2} {\text{O}}$$
(9)

3.6 Hydrogen evolution

The Fe3O4/NiO NC that were synthesized were assessed for their photocatalytic capability in the process of water splitting, specifically under visible light conditions at room temperature. Figure 10 illustrates the evolution of hydrogen when Fe3O4/NiO was employed as a photocatalyst.

Fig. 10
figure 10

a Photocatalytic evolution of H2 using Fe3O4/NiO NC vs. irradiation time, b Hydrogen evaluation vs. concentration of Fe3O4/NiO NC

Additionally, the effectiveness of the green Fe3O4/NiO NC, prepared using varying concentrations (0.1, 0.2, 0.3, 0.4, 0.5, 0.6, and 0.7 g), demonstrates the capacity of the Ocimum basilicum leaves extract to serve as an efficient green template, facilitating the formation of nanoparticles possessing desirable physicochemical properties suitable for use as a photocatalyst. The production of H2 exhibited 933.9 µmol/g of H2 over an 8-hour period at a concentration of 0.7 g/L (Fig. 10b). The utilization of the green template promotes a more uniform and smaller particle size, which enhances the process of photocatalytic hydrogen generation [66]. Furthermore, the presence of residual hydroxides in the green Fe3O4/NiO nanoparticles promotes a greater availability of H+ ions for interaction with electrons, leading to the generation of H2 through the reaction [67]: OH + h+ → H+ + 1/2 O2.

Photocatalytic processes rely on the generation of charge carriers through exposure to light, enabling redox reactions with substances adsorbed on the surface of the photocatalyst [67, 68]. When illuminated, electrons from the valence band are excited by the conduction band, while the remaining holes remain in the valence band. These holes then oxidize water, resulting in the evolution of hydrogen (H+) and hydroxyl (OHˉ) ions [69]. The H+ ions can react with the conduction band electrons of Fe3O4/NiO to generate H2. Consequently, the Fe3O4/NiO NC photocatalyst synthesized using environmentally friendly methods has exhibited effective performance in the generation of solar-driven hydrogen.

The successful synthesis of green Fe3O4/NiO NC was attributed to the favorable potential of the valence band edge and the efficient action of holes in the water oxidation reaction. Table 2 presents a comparison of H2 evolution rate with previously reported studies. The green synthesis of Fe3O4/NiO NC using Ocimum basilicum leaves extract as a template demonstrated superior photocatalytic activity, achieving a higher hydrogen evolution rate (933.9 µmol/g) compared to other methods. This environmentally friendly approach utilizes low-cost and abundant materials, resulting in a more uniform and smaller particle size, enhancing the photocatalytic process. The nanocomposites exhibited effective performance under visible light conditions, with prolonged stability during an 8-hour irradiation time. These advantages make it a promising and economically viable option for solar-driven hydrogen generation, contributing to sustainable and efficient photocatalytic processes.

Table 2 Comparison of H2 evolution rate with previously reported studies

4 Conclusion

This study demonstrated the successful green synthesis of Fe3O4/NiO NC using the aqueous extract of Ocimum basilicum leaves as a sustainable and environmentally friendly alternative to traditional methods. The Fe3O4/NiO NC exhibited remarkable photocatalytic properties, showing efficient degradation of organic dyes, namely toluidine blue (TB), 4-bromophenol (4-BP), and methyl blue (MB), under sunlight irradiation. The nanocomposite displayed a high degradation rate for TB (99.3%), 4-BP (99.0%), and MB (95.0%), indicating its potential as an effective catalyst for water remediation. The synthesized Fe3O4/NiO NC possessed a narrow band gap energy of 2 eV, making it suitable for absorbing light in the visible range and thus, a promising candidate for optoelectronic applications. X-ray diffraction (XRD) analysis confirmed the formation of Fe3O4/NiO NC, showing distinct diffraction peaks characteristic of both Fe3O4 and NiO, with an average crystallite size of 25.7 nm. The Fe3O4/NiO NC demonstrated excellent recyclability, retaining its photocatalytic activity even after five consecutive cycles of dye degradation. This recyclability, coupled with the absence of significant structural modifications, further enhances its potential for practical application in water treatment processes. In addition to its remarkable photocatalytic capabilities, the Fe3O4/NiO NC also demonstrated efficient hydrogen evolution under visible light irradiation. The green synthesis approach using Ocimum basilicum leaves extract yielded nanoparticles with optimized physicochemical properties, resulting in the production of hydrogen at a rate of 933.9 µmol/g over an 8-hour period. This environmentally friendly hydrogen evolution process holds promise as a sustainable solution to the global energy crisis.

In summary, the utilization of Ocimum basilicum leaves extract for the green synthesis of Fe3O4/NiO NC presented a novel and efficient approach for producing a multifunctional nanocomposite with exceptional photocatalytic properties. The successful degradation of organic dyes and the generation of hydrogen underscore the potential applications of this nanocomposite in wastewater treatment and renewable energy production. This research contributes valuable insights into the development of green and sustainable materials for addressing urgent environmental challenges and advancing the pursuit of eco-friendly technologies for a greener and more sustainable future.