Introduction

As the human population grows, so does the demand for daily necessities, resulting in rapid industrial developments. Industrial growth has triggered environmental problems worldwide, including wastewater, one of the most encountered problems [1, 2]. The textile industry is the largest contributor to wastewater; approximately 10,000 dyes and pigments are produced globally each year. Natural and synthetic dyes are used in the textile industry, and approximately 20–30% of them are wasted during processing [3]. Water pollution is harmful to the environment because toxic water contains fertilizers, chlorinated solvents, and dyes that are difficult to decompose [1, 3,4,5].Photodegradation in the advanced oxidation process (AOP) is one environmentally friendly way to reduce the impact of water pollution [6]. There are many ways to treat wastewater with AOP. Photocatalysis is preferred due to its environmental friendliness, low toxicity, low cost, and antibacterial activity [7]. Furthermore, it also makes good use of solar energy to degrade wastewater via oxidation–reduction reactions [8, 9].

One of the promising photocatalytic materials is metal oxides, which have varied bandgaps, enhancing their sunlight absorption capability over a wide range, reducing charge recombination, and are also inexpensive, such as spinel ferrite [10]. Among the various spinel ferrites, cobalt ferrite (CoFe2O4) stands out due to its high magnetization yield, low cost-effectiveness, form versatility, chemical and mechanical stability, and low toxicity [11,12,13]. CoFe2O4 was employed as a photocatalyst for degrading organic contaminants because it has a low bandgap of 1.76 eV [14]. However, pure CoFe2O4 has a high electron and hole recombination rate, thus affecting the performance of the photocatalyst. To improve the photocatalytic performance of CoFe2O4 composite-based photocatalysts, a co-catalyst made of metal or polymer should be added via a Schottky junction, which is useful in forming charge spaces between two materials to aid in electron transport [15]. The electrons captured by the Schottky junction will be transferred from the semiconductor to the doped material, and the metal co-catalyst will prevent electrons from flowing back to the CoFe2O4, thereby suppressing the recombination of photogenerated electrons and holes [16, 17]. The performance of the photocatalyst CoFe2O4 with various composite materials based on several previous studies was reported [9, 18,19,20], wherein the composites could degrade dye pollutants up to 97.3%. Magnesium (Mg) is one such material that can be used as an alternative to improve the performance of CoFe2O4 composite-based photocatalysts. Mg has biodegradation and biocompatibility properties; when in the form of magnesium oxide, it has a wide band gap of about 7.8 eV [21].

Microwave, sol–gel, hydrothermal, thermal decomposition, and co-precipitation [22] are the methods used to synthesize cobalt ferrite materials. Because the composition, purity, homogeneity, particle size, and distribution of ferrite can be controlled, sol–gel synthesis is one of the most commonly used [23]. On the other hand, mechanical alloying is widely used for synthesized composites due to easily producing nanoscale alloys [24]. However, there are no reported references for the synthesis of CoFe2O4/Mg in two steps: the sol–gel method for CoFe2O4 and the simple mechanical alloying method. As a result, in this study, we used these two synthesized methods to create CoFe2O4/Mg composites with varying Mg concentrations, which we then used as photocatalysts material for degrading Congo red and methylene blue as textile waste models. X-ray diffraction (XRD), Fourier transform infrared (FTIR), and UV–visible (UV–vis) spectrophotometers were used to examine the photocatalyst material and degradation efficiency. In addition, the recyclability, XRD, and FTIR were used to analyze the stability of composite CoFe2O4/Mg in degrading Congo red and methylene blue.

Results and discussion

XRD

Figure 1(a) shows XRD spectra of CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg and for (b) zoom in diffraction peak at 34° to 39° to identify shifts diffraction peaks with additional Mg. The 30% Mg photocatalyst shifted to the lowest 2θ indicating enlarging d-spacing whereas the 50% Mg shifted to the highest 2θ indicating reducing d-spacing, as shown in two and three dimensions in Fig. 1(c). The two and three dimensions show how the atoms bonding together with oxide or bonding between CoFe2O4 and Mg atoms. The diffraction peaks of CoFe2O4 show diffraction peaks formed at 2θ: 18.14°, 30.13°, 35.48°, 37.09°, 43.09°, 53.56°, and 57.03° corresponding with crystal plane (hkl) is (111), (220), (311), (222), (400), (422), and (511), respectively. These results have been confirmed by the standard XRD pattern (space group Fd-3 m, JCPDS: 00–022-1086) [3, 9, 12]. The diffraction peaks of Mg at 2θ: 32.48°, 34.69°, 36.91° (MgO), 48.12°, and 57.36° for crystal plane: (100), (002), (101), (102), and (110), respectively [25, 26]. The formation of the Fe3O4 phase shows at 2θ 33.61 (JCPDS: 00-003-0863).

