1 Introduction

Environmental pollution has become paramount attention in recent years [1], posing a threat to human life and causing ecological imbalance [2]. Pollution can come from industry effluents such as dyes [3]. In the garment, dyes are commonly used; most of our daily life products, such as clothes, drinks, food materials, homes, and even medication, are colored by dyes. They are categorized according to their composition, coloring properties, and solubility, and there are approximately 10,000 commercially synthetic dyes in the market [4]. Congo red, methylene blue, rhodamine-B, methyl orange, and other dyes are used as a colorant in processing on a wide scale. However, they are released into the water, posing severe health risks [5]. They can threaten our health and destroy the environment [6]; they are considered major pollutants in water [7, 8], making a foam-like layer on the water’s surface and preventing the passage of light and air, affecting aquatic life flora, and fauna. Therefore, wastewater treatments are imperative every day and necessary for human life.

Traditional biological treatment techniques are inadequate for removing chemical pollutants. Therefore, eco-friendly techniques become at this time urgently to clean and or remove harmful chemicals [9]. Therefore, green chemistry applies chemical methods, pathways, and methodologies that reduce or exclude the use or production of harmful feedstock, materials, byproducts, reagents, and solvents, among other things. Consequently, the primary goal of green chemistry is to reduce toxic chemical systems and materials, which are critical to the global economy, while still maintaining the high quality of life that we enjoy [10]. Many techniques are used to eliminate organic dyes, such as adsorption [11,12,13], electrocoagulation [14], Fenton-oxidation [15], advanced oxidation processes [16], electrochemical advanced oxidation processes [17], and membrane technology [18, 19]. Among these different technologies, the advanced oxidation process is one of the most demanding and emerging techniques that use nanocatalysis to convert toxic contaminants to non-toxic inorganic compounds such as CO2 and H2O in the presence of light [5].

Malachite green (MG) is a well-known organic dye containing the triphenylmethane group; it is used in coloring in industries. Due to its toxic effects, MG dye has attracted much attention from synthetic dye contaminants [20]. Its color has a detrimental influence on the reproductive and immune systems [21]. Moreover, MG dye has been used extensively by the agriculture industry and is widely used as a coloring agent in different industries. However, besides its extensive use in various industries, this dye is a controversial molecule as it is reported in fish or other aquatic animals, so it poses a high risk to the consumer, who uses foodstuff. MG dye is reported to have mutagenic and carcinogenic effects as well as an adverse effect on the reproductive system [22]. Photocatalysis, biological treatment, ultrafiltration, advanced oxidation processes, and the adsorption process have all been used to remove the MG dye [23,24,25]. However, there is still a lack of proper catalysts that perfectly remove the wastewater’s MG dye. Different nanocomposites, either in the form of powders or thin films [26,27,28,29,30,31], have been innovated to be used as photocatalysts. In this work, Co3O4/NiO nanocomposite was synthesized via the sol–gel method. Then, the synthesized nanocomposite was used as a catalyst for the remediation and degradation of MG dye through thermocatalysis and photocatalysis. As far as we know, this is the first time that the Co3O4/NiO nanocomposite has been used to degrade MG.

2 Experimental

2.1 Chemicals and reagents

Cobalt(II) chloride hexahydrate (CoCl2⋅6H2O), nickel(II) chloride hexahydrate (NiCl2⋅6H2O), and sodium hydroxide (NaOH) were acquired from Sigma-Aldrich (Sigma-Aldrich, Germany). MG dye was acquired from BDH chemicals ltd (BDH, UK). All the chemicals were used as they were without any further purification.

2.2 Synthesis of Co3O4/NiO nanocomposite

