1 Introduction

The magnetic nanoparticles (MNPs) have attracted much consideration due to their rapid and easy separation, economic viability, reusability and recoverability [1,2,3]. These magnetic NPs may be composed of a series of materials such as metals like zinc and nickel, alloys like iron/palladium and metal oxides like alumina, zinc oxides [4], and ferrites [5]. Magnetic nanocomposite (MNCs) have a special place because of their inimitable chemical and physical properties and their possible uses in smart drug delivery [6,7,8], magnetic resonance imaging [9,10,11], electromagnetic compatibility [12], information storage [13], and tissue imaging [14].

Nickel ferrite (NiFe2O4) is a soft ferrite that exhibits inimitable properties such as high chemical stability, and excellent magnetic properties [15, 16], also NiFe2O4 NPs display low mass transfer resistance and large surface area [17]. Zinc oxide (ZnO) has unique characteristics, including large exciton binding energy (60 MeV), wide bandgap (3.37 eV), piezoelectric, non-toxicity, high photosensitivity physical–chemical stability, biocompatibility and pyroelectric properties [18,19,20]. To date, ZnO has been applied in the making of many nanocomposites, such as Zn-mineralized alginate nanocomposites [21], Zinc impregnated cellulose nanocomposites [22], Ni/ZnO nanocapsules [23], ZnO/SiO2 nanocomposites [24], etc. Varied methods including microemulsion [25], hydrothermal rout [26] precipitation [27] and sol–gel processes [28, 29] utilized for the synthesis of the nanostructure. Control shape and size of nanomaterials is the ultimate challenge in the production of nanomaterials. Among the above-mentioned methods, the sol–gel method supplying products with high purity, compounds uniform, high efficiency, low cast, high chemical reactivity is a more suitable method for the synthesis of the nanocomposite [30, 31].

The textile industry is one of the largest water consumers and producers of significant amounts of wastewater in the form of organic dyestuffs [32,33,34]. Azo dyes are aromatic and heterocyclic compounds that have their azo bond structure (N=N). Releasing these colors in the water reduces the transparency of water and reduces the amount of oxygen in water, which has a damaging effect on the growth and germination of plant species [35, 36]. Reactive dyes are widely used in dyeing linen and other cellulose-based fibers. About 120,000 tons of these dyes are used annually for dyeing more than 60% of cellulose fibers [37, 38]. Research on these dyes suggests the toxicity of these dyes with varying degrees of side effects [39, 40].

Recently, the use of natural gels in the synthesis of nanomaterials has been particularly important [41, 42]. Tragacanth gum (TG) is a carbohydrate biopolymer with high molecular weight. Iran and Turkey are the largest producer of TG [43, 44]. In this project, for the first time, NiFe2O4@ZnO MNCs were synthesized using TG and metals source by the green sol–gel method. The sample was characterized by FTIR, FESEM, EDX, VSM, TEM, and XRD. Photocatalytic activity of NiFe2O4@ZnO MNCs has been assessed for the removal of direct blue 129 (DB129) and reactive blue 21 (RB21) in the presence of light at a fairly short time. The chemical structure and properties of dyes are shown in Tables 1 and 2.

Table 1 Structure and properties of direct blue 129 dye
Table 2 Structure and properties of reactive blue 21 dye

2 Experimental

2.1 Materials

Reactive blue 21 and direct blue 129 were purchased from Merck. The Ni(NO3)2·6H2O, Fe(NO3)3·9H2O and Zn(NO3)3·9H2O were obtained from daijung (Korea).

2.2 Catalyst characterization

Phase identification of NiFe2O4@ZnO MNCs was characterized by X-ray powder diffraction (XRD) with a X’Pert PRO advanced diffractometer using Cu (Kα) radiation (wavelength: 1.5406 Å) in the range of 2θ from 10 to 80. The morphological properties and particle size of the sample were studied by using transmission electron microscopy (Philips CM30) and scanning electron microscope (Zeiss EVO 18, Germany). The composition of the NiFe2O4@ZnO MNCs was investigated with an energy dispersive X-ray spectrometer (EDX) coupled with the SEM. Optical properties was evaluated by a double beam UV–Vis absorption spectrophotometer (Analytical Jena-Specord 205, Germany). The infrared spectra (FTIR, Mattson, Unicam Ltd., Cambridge, UK) and vibrating sample magnetometer (VSM, Meghnatis Kavir Kashan Co., Kashan, Iran) were used to detect functional groups and investigate magnetic properties of the nanocomposite.