Figure 1
figure 1

(a) XRD spectra for CoFe2O4 (Mg 0%), Mg 50%, and 30% in the form of composite CoFe2O4/Mg and (b) zoom of diffraction peaks for 34° to 39° and for crystal structures when the Mg atoms attached to the surface of CoFe2O4 and for 2 and 3 dimensional of the crystal structure when the spectra shifted to the left (lowest diffraction degree) or to the right (higher diffraction degree).

The crystal orientations (110) of Mg and (511) of CoFe2O4 overlap, resulting in the formation of the composite CoFe2O4/Mg, indicating Mg has been successfully attached to the CoFe2O4 lattice [9]. Figure 1(b) also shows the diffraction peak intensities of CoFe2O4 decreased and experienced a shift in the diffraction peaks after adding Mg to the composite. The peak with the crystal orientation (311), which shifts to a lower angle, indicates Mg incorporation into the CoFe2O4 lattice [27]. The peak shifted to a higher angle at higher Mg concentrations due to substituting Mg2+ ions in cobalt ferrite particles [28].

Debye Scherrer is used for calculating the average crystallite size, which is as follows [8]:

$$D = \frac{K\lambda }{{\beta \cos \theta }}$$
(1)

where D denotes the crystallite size, K denotes the Scherrer constant is 0.9, \(\beta\) denotes the full width at half maximum and \(\lambda\) denotes the X-ray wavelength for the Cu source, which is 1.5406. The average crystallite size for CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg is 23.19 nm, 34.28 nm, and 27.08 nm, respectively. It appears that the average crystallite size for composite CoFe2O4/Mg decreases with increasing amount of Mg.

FTIR

Figure 2 shows FTIR spectra recorded in the wavenumber range 4000–350 cm–1, at wavenumber (v1) in the range 580–588 cm–1 was assigned metal–oxygen (M–O) vibrations at the tetrahedral site (M is Co, Mg, and Fe), and at wavenumber (v2) in the range 386–389 cm–1 correspond to the vibrational strain of metal–oxygen bonds at the octahedral site [10, 29]. The peak shift of the v1 and v2 absorption bands to higher wave numbers is proportional to the increase in Mg concentration [29, 30]. Wavenumbers 3442–3446 cm–1 and 1641–1647 cm–1 are associated with the stretching vibrations of O–H [10, 30]. The wavenumbers 1385 to 1485 cm–1 correspond to the H–O–H bond mode, while the wavenumbers 2357 to 2926 cm–1 correspond to the stretching vibrations of C–O [31]. Utilizing the Krames–Kronig (K–K) relation, quantitative analysis of FTIR spectra is used to determine optical properties, dielectric functions, and energy loss functions. This method is described in detail in our previously published papers. [31,32,33,34,35,36] The methods for determining optical properties in the form of refractive index (n) and extinction coefficient (k) are briefly repeated below [37]. With the Lambert principle, the transmittance T (%) spectra will be converted to absorbance A (%) and then reflectance (R (%)) [37, 38]:

$$A\left( \omega \right) = \log \frac{{I_{0} }}{I} = \log \frac{1}{T\left( \omega \right)} = 2 - \log \left( {T\left( \omega \right)\% } \right)$$
(2)
$$R\left( \omega \right) = 100 - \left[ {T\left( \omega \right) + A\left( \omega \right)} \right]$$
(3)
Figure 2
figure 2

FTIR spectra CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg (a) and the refractive index (n), extinction coefficient (k), dielectric function, and energy loss function (Im (-1 / ε)) (b).

The refractive index in the complex form is [36]:

$${\tilde{n}} \left( \omega \right) = n\left( \omega \right) + k\left( \omega \right)$$
(4)

where \(n\left(\omega \right)\) denotes the real part and \(k(\omega )\) denotes the imaginary part of the complex refractive index:

$$n\left( \omega \right) = \frac{1 - R\left( \omega \right)}{{1 + R\left( \omega \right) - 2\sqrt {R\left( \omega \right)} \cos \phi \left( \omega \right)}}$$
(5)
$$k\left( \omega \right) = \frac{{2\sqrt {R\left( \omega \right)} \sin \phi \left( \omega \right)}}{{1 + R\left( \omega \right) - 2\sqrt {R\left( w \right)} \cos \phi \left( \omega \right)}}$$
(6)

\(\phi (\omega )\) is the phase change calculated from the dispersion of the K–K relation:

$$\phi \left( \omega \right) = \frac{ - \omega }{\pi }\mathop \smallint \limits_{0}^{\infty } \frac{{\ln R\left( {\omega^{\prime}} \right) - \ln R\left( \omega \right)}}{{\omega^{^{\prime}2} - \omega^{2} }}d\omega$$
(7)

by the Maclaurin method, the phase change becomes:

$$\phi \left( {\omega_{j} } \right) = \frac{{4\omega_{j} }}{\pi }.\Delta \omega .\sum\nolimits_{i} {\frac{{\ln \left( {\sqrt {R\left( \omega \right)} } \right)}}{{\omega_{i}^{2} - \omega_{j}^{2} }}}$$
(8)

where \(\Delta \omega ={\omega }_{i+1}\pm {\omega }_{i}.\) When the wave number j is odd, then, i = 2,4,6,8, …, j−1, j + 1, and if the wave number j is even number then i = 1,3,5,7, …, j − 1, j + 1.

The optical properties in the form of n and k of CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg are depicted in Fig. 2 (b), along with the corresponding values of transversal optical phonon mode (TO) and LO for longitudinal in Table 1. The TO increases with increasing Mg from 30% Mg to 50% Mg, whereas the LO increases conversely. The distance between the two optical phonon vibration modes (Δ (LO–TO)) is shown in Table 1. As the concentration of Mg increases, the Δ(LO–TO) decreases, indicating that small metal–oxygen (M–O) vibrations affect the large vibration of H–O–H and C–O bonds or vice versa. Conversely, higher Δ (LO–TO) indicates that the covalent bonds in the material are stable and strong [39].

TABLE 1 Transverse optical (TO), mode optical longitudinal (LO) mode of phonon vibration and Δ (LO − TO).

As shown in Fig. 2, the imaginary part dielectric function (ε2) can be used to confirm the TO wavenumber position (b). Determining the dielectric function of the real part (ε1) and the imaginary part (ε2) [34]:

$$\varepsilon_{1} \left( \omega \right) = n^{2} \left( \omega \right) - k^{2} \left( \omega \right)$$
(9)
$$\varepsilon_{2} \left( \omega \right) = 2n\left( \omega \right)k\left( \omega \right)$$
(10)