Co3O4/NiO nanocomposite was synthesized via the sol–gel method [32,33,34]. Briefly, NiCl2⋅6H2O and CoCl2⋅6H2O salts were thoroughly mixed in a stoichiometric amount and dissolved in distilled water in a 1 dm3 Erlenmeyer flask and agitated for 30 min without heating at room temperature (RT). Then, in a drop-by-drop process, one molar of sodium hydroxide solution was added to the blender until pH 10 was achieved. Then blender was warmed up to 70 °C for 7 h with continuous mixing on a magnetic stirrer hot plate. After that, the precipitate was washed several times with an ethanol–water mixture (1:4). The resultant paste was desiccated in an oven for 8 h at 50 °C. The dried cake was powdered and put in a furnace at 400 °C for six hours for activation. A simple presentation for the preparation of Co3O4/NiO nanocomposite is given in Scheme 1.

Scheme 1
scheme 1

General Scheme for the formulation of Co3O4/NiO nanocomposite

2.3 Characterization techniques

The synthesized Co3O4/NiO nanocomposite was characterized and studied by different spectroscopic and analytical techniques. The surface morphology and textural characteristics of Co3O4/NiO nanocomposite were studied on field-emission scanning electron microscopy (FESEM) model FEI Quanta 450 (FEI, USA). The elemental analysis and oxidation state of the Co3O4/NiO nanocomposite were determined on the X-ray photoelectron spectroscopy (XPS) model ESCALAB-250Xi (Thermo Scientific, UK). X-ray diffraction (XRD) was used to investigate the crystal structure and crustal phase of the synthesized Co3O4/NiO nanocomposite powder using an XRD machine model D8 ADVANCE (Bruker, USA) having a CuKα radiation wavelength source. Similarly, the thermal stability of the nanocatalyst was investigated through the thermogravimetric analyzer (TGA) model Pyris 1-TG (Perkin-Elmer, USA), and optical characteristics were achieved through UV–Vis spectrophotometer model UV 2800 (Wincom, China). The average pore volume, aperture size, and surface area were determined through N2 adsorption/desorption experiments, recorded on BET model JW-BK300 (JWGB, China). The proceeding of the MG dye degradation was inspected through ultraviolet/visible (UV–Vis) spectrophotometer model Evolution™ 350 UV–Vis (Thermo Scientific, USA).

2.4 Degradation of MG

The degradation investigation was executed in 50 mL of the beaker containing 30 mL of 0.05 mM MG dye mixture and 0.05 g of Co3O4/NiO nanocomposite. Firstly, we tested the effect of contact time, where 0.05 mM of 50 mL of MG dye was taken in a conical flask with 0.05 g of Co3O4/NiO nanocomposite at 313 K. Then, 5 mL of dye was sampled every 10 min, and the reaction proceeding was recorded on the UV–Vis spectrophotometer. It was detected that the rate of MG dye degradation was initially higher and decreased as the reaction progressed. The experiments were set to proceed for 120 min. Various concentrations of MG dye, i.e., 0.01 mM, 0.02 mM, 0.03 mM, and 0.04 mM, were investigated to examine the influence of the concentration under similar experimental conditions. The thermocatalysis of the MG dye solution was investigated at the temperature range of 278–313 K. Furthermore, the pH effect was tested in the presence of solar light. Similarly, the catalyst dosages were investigated using 0.01 g, 0.03 g, 0.05 g, 0.09 g, 0.1 g, and 0.5 g Co3O4/NiO nanocomposite. The free radical scavenger assay was performed using 0.05 mM of MG dye solution with 0.5 g of the Co3O4/NiO nanocomposite under the influence of solar light. All the experiments were carried out under visible light or solar light with continuous mixing. The degradation of MG was followed by decolorization that was performed through UV–Vis spectrophotometer. The following equation was used to compute the percent degradation of MG.

$$\mathrm{R}\text{.E. \%} =\frac{{\text{A}}_{0}{-{\text{A}}}_{\text{t}}}{{\text{A}}_{0}}$$
(1)

R.E. % stands for the percent removal efficiency. It stands for absorption assessment at time t (min), and A0 is the absorption assessment of the first original blend.

Likewise, the velocity constant (kapp) values were acquired from the pseudo-1st-order kinetic study as displayed by the following equation:

$${\text{ln}}\frac{{\text{C}}_{\text{t}}}{{\text{C}}_{0}}\text {=}\,{\text{k}}_{\text{app}}{\text{t}}\text{ } + \, {\text{C}}$$
(2)
$${t}_{1/2}= \frac{0.693}{k}$$
(3)

where C0 and Ct are the concentrations of the MG mixture at the start point and time t, respectively. Equation 3 indicates the half-life of pseudo first-order kinetics, where k indicates the rate constant value.

3 Results and discussion

3.1 Characterizations

3.1.1 FESEM

Figure 1a shows the image of FESEM at low resolution, representing the Co3O4/NiO nanocomposite framework. This image indicated that the Co3O4/NiO nanocomposite has nearly spherical shapes. Also, a mixture of individual particles and clusters can be seen in the low-resolution FESEM image; therefore, the FESEM image with high resolution was captured for the cluster and is shown in Fig. 1b. The high-resolution FESEM revealed that these clusters are aggregated small spherical particles. The aggregations of small particles create irregular larger particles with more pores (Fig. 1b). We estimated the synthesized Co3O4/NiO nanocomposite particle sizes; their distribution histograms are shown in Fig. 1c. The mean particle size was 52.82 \(\pm\) 17.73 nm.

Fig. 1
figure 1

FESEM results of Co3O4/NiO nanocomposite a low resolution b high resolution c particle size distribution histogram

3.1.2 XPS

The chemistry and the elemental composition of Co3O4/NiO nanocomposite were studied by using XPS. Figure 2a indicates the existence of C, Cl, Co, Na, Ni, and O elements with their binding energies. The elements of Cl and Na are residues of the reactant we used to synthesize the composite, while the presence of C is due to the carbon tape that we utilized as a substrate to perform the XPS examination. The XPS, Co 2p, Ni 2P, and O 1s peaks have been deconvoluted to understand more about the oxidation states. Figure 2b displays deconvoluted Co 2p that comprises two strong peaks, 2p3/2 and 2p1/2, at 780.9 and 796.36 eV, with their satellite (sat) peaks at 785.46 and 803.08 eV, indicating the presence of Co+2 and Co+3 in Co3O4 [34, 35]. Similarly, Fig. 2c displays the deconvoluted Ni 2p that shows two prominent peaks, 2p3/2 and 2p1/2, at 855.74 and 873.69 eV, with their sat peaks at 861.71 and 880.05 eV; proving the existence of NiO in the Co3O4/NiO nanocomposite. The binding energy of the O 1s state displays a peak, which belongs to the multiple oxygen interactions with Ni and Co in Co3O4/NiO nanocomposite. Figure 4d shows the O 1s deconvoluted into two peaks centered at 535.1 and 531.15 eV; these two peaks could correspond to the binding energy of the oxygen of Ni and Co, respectively. It can be observed that the peak Co–O is higher than the peak of Ni–O, reflecting the ratios of Co4O3 (67.7%) and NiO (32.3%) (see the XRD analysis results in Table 1).

Fig. 2
figure 2

XPS spectra of Co3O4/NiO nanocomposite a full range of XPS spectrum b Ni 2p c Co 2p d O 1s

Table 1 The crystal phase of the synthesized Co3O4/NiO nanocomposite sample with its lattice parameters and ratios achieved from the XRD study

3.1.3 XRD