2.3 Synthesis of NiFe2O4 MNPs

For the synthesis of NiFe2O4 MNPs, firstly, 0.2 g of tragacanth gum (TG) was dissolved in 40 mL of deionized water and stirred for 80 min at 70 °C to obtain a TG solution. After that, 1 mmol of Ni(NO3)2·6H2O and 2 mmol of Fe(NO3)3·9H2O were poured to the TG solution. The sample was placed in a sand bath at 75 °C with continuous stirring until the formation of dry gel. Finally, the dry gel was calcined at 600 °C for 4 h.

2.4 Synthesis of NiFe2O4@ZnO MNCs

Foremost, the tragacanth gel solution was prepared according to the above method. Afterwards, as achieved NiFe2O4 (0.1 g) MNCs was poured to the TG solution, under ultrasonic irradiation (UR) for 5 min. Subsequent, Zn(CH3COO)2·2H2O (0.5 g) was dissolved in 3 mL of deionized water and added to the above solution under UR for 5 min, and then the mixture was placed in a sand bath at a fixed temperature of 75 °C. Stirring was continued for 12 h to achieve a dry gray gel. In the end, the dry gel was annealed at 500 °C for 4 h to obtain NiFe2O4@ZnO MNCs.

2.5 Photocatalytic dye degradation

The photocatalytic activity of the NiFe2O4@ZnO magnetic nanocomposite was surveyed using a fluorescent lamp (λ > 400 nm, 80 W, Parmis, Iran). The photocatalytic degradation of Direct blue 129 (DB129) and Reactive blue 21 (RB21) dyes were carried out by various doses of the sample in 50 mL solution of dyes. The NiFe2O4@ZnO MNCs were separated from solution applying a magnet, and the alteration on the absorbance at a λmax of dyes (606 nm for DB129 and 664 nm for RB21) were checked by UV–Vis spectrophotometer. The effect of the amount of NiFe2O4@ZnO MNCs on the photodegradation of dyes was evaluated by contacting 50 mL of dyes solution (20 mg/L) at room temperature for 60 min. Different values of NiFe2O4@ZnO MNCs (0.03, 0.04, 0.05 and 0.06 g for DB129) and (0.03, 0.05, 0.07 and 0.09 g for RB21) were used. The effect of initial dye concentration on the photodegradation of dyes was investigated. The NiFe2O4@ZnO MNCs (0.05 g for DB129 and 0.07 g for RB21) were added to 50 mL of various dye concentrations (10, 20, 30 and 40 mg/L). The effect of visible light irradiation on the removal of dyes was surveyed. The percentage of the photocatalytic degradation of dye was determinate from the following equation.

% degradation = (A0 − A)/A0 × 100, where A0 is the initial absorbance and A is the final absorbance, at λmax = 606 nm for DB129 and λmax = 664 nm for RB21.

3 Result and discussion

3.1 Characterization of NiFe2O4@ZnO MNCs

FTIR spectra was applied for the characterization of NiFe2O4@ZnO MNCs. The FT-IR spectrum of synthesized NiFe2O4@ZnO MNCs (Fig. 1) displayed the peak at 425.71 that can be related to the stretching vibration of the Zn-O bonding [45, 46]. It can be observed that the absorption bands at ν1 = 603.61 and ν2 = 445.48 cm−1 is assigned to the vibration M–O of tetrahedral and octahedral sites of spinel ferrite structure [46].

Fig. 1
figure 1

FT-IR spectrum of NiFe2O4@ZnO MNCs

Figure 2 shows the X-ray diffraction patterns for NiFe2O4@ZnO MNCs synthesized by TG and calcined at 500 °C for 4 h. As shown in Fig. 2, the characteristic diffraction peaks at 18.63°, 30.45°, 35.94°, 37.43°, 43.56°, 47.83°, 54.00°, 56.84° and 63.04° were observed for the NiFe2O4 NPs, which can be assigned to (111), (220), (311), (222), (400), (331), (422), (511) and (440) planes of the pure cubic spinel phase of NiFe2O4 (JCPDS card no.54–0964) respectively. Also XRD patterns of NiFe2O4@ZnO MNCs displays diffraction peaks at 32.09° (100), 34.70° (002), 36.55° (101), 47.83° (102), 56.84° (110), 63.04° (103), 66.70° (200), 68.19° (112), 69.24° (201) and 77.16° (202), which can be related to the hexagonal wurtzite phase of ZnO (JCPDS card no.79-0205). According to these results, X-ray diffraction pattern confirms the formation of NiFe2O4@ZnO magnetic nanocomposite. The crystallite size of NiFe2O4@ZnO MNCs was determinate from the full width at half maximum (FWHM) of the XRD patterns by the Scherer formula:

Fig. 2
figure 2

XRD pattern of NiFe2O4@ZnO MNCs

$${\text{D }}={\text{ }}0.{\text{9}}\lambda /\beta {\text{cos }}\theta$$

where D is the crystallite size (nm), λ is the X-ray wavelength of Cu Kα = 0.154 nm, β is the full width at half maximum of the peak, and θ is the Bragg angle [47]. We gained an average crystallite size of 19 nm for NiFe2O4@ZnO MNCs.

The particle size and morphology of NiFe2O4@ZnO MNCs, annealed at 500 °C for 4 h, has been evaluated by the FESEM analysis (Fig. 3). As it can be seen from Fig. 3, the morphology of NiFe2O4@ZnO MNCs has relatively uniform spherical shape in nano-size. To analyze the surface composition of NiFe2O4@ZnO MNCs, the EDX was performed. Figure 4 exhibits that the acquired NiFe2O4@ZnO MNCs contains Ni, Fe, Zn, and O.

Fig. 3
figure 3

SEM image of NiFe2O4@ZnO MNCs

Fig. 4
figure 4

EDX pattern of NiFe2O4@ZnO MNCs

The TEM image in Fig. 5 display morphology and particle size of the NiFe2O4@ZnO MNCs. As shown in Fig. 5, the NiFe2O4@ZnO MNCs morphology is spherical with an average particle size of about 35–45 nm.

Fig. 5
figure 5

TEM image of NiFe2O4@ZnO MNCs

The magnetic attributes of NiFe2O4@ZnO MNCs have been investigated by using vibrating sample magnetometer (VSM). As shown in Fig. 6, the amounts of the coercivity (Hc), saturation magnetization (Ms), and a remanence magnetization (Mr) are 150 Oe, 15.22 and 3.15 emu/g respectively.

Fig. 6
figure 6

VSM curve of NiFe2O4@ZnO MNCs

After identification, the present nanocomposite, its photocatalytic activity in degradation of organic dyes under visible light was investigated.

3.2 Effect of visible light irradiation on removal of dyes

The photocatalytic activities of nanocomposite for degradation of DB129 and RB21 dyes were studied under the following conditions; visible light only, magnetic nanocomposite under both light and dark. Figure 7 shows that without the adding of any catalyst, degradation was not observed. Also, removal of dye was performed in the presence of magnetic nanocomposite in dark condition that was achieved a maximum removal of 39% for DB129 and 25% for RB21, respectively. As seen in Fig. 7 in the presence of both magnetic nanocomposite and visible light, 98% of DB129 dye and 96% of RB21 dye were degraded at the duration of 60 min.

Fig. 7
figure 7

Effect of visible light irradiation on the removal of dyes (%). Reaction conditions: a DB129 = 20 mg/L, catalyst = 0.05 g, pH = natural and room temperature. b RB21 = 20 mg/L, catalyst = 0.07 g, pH = natural and room temperature

3.3 Effect of magnetic nanocomposite dosage

The effect of various amounts of magnetic nanocomposite (ranging from 0.03 to 0.06 g for DB129 and 0.03 to 0.09 g for RB21) on dye degradation was investigated at 20 mg/L of initial dye concentration and 60 min of visible light irradiation. According to Fig. 8, which illustrates the results of photocatalytic degradation using NiFe2O4@ZnO MNCs in a time of 60 min, the obtained optimized dosage is 0.05 g for DB129 and 0.07 g for RB21. As shown in Fig. 8, there is a reduced degradation by excessive increasing the concentration of magnetic nanocomposites, because in higher dosage of catalysts, light penetration decrement happens on the surface of them.

Fig. 8
figure 8

Effect of nanocomposite dosage on the removal of dyes (%). a DB129 = 20 mg/L, b RB21 = 20 mg/L

3.4 Effect of initial dye concentration