The LO phonon vibration mode can be confirmed from the peak position of the energy loss function (Im (− 1/\({\upvarepsilon }_{1}\) (ω)) according to Fig. 2(b) from [34]:

$${\text{Im}} \left( { - \frac{1}{{\varepsilon_{1} \left( \omega \right)}}} \right) = \frac{{\left( {\varepsilon_{1} \left( \omega \right)} \right)}}{{\left( {\varepsilon_{1}^{2} \left( \omega \right) + \varepsilon_{2}^{2} \left( \omega \right)} \right)}}$$
(11)

Figure 2(b) demonstrates that the intensity of the Im (− 1/1) increases and becomes more distinct with increasing Mg in the composite, indicating that Mg was successfully incorporated into the atomic structure of CoFe2O4. [34, 40].

Band gap

The band gap was computed using the Kubelka–Munk equation [28, 41]:

$$\alpha hv = A\left( {hv - E_{{\text{g}}} } \right)^{1/2}$$
(12)

where Eg denotes the energy band gap, \(h\) denotes the plank constant, \(v\) denotes the frequency of light, A denotes the proportional constant, and \(\alpha\) denotes the absorption coefficient.

Figure 3(a) depicts the cutting results of the UV–vis absorption spectrum using Tauc’s plot method to determine the bandgap, as indicated by the intersection line at (\(\alpha hv\))2 = 0. CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg had respective bandgap values of 2.48 eV, 2.72 eV, and 2.94 eV. Due to the oxygen content in Fe3O4 binding with some of the Mg to form MgO, where MgO has a higher energy gap, the bandgap increases with increasing Mg concentration in the composite [21].

Figure 3
figure 3

(a) The band gap of CoFe2O4 (Mg 0%), 30% Mg, and 50% Mg (a) and UV–vis spectra of composite with 30% Mg and 50% Mg used congo red (CR) and methylene blue (MB) as a pollutant model. The band diagrams of CoFe2O4/Mg are attached (closed) to the conduction band (CB) to help transport electrons through the surface for reaction with O2 molecules. (b) Uv–vis spectra of CoFe2O4 for various irradiation time of CR for 30% Mg (1) and 50% Mg (3) and MB for 30% Mg (2) and 50% Mg (4).

Photocatalyst analysis of composites for degradation of textile dyes

Photocatalyst activity

Using CR and MB as model wastewater pollutants, the photocatalytic activity of composites containing 30% and 50% Mg was examined. Figure 3(b) depicts the UV–vis absorption spectra of dyes CR and MB irradiated for 15 min with visible light. CR has an absorbance value of 400–600 nm, while MB has an absorbance value of 200–400 nm. It can be observed that as the irradiation time increases, the absorbance of both CR and MB decreases. Maximum absorbance was observed for CR at 493 nm and MB at 290 nm.

Figure 4 and Table 2 depict the degradation of composite 30% Mg and 50% Mg for CR and MB dyes, respectively. The percentage of degradation calculated by [42]:

$$\% {\text{Degradation}} = \frac{{C_{{\text{o}}} - C}}{{C_{{\text{o}}} }} \times 100$$
(13)
Figure 4
figure 4

Degradation time vs. percentage of degradation (a) and the photocatalyst performance Ct/C0 in ln scale (b) and a linear scale for CR and MB of composites in this study for 30% Mg and 50%.

TABLE 2 Kinetic rate constants and the percentage of degradation of CR and MB for composite in this study.

where C denotes the final concentration and C0 denotes the initial concentration. CR exhibits greater photocatalytic degradation than MB, likely because CR is an anionic dye and MB is a cationic dye. When interacting with anionic dyes, the photocatalyst material for the less oxygenated group causes electrostatic attraction. The impact of electrostatic attraction is the enhancement of the photocatalyst material's adsorption capacity by [43]. CR degrades in 60 min, whereas MB degrades in 30 min. The composite containing 50% Mg exhibits greater photodegradation because increasing Mg concentration increases the active site on the photocatalyst’s surface, which plays a role in the photodegradation process [34]. This is also related to the fact that the average crystallite size of composite 50% Mg is smaller than that of 30% Mg, making it easier for charge carriers to participate in the photocatalytic process. For large crystallite size, the recombination of electrons and holes outside the barrier region will increase [40].

Kinetic rate constants of CR and MB were calculated using the pseudo-first-order reaction [35]:

$${\text{Ln}}\frac{{C_{{\text{o}}} }}{{C_{{\text{t}}} }} = k.t$$
(14)

where C0 denotes the initial concentration of the dye, Ct denotes the dye concentration at time t, k as the rate constant, and t denotes the time of the photodegradation process. The graphs of ln (C0/C) and (Ct/C0) versus degradation time are depicted in Figs. 3(b) and (c), respectively, with the corresponding values from Table 2 shown. The greater the k value, the greater the degradation.

The composite containing 50% Mg demonstrates the best photocatalyst performance in the degradation test using CR and MB. This confirms that Mg contributed to the suppression of electron and hole recombination [29, 34].

Photocatalyst mechanism

Due to the Schottky heterojunction of two different bandgaps, the photocatalyst mechanism for composites containing additional Mg may be possible. The Schottky heterojunction mechanism combines semiconductor and metallic materials that are useful for forming charge-free spaces between two materials. The unique s-scheme mechanism is responsible for efficiently dissociating spatial charges and maintaining high redox power [41, 44]. Light irradiates the photocatalyst material, which will excite the electron if the light energy is greater than or equal to the bandgap energy of the photocatalyst material. The high photo-carrier dissociation and photo-redox power for efficient pollutant elimination in water are associated with the spatial detachment of high-energetic carriers [45], the spatial disintegration and conservation of photo-carriers with high redox capacity, resulting in a significant improvement in photoactivity and stability [46,47,48,49]. The electron will possess the energy necessary to leap from the valence band (VB) to the conduction band (CB). The VB holes of CoFe2O4 contribute to forming hydroxide radicals (∙OH). The Mg CB electrons will contribute to forming superoxide radicals (∙O2). These hydroxide and superoxide radicals contribute to the degradation of CR and MB [15] dyes. The possible reactions are as follows [38, 50]:

$${\text{CoFe}}_{{2}} {\text{O}}_{{4}} /{\text{Mg}} + h {\text{CoFe}}_{{2}} {\text{O}}_{{4}} \left( {{\text{h}}^{ + } } \right) + {\text{Mg}}\left( {e^{ - } } \right)$$
$${\text{H}}_{{2}} {\text{O}} + {\text{CoFe}}_{{2}} {\text{O}}_{{4}} \left( {{\text{h}}^{ + } } \right) \to \cdot {\text{OH}} + {\text{H}}^{ + }$$
$${\text{O}}_{{2}} + {\text{Mg}}\left( {{\text{e}}^{ - } } \right) \to \cdot {\text{O}}_{{2}}^{ - }$$
$${\text{Congo}}\;{\text{red}}/{\text{methylene}}\;{\text{blue}} + \cdot {\text{OH}} \to {\text{degradable}}\;{\text{products}}$$
$${\text{Congo}}\;{\text{red}}/{\text{methylene}}\;{\text{blue}} + \cdot {\text{O}}_{{2}} \to {\text{degradable}}\;{\text{products}}$$

Figure 5 depicts the mechanism of the radical entering the MB and CR structures by continuously breaking bonds, with the final products being CO2 and H2O.

Figure 5
figure 5

Schematic illustration of radical atomic bond breaking of CR and MB with the final products being H2O and CO2.

The schematic diagram of photo-redox power for efficiently removing pollutants from wastewater depicts breaking CR and MB bonds until only H2O and CO2 bonds are left. The formation of ·O2and ·OHradicals can be used to deduce the charge transfer mechanism from the performance degradation depicted in Fig. 4(a). Upon forming the s-scheme heterojunction with close contact, ewould rapidly migrate from CoFe2O4 to Mg, establishing an internal electric field from CoFe2O4 to Mg and initiating band edge bending at the heterointerface [46, 47]. Metal or polymer as a co-catalyst in composite metal oxide-based materials was discovered to increase catalytic activity in the degradation reaction of organic dyes while producing hydrogen peroxide. When CR and MB bonds are broken in the medium, the catalytic activity is set to be exceptionally high.

The production of H2O2 from CO2 was dependent on the chemical reaction process. The number of hydrogen ions and electrons are two crucial parameters in chemical reaction processes, but the reaction process and product are still unknown. The following chemical reactions are possible for varying amounts of hydrogen ions and electrons:

$${\text{CO}}_{{2}} + {\text{2H}}^{ + } + {\text{2e}}^{ - } \left( {{\text{CB}}\;{\text{of}}\;{\text{CoFe}}_{{2}} {\text{O}}_{{4}} /{\text{Mg}}} \right) \to {\text{C}}^{{{2} + }} + {\text{H}}_{{2}} {\text{O}}_{{2}}$$
$${\text{CO}}_{{2}} + {\text{4H}}^{ + } + {\text{4e}}^{ - } \left( {{\text{CB}}\;{\text{of}}\;{\text{CoFe}}_{{2}} {\text{O}}_{{4}} /{\text{Mg}}} \right) \to {\text{CH}}_{{2}} + {\text{H}}_{{2}} {\text{O}}_{{2}}$$
$${\text{CO}}_{{2}} + {\text{6H}}^{ + } + {\text{6e}}^{ - } \left( {{\text{CB}}\;{\text{of}}\;{\text{CoFe}}_{{2}} {\text{O}}_{{4}} /{\text{Mg}}} \right) \to {\text{CH}}_{{4}} + {\text{H}}_{{2}} {\text{O}}_{{2}}$$
$${\text{CO}}_{{2}} + {\text{8H}}^{ + } + {\text{8e}}^{ - } \left( {{\text{CB}}\;{\text{of}}\;{\text{CoFe}}_{{2}} {\text{O}}_{{4}} /{\text{Mg}}} \right) \to {\text{CH}}_{{4}} + {\text{H}}_{{2}} + {\text{H}}_{{2}} {\text{O}}_{{2}}$$

There are numerous pathways to produce H2O2 with a photocatalyst system, but future research must focus on maintaining the chemical reaction and preventing other reactions from occurring after H2O2 is produced.

Reusability

Figure 6 illustrates the 50% Mg photocatalyst reused for five cycles as the basis for determining the photocatalytic efficiencies of CR and MB. After the five cycles, the degradation of CR reduced by 9.9%, while the degradation of MB reduced by up to 20.8%. According to Ref. [51], the decrease in cycle efficiency is likely due to the loss of photocatalyst mass during the washing process. Figure 7(a) depicts the XRD band diagram between Mg and CoFe2O4 and FTIR spectra of composites with 30% and 50% Mg before and after MB and CR degradation tests. The functional group derived from the FTIR spectra in Figure 7(b) is presented in Table 3. The XRD spectra in Figure 7(a) indicate that the intensity of the XRD spectra for 30% Mg decreases sharply after CR and MB are applied to the composite, whereas the XRD spectra for 50% Mg are almost identical before and after CR and MB are applied, indicating structural stability. Figure 7(b) depicts the band diagram between Mg and CoFe2O4 before degradation, which is represented by the same Fermi energy level (left), and during degradation when the electron at the VB has the energy to jump to the CB. The presence of Mg in the composite enables the electrons in the CB of CoFe2O4 to move to the CB of Mg, thereby preventing electron-hole recombination (right). The Fermi level of both Mg and CoFe2O4 increased close to the CB of CoFe2O4; this new Fermi level position acts as a trap and aids electron transport, leaving the surface state and reacting with O2 [36, 37]. Without recombination, the hole readily escapes the VB and reacts with H2O to produce radical atoms [36, 37]. The FTIR spectra depicted in Figure 7(c) and Table 3 reveal significant wavenumber position shifts from 0% Mg to composites with degraded CR and MB at 30% Mg but only minor shifts at 50% Mg. The chemical functional group is confirmed to be stable even after MR and CR degradation. This study demonstrates the future potential of new composite materials for textile industry wastewater treatment.

Figure 6
figure 6

Cycle degradation of (a) CR and (b) MB for composite with 50% Mg in this study.

Figure 7
figure 7

XRD spectra (a), schematic illustration of band diagrams between Mg and CoFe2O4 before degradation and after degradation (b), and FTIR spectra (c) for composites with 30% and 50% Mg before degradation compared with after degradation with CR and MB.

TABLE 3 The functional group derived from the FTIR spectra for comparison before degradation and after employing CR and MB to the composite for 30% Mg and 50% Mg in this study.

Figure 8 shows surface image of the composite (CoFe2O4)/(Mg) that indicates agglomeration between atoms of CoFe2O4 and Mg. The wide and solid surfaces will exhibit water-repellent and self-cleaning properties due to the preference for hydrophobic surfaces [52,53,54]. The solid surface may consist of Mg binding with Fe or Co through several oxide reactions from both metals to form FeCo–O–Mg, or it may consist of Fe–Mg or Mg–Co bonding with Fe or Co. The bonding formation affect to the electronic, electron density, and structural properties of composites [55,56,57].

Figure 8
figure 8

Surface Morphology of composite (a) SEM image of sample composite for 50% Mg and an enlarged view of the area pointed in the middle of the first line. (b) For 30% Mg, an enlarged view of the area is shown in the middle of the second line. In the last column is the EDS result that shows the atomic percentages of Mg, O, Fe, and Co element.

Conclusion

According to quantitative analysis using XRD spectra, an average crystal size of 23.19 nm for CoFe2O4 containing 0% Mg, 34.28 nm for CoFe2O4 containing 30% Mg, and 27.08 nm for CoFe2O4 containing 50% Mg were obtained. Analysis of the FTIR spectrum reveals the presence of H–O–H, O–H, C–O, and M–O (M is Co and Fe) bonds, and a greater shift in wavenumbers due to an increase in Mg indicates the formation of composite CoFe2O4/Mg. The distance between the two optical phonon vibrational modes Δ(LO–TO) decreases with increasing Mg concentration, suggesting that the Mg atom has successfully attached to the surface state of CoFe2O4. The Fermi level of Mg increased close to the CB of CoFe2O4 to act as a trap and aid in electron transport, facilitating a reaction with O2, while the hole at VB moved to facilitate the reaction with H2O to produce radical atoms. With increasing Mg, the recombination charge between the electron and hole decreases, resulting in a larger band gap. The photocatalyst degradation shows a maximum for composites with 50% Mg up to 97.80%, as well as a constant higher kinetic rate, whereas composites with 30% Mg show a maximum of 97.23%. Degradation of CR takes 60 min but only 30 min for MB. After five cycles, the reusability of the catalyst decreases by 9.9% for CR and by 20.8% for MB. The photocatalyst's efficiency demonstrates that the composite investigated in this study can potentially treat textile industry wastewater with high efficiency.

Materials and methods

Synthesis of CoFe2O4 powders

Using citric acid as an additive, cobalt ferrite powders were synthesized using the sol–gel method. In glass beakers, 20 mL of distilled water was used to dissolve 2.7 g of iron nitrate (loba chemie, 99%), 1 g of cobalt nitrate (Merck, 98%), and 2 g of citric acid. Co(NO3)2·6H2O: Fe(NO3)3·9H2O: C6H8O7 had respective molar ratios of 1:2:3. These were stirred with a magnetic stirrer at a constant speed of 200 rpm at a temperature of 95 °C for approximately 2 h until a gel formed. CoFe2O4 powder was produced by drying the gel solution at 110 °C for 24 h and calcining it at 800 °C for 6 h in a furnace.

Preparation CoFe2O4/Mg composite

The cobalt (Co) (Merck), Iron(II) trioxide (Fe2O3) (supplied by Sigma Aldrich with a particle size of 50–100 nm and an assay of 97%), and magnesium powder (Mg) were obtained from Merck. The binary compound powder in the form of CoFe2O4 composite was mixed using an MM400 Retsch type mixing machine (purchased in 2011; Serial Number: 121101082213) for 1 h at a frequency of 10 Hz, followed by the simultaneous addition of Mg to the composite CoFe2O4/Mg and frequency. The mass ratio between CoFe2O4 and Mg is 70:30 with 30% Mg in the sample and 50:50 with 50% Mg in the sample for the ratio 50:50.

Photocatalyst properties test

For the evaluation of the photocatalyst, two distinct pollutants were chosen: methylene blue (MB) and Congo red (CR) as the model pollutant wastewater textile. The MB solution was made by dissolving 40 ml of MB in 1000 ml of distilled water, and the CR solution was prepared in the same way. Each 100 ml of MB and CR solution was then transferred to a 250 ml beaker. A total of 0.3 g of sample was added to each contaminant solution, and the mixture was magnetically stirred. The photodegradation process was conducted under a 300-Watt halogen lamp and measured with a UV–vis spectrophotometer.

Reusability

CoFe2O4/Mg composite containing 50% Mg was tested for recycling because it has a faster kinetic rate. The 0.3 g was dissolved in 100 ml of CR and MB, respectively. The solution is irradiated with a halogen lamp light and stirred at a constant speed of 200 rpm. The CR solution was exposed to halogen light for 60 min, while the MB solution was exposed for 30 min. In the first cycle, the degradation solution is filtered and stored. The remaining catalyst in the solution was washed three times with distilled water and separated by centrifuging at 1500 rpm for five min and three times for five min. After that, the item was dried for 10 min at 80 °C. This process was repeated five times, after which the degradation solution was examined with a UV–vis spectrophotometer.

Material characterization

To determine the crystal structure of each sample, CoFe2O4/Mg composites were characterized using XRD ((Shimadzu 7000) with CuKα radiation (λ = 1.5405 Å = 0.154 nm) at a range angle of 20° ≤ 2θ ≤ 70° operating at 30 kV and 10 mA. Using a Shimadzu IR Prestige-21 FTIR Spectrophotometer, the bonds present in the sample before and after its use as a photocatalyst were determined by FTIR analysis. Characterization of UV–vis spectroscopy using the Shimadzu UV–vis spectrophotometer UV-1800 to determine the sample's absorption spectrum.