The XRD models are usually utilized to analyze the crystallinity of the materials, identify their crystal phases, and estimate the crystallite sizes. XRD patterns of the prepared nickel oxide and cobalt oxide nanocomposite (Co3O4/NiO) are shown in Fig. 3a. The sample’s XRD pattern showed different peaks, which indicates a crystalline structure in the synthesized sample. Cards of the International Centre for Diffraction Data (ICDD) were used to characterize the RPD pattern, where the XRD pattern’s diffracted peaks coincided with the tricobalt tetraoxide (Co3O4) ICDD (PDF-2/Release 2011 RDB) card no. 01-074-1656 and nickel oxide (NiO) ICDD (PDF-2/Release 2011 RDB) card no. 01-078-4370. According to the ICDD card no. 01-074-1656, the peaks at positions of 31.68°, 44.46°, 55.53°, 59.16°, 65.27°, 73.80°, and 76.96° are associated with atoms planes that, respectively, have the Miller indices of (220), (400), (331), (422), (511), (440), (620), and (533) of the Co3O4 crystal structure. While according to the ICDD card no. 01-078-4370, the peaks at 2θ numerical values of 36.82°, 43.26°, 62.85°, 75.29°, and 78.69° are associated with the atoms planes that have the Miller indices of (101), (012), (104), (021), and (006), respectively, of the NiO crystal structure. The structural refinement was carried out in the XRD pattern using the Rietveld analysis. The B-spline function was applied to model the shapes of the diffraction peaks. The matching to the pdf cards manifested that the cobalt oxide phase is a cubic crystal system that has framework parameters a = b = c = 8.1004 Å with Fd\(\bar{3}\)m space group. In contrast, the nickel oxide phase is a trigonal crystal system that has lattice parameters a = b = 2.98261 Å and c = 7.28763 Å with R\(\bar{3}\)m space group. The XRD results, i.e., the presence of NiO and Co3O4 phases, agree with the XPS results. The crystal phase content of cobalt oxide and nickel oxide was estimated using reference intensity ratio (RIR), where they recorded 67.7 ± 17% and 32.3 ± 16%, respectively. Based on whole powder pattern fitting (WPPF), the average crystallite sizes of their phases were evaluated via Scherrer’s equation (Eq. 3) based on full width at half maximum calculated by whole powder pattern fitting (WPPF) [36].

Fig. 3
figure 3

Characterizations of synthesized Co3O4/NiO nanocomposite a XRD patterns b TG curve and its DTG curve c the optical band gap energy of Co3O4/NiO nanocomposite, the inset shows the UV–vis absorption spectrum d BET analysis of Co3O4/NiO nanocomposite

$$D{\text{ }} = \frac{{0.94\lambda }}{{\beta \cos \theta }}$$
(4)

where D is the grain size of the crystal phase; β is the full width at half maximum (FWHM) of the diffraction peak, θ is the angle of diffraction, and λ is the wavelength used in XRD (λ = 1.54 Å). The crystallite sizes were found to be 7.50 ± 3 nm and 7.93 ± 9 nm for cobalt and nickel oxides, respectively. Table 1 summarizes all achievement XRD results. The details of the performed XRD analysis were included in a separate file (Electronic Supplementary Materials).

3.1.4 TGA

The decomposition conduct of the synthesized Co3O4/NiO nanocomposite was investigated using TGA; Fig. 3b displays the TGA curve and its first derivative (DTG) in the temperature range 30–1000 °C. A total of 9.61% weight loss till 100 °C indicating the thermal stability of the synthesized catalyst. The TGA curve shows that the weight loss occurred in three steps and manifested as peaks in the DTG plot. The weight loss (1.29%) in the first step in the TGA curve in the range of 70–150 °C is due to the evaporation of the leftover water in the synthesized composite. The second step’s weight loss (5.31%) started from 120 to 750 °C; this step has slow decomposition, possibly due to the conversion of residual precursor nickel chloride to nickel oxide [37]. The weight loss (3.01%) in the third step happened after 750 °C up to 1000 °C in the TGA curve; this step could occur due to inspiring defects in the Co3O4/NiO nanocomposite, which could be associated with the oxygen loss, consolidating the oxygen vacancies formation [38]. The DTG curve manifested three prominent peaks corresponding to the TGA curve’s three steps. The first peak, centered at 114 °C, corresponds to the first step in the TGA step, which was referred to as the water’s evaporation. The second peak in the DTG centered at 712 °C, which corresponds to the second peak in the TGA curve, this peak could result from the oxidation of nickel chloride into nickel oxide [37]. The DTG third peak centered at 910 °C could be assigned to the oxygen vacancies formation in the prepared Co3O4/NiO nanocomposite [38].

3.1.5 UV–Vis