The effect of initial dye concentration on the degradation of dye was investigated on various initial dye concentration between 10 and 40 mg/L of dyes, at a constant photocatalyst dosage (0.05 g for DB129 and 0.07 g for RB21) within 60 min. According to Fig. 9. The photocatalytic degradation rate of dyes decreases by the raising of initial dye concentration. Higher dye concentration acts as a barrier to light transmission to reach to catalyst surface and consequently lowers activation of catalyst to set enough radicals free, which would be the possible reason for these observations.

Fig. 9
figure 9

Effect of initial concentration of dye on the decolorization efficiency (%). a DB129, amount of catalyst = 0.05 g and b RB21, amount of catalyst = 0.07 g

3.5 Degradation of organic dyes at different time

The efficiency assessment of NiFe2O4@ZnO MNCs as photocatalyst was examined in the range of 400–750 nm UV–Vis absorption spectra over a time range of 60 min during the decolorization of DB129 and RB21 dyes. NiFe2O4@ZnO MNCs photo degradation trend was studied by the UV–Vis absorption spectra at maximum peaks of 606 nm and 664 nm for DB129 and RB21, respectively, which is depicted in Fig. 10. The results demonstrate a significant decrement of absorption peak intensity of DB129 at 606 nm in 60 min time duration (Fig. 10a). Nearly 98% of DB129 can be degraded. According to the UV–Visible spectra of the RB21 aqueous solution in Fig. 10b, the absorption intensity at 664 nm decreases remarkably, which shows that 96% of degradation happens in only 60 min. These results indicate that the synthesized magnetic nanocomposite has considerable photocatalyst activity.

Fig. 10
figure 10

UV- Vis Spectra of dyes during the degradation Process by NiFe2O4@ZnO MNCs at various time intervals of a DB129 = 20 mg/L, catalyst = 0.05 g and b RB21 = 20 mg/L, catalyst = 0.07 g

3.6 Reuse of the photocatalyst

One of the key factors in practical applications is regeneration and reusability of a catalyst. To assess the catalytic activity of NiFe2O4@ZnO MNCs during degradation and reuse of catalyst, the photocatalytic degradation of DB129 and RB21 was studied after separate using a magnet and washed with distilled water and ethanol. As shown in Fig. 11. The photocatalytic activity of the magnetic nanocomposite does not decline after five times of reuse in dye degradation, displaying that this catalyst is very stable and cost-effective in removal contaminants.

Fig. 11
figure 11

Recyclability of NiFe2O4@ZnO MNCs

3.7 Proposed mechanism for the photodegradation of dye in the presence of NiFe2O4@ZnO MNCs

An expected mechanism for the photodegradation of dye in the presence of NiFe2O4@ZnO MNCs under visible light irradiation is displayed in Fig. 12. As shown in Fig. 12, the conduction band (CB) potential of ZnO is more positive than NiFe2O4 and valence band (VB) potential of NiFe2O4 is more negative than ZnO [48]. When the NiFe2O4@ZnO magnetic nanocomposite absorbs visible light, electrons are excited from the VB of ZnO and NiFe2O4 to the corresponding empty CBs, leaving holes with positive charge in VB. The photoelectrons (e) that photoproduced in NiFe2O4 surfaces transfer easily to ZnO CB due to the VB potential of NiFe2O4 is more negative than that of the ZnO. Also, some holes (H+) are rapidly transferred from ZnO to NiFe2O4 [49]. This transfer improved lifetime, and thus increases photocatalytic performance [50, 51]. The photo-generated electrons react with O2 contained in aqueous solution to yield active O2 will further react with H2O, forming free hydroxyl radical (OH.). In the end, hydroxyl radical attacks into contaminated molecules to be the simple compounds such as CO2 and H2O [52].

Fig. 12
figure 12

Proposed mechanism for the photodegradation of dye

4 Conclusion

In this project, we developed a simple, green and novel sol–gel method for the synthesis of NiFe2O4@ZnO magnetic nanocomposites by the natural gel. The XRD results of the nanocomposite showed the presence of both nickel ferrite and zinc oxide in the cubic and hexagonal phases, respectively. Also, FESEM and TEM results confirmed the synthesis of nanocomposite with the spherical shape in nanometer size. The application of this nanocomposite as a photocatalyst was appraised for the removal of direct blue 129 and reactive blue 21 dyes in water under visible light irradiation. It was indicated that the nanocomposite could degrade as high as 96% of the dyes. The results showed that NiFe2O4@ZnO MNCs maintained effective and could be used for at least five cycles without considerable reduction in the regeneration performance.