The UV–Vis spectrum of Co3O4/NiO nanocomposite was performed in the range of 200–800 nm; the recorded UV–Vis spectrum is exhibited in inset Fig. 3c. An absorption edge was noticed in the UV–Vis spectral range of 200–250 nm. The Co3O4/NiO nanocomposite’s optical bandwidth (Eg) was esteemed using the Tauc relation given by the following equation:

$$(\alpha h\upsilon )1/n{\mkern 1mu} = A(h\upsilon - E_{{\text{g}}} )$$
(5)

where α is the absorption coefficient, h is the Planck constant, υ is the photon frequency, and A is a constant. Here, n is an exponent, which depends on the material’s quantum selection rules; n = 1/2 designed for allowed direct electronic transition; n = 3/2 intended for direct forbidden transition; and n = 2 for indirect allowed electronic transition. The Co3O4/NiO nanocomposite was reported as an optical indirect energy band gap, Eg [39]. Figure 3c displays the Tauc plot of the Co3O4/NiO nanocomposite. The magnitude of Eg was estimated via extrapolation of linear regions of the plot of (αhυ)1/2 against hυ. The curve of (αhυ)1/2 revealed two linear regions with the two intercepts at 4.27 and 3.3 eV, suggesting two energies band gap that could be attributed to the two phases included in the nanocomposites, i.e., Co3O4 and NiO. The long linear portion of the curve of (αhυ)1/2 (line presented in red color) showed an intercept at 4.27 eV; this value could represent the energy band gap of the NiO phase because several studies [40,41,42,43] reported its energy band gap in the range of 3.6–4.47 eV, while the short portion of the curve of (αhυ)1/2 (line presented in wine color) showed intercept at 3.3 eV could belong to the Co3O4 phase because its energy band gap reported in several studies [44,45,46] as in the range of 1.29–3.65 eV, where the variations in the band gap values were referred to the quantum confinement effect resulting and grain size [44,45,46]. In final words, these results suggest that the 4.27 and 3.3 eV represent the values of the energy band gap of the NiO and Co3O4, respectively.

3.1.6 BET

The N2 adsorption–desorption experiment was performed at 77 K in an inert atmosphere of He gas. The Brunauer–Emmett–Teller (BET) experiments revealed a 27.4933 m2/g surface area and an average aperture size of 1.0098 nm. The total pore volume is 0.0784 mL/g, as shown in Fig. 3d. The excellent surface capacity and high aperture volume suggest the homogenous particle size of the Co3O4/NiO nanocomposite.

3.2 Catalyst activity

3.2.1 Thermocatalysis

Figure 4a shows the results of the thermocatalysis experiments achieved from 30 mL of 0.05 mM MG dye and 0.05 g of Co3O4/NiO nanocomposite at temperatures of 278 K, 293 K, 303 K, and 313 K proceed for 120 min. As evident from this figure, the highest percent degradation of MG was achieved at 313 K, which was 95.3% (Table 2) at 120 min, followed by 93.7% at 303 K, and the lowest at 278 K, which was 82.6%. The thermocatalysis experiments indicated that the rate of MG dye degradation upsurges with an upsurge in temperature. Thus, the highest velocity constant value was obtained at 313 K (2.37 × 10–2 min−1), while the lowest kapp value was obtained at 278 K (1.72 × 10–2 min−1). It seems that the photocatalyst is temperature dependent, and an increase in temperature will increase the rate of MG degradation. The increase in temperature will possibly decrease the activation energy for the MG degradation as well as decrease the HOMO–LUMO band gap of the catalyst. The kapp, R2, and percent degradation of MG dye are summarized in Table 2.

Fig. 4
figure 4

Catalyst activity of synthesized Co3O4/NiO nanocomposite on the degradation of MG dye a percent degradation value of MG dye obtained from thermocatalysis, photolysis, and photocatalysis experiment b ln(C/C0)–time relationship obtained from various thermocatalysis, photolysis and photocatalysis c percent degradation value of MG dye obtained from the initial concentration of MG dye d ln(C/C0)–time relationship obtained at different concentrations

Table 2 Temperature, kapp, percent degradation, and R2 numerical values of MG degradation by using thermocatalysis, photocatalysis, and photolysis and thermolysis experiments

3.2.2 Photolysis

Figure 4a also displays the results of the photolysis experiment achieved under the solar light without catalyst under the same condition mentioned above for the thermocatalysis at temperature 293. This experiment investigated the role of solar light only on the down gradation of MG aqueous solution. As presented in Fig. 4a and Table 2, only 57.6% of the MG dye was degraded in 120 min. This result suggested that solar light has a role in the degradation of MG dye. The kapp value was 3.95 × 10–3 min−1 (Table 2).

3.2.3 Photocatalysis

After completing thermocatalysis and photolysis experiments, the role of catalyst in the incidence of solar illumination was investigated in the down gradation of MG pigment. The catalyst has a predominant role in the degradation of MG dye in the company of Co3O4/NiO nanocomposite. As evident from Table 2 and Fig. 4a, the percent down gradation of MG dye was highest in the presence of solar light by using Co3O4/NiO nanocomposite. Approximately, 100% of the MG dye was degraded in 120 min with the kapp value of 3.95 \(\times\) 10–2 min−1. Approximately, 98% of the MG dye was degraded in 60 min, and onward the degradation was negligibly changing till 120 min as the dye was almost completely degraded. The photocatalysis results suggested that the Co3O4/NiO nanocomposite has a chief character in the degradation of MG dye under solar light illumination. The solar light provided photons that can easily promote the electrons between valance and conduction band, facilitating the degradation of MG dye. 30 mL of 0.05 mM of MG dye solution was treated with 0.3 g of the Co3O4/NiO nanocomposite in a complete dark condition at room temperature to know the adsorption potential of the catalyst. It was observed that only 10% of the MG dye was adsorbed in 1 h on Co3O4/NiO catalyst.

3.2.4 Thermolysis

The thermolysis is done in the absence of catalyst and in a complete dark reaction. The sample is heated in water bath at 293, 303, and 313 K. The superior catalyst activity was displayed by photocatalysis at 293 K with a kapp value of 3.95 \(\times\) 10–2 min−1 and lowest by thermolysis at 293 K with a kapp value of 1.60 \(\times\) 10–3 min−1, respectively. The shortest half-life was calculated for photocatalysis which was 17.54 min−1. We concluded this section that the highest degradation rate of MG dye was achieved with photocatalysis at room temperature.

3.2.5 Effect of concentration

Concentration optimization is a crucial step in the degradation of any pollutant. Figure 4c displays the MG degradation at different concentrations in the range of 0.01–0.05 mM. In this experiment, 0.05 g of Co3O4/NiO nanocomposite was used and illuminated in solar light for 70 min. As manifested in this figure and Table 3, the highest rate was observed when the concentration was low, but as we increased the concentration, the kapp decreased. For instance, the kapp value of 0.01 mM of the MG dye solution was higher (5.52 × 10–2 min−1); then, when the concentration of the MG in the solution was increased (0.05 mM), the kapp value decreased significantly (3.95 × 10–3 m−1). Approximately, 93.5% of MG dye was degraded during 70 min when the solution contained 0.01 mM of MG; however, at the same interval time, the solution’s degradation of 0.05 mM of MG was 71.3. The decline in the catalyst activity at 0.05 mM is due to the high transport of MG molecules to the active sites of the catalyst, as compared to the less transport of MG molecules in the case of 0.01 mM MG molecules. Thus, access to the active sites by MG molecules at high concentrations is difficult; therefore, the reaction rate at high concentrations declined.

Table 3 kapp, percent degradation, and R2 values of varied concentrations of MG at room temperature

3.2.6 Effect of pH

Various pH values were studied to investigate the effect of pH on the activity of the synthesized Co3O4/NiO nanocomposite while degrading the MG dye in solar light for 120 min. The pH below 7 was made by drop-wise addition of dilute HCl, and the pH above 7 was attuned via the addition of a dilute solution of NaOH. As manifested in Fig. 5a, the degradation of MG dye is higher in the basic medium while lowest in the acidic medium. As the acidic medium increases, the degradation of MG dye decreases. For instance, the MG degradation was approximately 89% at pH 2, while it was 99% at pH 8. As the photocatalysis occurs on the catalyst surface, therefore, the surface charge changes greatly with a change in pH, and thus, the performance of the photocatalyst is greatly dependent on the pH variation. The degradation rate is higher at the high pH of the MG dye solution (alkaline pH) because the negative surface will attract the positive MG dye.

Fig. 5
figure 5

Catalyst activity of synthesized Co3O4/NiO nanocomposite on the degradation of MG dye under a influence of pH b influence of adsorbent dose c different selected scavengers

3.2.7 Effect of adsorbent dose

This test was carried out at various adsorbent amounts of 0.03 g, 0.05 g, 0.09 g, 0.1 g, 0.2 g, and 0.5 g. Figure 5b shows the achieved results of MG degradation by using different amounts of the synthesized Co3O4/NiO. The obtained results indicated that the degradation process was increased with an increasing amount of the adsorbent dose. The highest degradation was observed with 0.5 g of the Co3O4/NiO catalyst compared to the low adsorbent dose. The degradation percentage was 99% at 0.5 g of the catalyst, while it decreased to approximately 91% when the adsorbent dose was 0.01 g. The adsorbent dose has a specific limit, and after that limit, the degradation remains constant [47]. At high adsorbent doses, the surface-active sites may be blocked, and the access of light to the active sites may decrease; therefore, the rate of degradation decreases.

3.2.8 Effect of scavengers

Free radical scavenging assay is one of the most critical studies in photocatalysis because it provides a suggested mechanistic pathway for the degradation of pollutants. For this purpose, we selected sugar, H2O2, EDTA, and methanol (CH3OH), which are hydroxyl free radicals (OH) and hole (h+) scavengers. As evident from Fig. 5c, EDTA, H2O2, and sugar predominantly suppress the catalyst activity, while CH3OH negatively impacts the Co3O4/NiO catalyst activity. Therefore, we can predict that ·OH free radicals are concerned with the chemical degradation of MG dye. The probable mechanism for the results shown in Fig. 5c is illustrated in the next section.

3.3 Probable mechanism

Free radicals play a crucial role in the degradation of organic pollutants. For instance, EDTA is a hole scavenger, and CH3OH is an ·OH free radical scavenger [48, 49]. The experiments revealed that adding methanol has a negligible effect on the degradation performance. In contrast, the H2O2 and sugar showed a significant effect on the degradation of MG dye. The degradation performance of Co3O4/NiO was 74% and 72% in the presence of H2O2 and sugar, respectively, while EDTA brought about approximately 88% degradation of MG dye. The degradation process of MG with Co3O4/NiO probably be proceeded through the following photocatalytic reactions as shown in Eqs. 512, where the h+ and ·O2 radicals are involved in the photocatalysis of MG dye in the presence of Co3O4/NiO nanocomposite. Electrons in the conduction band (CB) of the catalyst are eCB, while holes in the valence band (VB) are represented by h+VB. Thus, it is believed that Co3O4/NiO materials degraded the MG dye by generating O2 free radicals.

$${\text{Co}}_{{3}} {\text{O}}_{{4}} + hv \to {\text{Co}}_{{3}} {\text{O}}_{{3}} \left( {{\text{e}}^{ - }_{{{\text{CB}}}} + {\text{ h}}^{ + }_{{{\text{VB}}}} } \right)$$
(6)
$${\text{NiO}} + hv \to {\text{NiO}}\left( {{\text{e}}^{ - }_{{{\text{CB}}}} + {\text{ h}}^{ + }_{{{\text{VB}}}} } \right)$$
(7)
$${\text{O}}_{{2}} + {\text{aq}}\left( {{\text{e}}^{ - }_{{{\text{CB}}}} } \right) \to {^\cdot} {\text{O}}_{{2}}^{ - }$$
(8)
$${^\cdot} {\text{O}}^{{ - {2}}} + {\text{aq}}\left( {{\text{e}}^{ - }_{{{\text{CB}}}} } \right) + {\text{2H}}^{ + } \to^{ - } {\text{OH }} + {^\cdot} {\text{OH}}$$
(9)
$${^\cdot} {\text{O}}^{{ - {2}}} + {\text{ 3e}}^{ - }_{{{\text{CB}}}} + {\text{ 2H}}^{ + } \to {2}^{ - } {\text{OH}}$$
(10)
$${\text{H}}_{{2}} {\text{O}} + {\text{h}}^{ + }_{{{\text{VB}}}} \to {^\cdot} {\text{OH}} + {\text{H}}^{ + }$$
(11)
$$^{ - } {\text{OH}} + {\text{h}}^{ + }_{{{\text{VB}}}} \to {^\cdot} {\text{OH}}$$
(12)
$$ \cdot {\text{O}}_{{2}}^{ - } /{\text{ h}}^{ + }_{{{\text{VB}}}} + {\text{MG}} \to {\text{products}} $$
(13)

Under solar illumination, e and h+ are created in the CB and VB of both Co3O4 and NiO photocatalysts (Eqs. 5 and 6) [50]. The photoexcited electrons are shifted to water, represented in Eq. 3, which acts as electron recipient and transport vehicle in photocatalysis, inhabiting the rejoining of photogenerated electron–hole pairs. The photocatalysis process takes place on the exterior of the Co3O4/NiO photocatalyst in a watery medium. The nano character of the further catalyst upsurges the surface area of the catalyst. The electrons are transferred from the catalyst and rejoin with surface-adsosrbed oxygen to form ⋅−O2 (Eq. 7) [51], which rejoins with H+ to make ·OH free radical (Eq. 8). Equally, the photochemical reduction and photochemical oxidation beget hydroxyl free radical (·OH), which is accountable for the down gradation of MG. Simultaneously, the h+ is a highly oxidizing species [52]; h+ is in the VB of Co3O4 and can photo oxidize MG molecules [53, 54]. To be precise, those extremely energetic species react in chorus with MG molecules, ensuing in an effective photocatalysis (Eq. 12). The schematic mechanism is provided in Scheme 2.

Scheme 2
scheme 2

Probable mechanism of MG dye degradation by synthesized Co3O4/NiO nanocomposite

3.4 Recyclability of catalyst

The constancy and restoration of the catalyst were studied by consuming 30 mL of 0.05 mM MG dye, to which 50 mg of the catalyst was added. For each study, the catalyst was recovered and laundered with enough water. The recovered catalysts were reused without any treatment for the elimination of MG dye. This testing was repeated till seven consecutive successions, and each time the catalyst maintained the activity with more negligible loss of inactivity, as shown in Fig. 6

Fig. 6
figure 6

Recyclability of the Co3O4/NiO nanocomposite against MG dye

4 Conclusion

In the current study, Co3O4/NiO nanocomposite was synthesized as a catalyst through the sol–gel method and utilized to degrade MG dye. Different characterization techniques, such as FESEM, XPS, XRD, TGA, UV–Vis, and BET, were used to investigate the synthesized catalyst. Thermocatalysis from 278 K to 313 K, photolysis (solar light), and photocatalysis in solar light were carried out to degrade MG dye. Besides, the effects of pH, temperature, concentration scavenger, and catalyst amount were studied experimentally. The kapp values for MG degradation in photocatalysis were 3.95 × 10–2 min−1, which is higher than those of photolysis (3.95 × 10–3) and thermocatalysis (1.73 × 10–2). These results indicated that the Co3O4/NiO nanocomposite is superior to catalyst activity in solar light as compared to thermocatalysis and photolysis. The results also revealed that the Co3O4/NiO nanocomposite showed the best results in basic medium, low concentration, and high catalyst dosage. The MG degradation mechanism by Co3O4/NiO nanocomposite under solar light was illustrated via ·OH as free radicals. It can be concluded that the Co3O4/NiO nanocomposite can be used effectively to degrade other pollutants.