1 Introduction

Releasing organic dyes into the environment due to increased industrial activity is a major challenge and causes environmental problems and threatens aquatic life, the lives of humans, and other living beings [1]. This challenge has emphasized the need to prioritize water treatment and disinfection as a global problem. As a result, much research has been done on wastewater through different methods, including the photocatalysis approach [2]. Semiconductor photocatalyst is an ideal approach in solar energy applications that can utilize solar energy with simultaneous energy conversion and environmental remediation [3]. Up to now, much research has been conducted on photocatalyst semiconductor materials, including metal oxides and sulfides, for water purification. However, the most-studied metal oxide photocatalysts such as TiO2 and ZnO have typically too large bandgaps, limiting the light-harvesting to the ultraviolet region as a little part (~5%) of the solar spectrum [4,5,6,7]. Therefore, the investigation of new semiconductor materials with narrow bandgaps to harvest visible light (~45% of the solar spectrum) for water purification is attractive. Among various semiconductors, g-C3N4 is a metal-free organic material composed of abundant earth elements such as C, N (and some H impurities). Therefore, due to its good chemical stability and anti-photocorrosion, visible light response, rich surface functionality, rich electronic properties, high thermal stability, and hydrothermal stability, it is considered a potential candidate for photocatalytic applications [8,9,10,11]. However, g-C3N4 in photocatalytic applications is limited by the high recombination rate of generated electrons and holes. Various approaches, such as doping of non-metals, combining with different semiconductors, and controlling the morphologies, are efficient ways to enhance the photocatalytic activity [12,13,14,15]. Various nitrogen-rich precursors such as melamine, cyanamide, dicyandiamide, triazine, heptazine derivatives, urea, and thiourea have been used to synthesize g-C3N4 by pyrolysis [9, 14]. In this process, the C–N bond condenses and leads to the formation of two-dimensional, three-dimensional tri-s-triazine sheets connected by a tertiary amine. In this process, the C–N bond’s densification leads to forming a three-dimensional triazine sheet, which is connected by a third amine. Moreover, impurities prevent the formation of ideal g-C3N4 that only consists of carbon and nitride atoms [16,17,18]. However, controlling the precursor’s pyrolysis is a suggested strategy to manage the impurities and obtain g-C3N4 materials with acceptable purity. Due to the different reaction paths and condensation stages, the processing temperature will affect the concentration of impurities, the surface and pore structure, and optimize the photocatalyst’s performance [19, 20]. It is worth noting that different methods, including thermal polycondensation, have been used to produce this material so far. Production of carbon nitride using this method is preferable to multi-stage methods due to its simplicity and low cost. In addition, higher temperatures such as 700 °C have been reported less in the thermal method. Therefore, to synthesize this material, we intend to test a wide range of temperatures, including 700 degrees.

Here, g-C3N4 nanosheets are prepared by polycondensation of melamine at a wide range of temperatures (450, 500, 550, 600, 650, and 700 °C). The characterizations of prepared g-C3N4 photocatalysts are performed using XRD, FESEM, EDS., UV–Vis, and PL measurements.

In order to conduct a kinetic study, the photocatalytic degradation of MB is examined under solar radiation. Due to different heating temperatures, the results show significant differences in the crystal structure, optical properties, morphology, and photocatalytic performance of the prepared materials.

2 Materials and methods

2.1 Fabrication of g-C3N4

Melamine (≥ 99%) was purchased from Samchun and used without further purification. The g-C3N4 samples were prepared by thermal polycondensation of melamine. For each sample, 5 g of melamine was placed in an alumina crucible with a porcelain lid. Then it was transferred to an electric oven and heated to different temperatures, namely 450, 500, 550, 600, 650, and 700 °C. Especially for the synthesis of the sample at the temperature of 700 °C, the test was repeated about 7 times to prevent all the melamine from evaporating by choosing the appropriate lid that was suitably fitted to the crucible. The heating was in the air at a rate of 2 °C/min for 3 h, then cooled to room temperature. The collected materials were grounded into powders with a different yellowish color. The samples were named CN450, CN500, CN550, CN600, CN650, and CN700, according to their heating temperature. To evaluate the effect of heating rate on photocatalytic performance, CN650 was heated in three 2, 5, and 10 °C/min rates. A Schematic of the crucible containing melamine is shown in Fig. 1.

Fig. 1
figure 1

Schematic of a crucible with lid containing melamine in electric oven

2.2 Photocatalyst activity

The photocatalyst activity of obtained samples was evaluated by the degradation of the MB solution in natural sunlight. For each experiment, 50 mg of each sample was added to 100 ml of an aqueous MB solution (10 mg/L). The mixture is stirred for 30 min in the dark to achieve an adsorption–desorption equilibrium and to avoid errors in the initial adsorption effect. During irradiation, 3 ml aliquots of the solution were taken every 20 min. Finally, the MB concentration was estimated by recording the absorbance peak as a function of exposure time on a UV–Vis spectrophotometer.

2.3 Scavenger test

The active radical scavenger experiment for the CN550 sample was carried out via the same procedure as above to determine the reactive radical species that are responsible for efficient MB degradation under sunlight irradiation. The photocatalyst experiment was repeated by adding ascorbic acid (AA), ethylenediaminetetraacetic acid (EDTA), isopropanol (IPA), and dimethyl sulfoxide (DMSO) as scavengers to quench superoxide radical (O2), hole (h+), hydroxyl radical (OH), and electron (e) species, respectively. Therefore, the scavenger test was conducted by adding AA (0.1 mM), EDTA (0.2 mM), IPA (15 mM), and DMSO (10 mM) TO 100 mL of MB solution that contained 50 mg of g-C3N4 photocatalyst.

2.4 Characterization

The crystal structure of the g-C3N4 samples was analyzed by the X-ray diffraction pattern (analysis, X’Pert ProCu-Kα radiation, λ = 0.1540 nm). The morphology was observed with the ZEISS instrument (SIGMA VP) and an EDS spectrometer operating at a 15 to 20 kV voltage. FTIR spectroscopy was performed by an infrared spectrometer instrument (PerkinElmer-Spectrum Two). A UV–Visible spectrophotometer (Perkin-Elmer spectrometer) was used to analyze optical properties in the wavelength range of 300–900 nm. The light emission characteristics of g-C3N4 were investigated using a Perkin-Elmer spectrometer with a xenon lamp to record the light photoluminescence (PL) with an excitation wavelength of 320 nm at room temperature. The porosity characteristics of the samples were measured by using a BElSORP Mini tool (Microtrac Bel Corp) via analyzing nitrogen adsorption–desorption at 77 K. The specific surface area of the sample was measured using a BET method.

3 Results and discussion

3.1 Fabrication of g-C3N4 samples

The g-C3N4 samples were prepared through the thermal treatment of melamine. In the first stage, melamine was placed in a crucible, and the lid was put on. The lid is essential to prevent access to oxygen and keep an NH3-rich atmosphere inside the crucible during the thermal polycondensation. In simple conditions, the synthesis was performed in ambient without using any gas atmosphere. All samples were prepared at a thermal ramping rate of 2 °C/min. For evaluating the effect of the heating rate, the CN650 was prepared at two different rates of 5 and 10 °C/min. As shown in Fig. 2, the color of the CN450 sample appears white like melamine and remains unchanged. CN450, CN550, and CN600 have a light yellow color, and CN650 and CN700 look bony.

Fig. 2
figure 2

Photograph of prepared samples in different heating temperatures

3.2 XRD analysis

The phase structures of prepared g-C3N4 samples are characterized by XRD analysis. As depicted in Fig. 3a, the CN450 sample shows four peaks at 29.04°, 33.73°, 48.42°, and 57.50°, which change gradually to characteristic peaks of g-C3N4 (JCPDS No. 01-0646) [21]. By increasing the heating temperature to 500 °C, a new peak appears at 12.8°, the peak at 29.04° shifts to 27.52°, and others become weak. For the CN450 sample, the peak at 12.8°, which is indexed as (100) plane of g-C3N4, correlates with the interplanar distance of 0.688 nm [22] and was appeared for all samples except CN450.

Fig. 3
figure 3

a X-ray diffraction pattern of g-C3N4 at different heating temperatures. b By increasing in heating temperatures, peaks shift to higher angles

The intense peak at 27.52° corresponds to the interlayer stacking of conjugated aromatic units (002) similar to graphite. However, as shown in Fig. 3b, the (002) plane-related peaks shift to slightly higher diffracted angles by increasing the heating temperature, i.e., 27.86°, 27.88°, and 27.87° for exfoliated CN550, CN650, and CN700, respectively, and CN600 remains the same. In addition, as shown in Fig. 3b, the (002) peak intensity of almost all samples increased with increasing heating temperature, indicating effective exfoliation of the g-C3N4, in accordance with previous reports [23]. The crystallite size of 5 nm was calculated for CN700 using Scherrer formula at (002) peak.

3.3 Microscopic analysis

FESEM images of prepared samples at various temperatures are shown in Fig. 4. As it can be seen from Fig. 4a, an agglomerated irregular morphology was observed for CN450, which has blocks ranging from hundreds of nanometers to a few micrometers. The onset of flake formation can be seen in Fig. 4b, where some flake-like structures appear at the surface of the CN500 but still appear incomplete. A more organized crystalline morphology can be observed at 550 °C, and the size of the flakes increases significantly in the CN550 sample, as shown in Fig. 4c. As shown in Fig. 4d, at the process temperature of 600 °C, a structure similar to CN550 was observed. When the temperature rises to 650 °C, a flake-like structure was observed with a typical thickness of about 33 nm, as illustrated in Fig. 4e, which agrees with XRD results for layer exfoliation. Figure 4f shows a petal-like structure consisting of thin flakes attributed to the thermal treatment at a temperature of 600 °C. In principle, as the process temperature rises, a gradual transformation from bulk to layered morphology occurs. An increase in temperature will improve the layering process, so as the degree of condensation increases, the layer’s size will increase.

Fig. 4
figure 4

Surface FESEM images of g-C3N4 fabricated through thermal polycondensation of melamine at various temperatures: a 450 °C, b 500 °C, c 550 °C, d 600 °C, e 650 °C and f 700 °C

3.4 Porosity analysis

Figure 5 shows the nitrogen adsorption and desorption isotherms and the BJH pore size distribution of the selected CN500, CN600, and CN700 samples. The hysteresis loops of all samples match well with the characteristic hysteresis of type IV isotherms. According to the BDDT classification, these isotherms are typical characteristics of mesoporous materials. As shown in Table 1, the estimated BET surface areas of CN500, CN600, and CN700 samples increased from approximately 12 to 36 m2/g as the processing temperature increased. One possible mechanism for forming holes in g-C3N4 is to release NH3 during polycondensation, where a large amount of NH3 passes the packed melamine layer vertically to form g-C3N4 flakes (as observed for CN500). Porous materials with a larger surface area provide more sites for harvesting light photons and producing more electron–hole pairs. Therefore, CN700 sample with higher surface area and larger total pore volume is expected to exhibit the best photocatalytic performance.

Fig. 5
figure 5

Nitrogen adsorption and desorption isotherms of mesoporous CN500, CN600, and CN700

Table 1 Corresponding BET values of CN500, CN600, and CN700 samples

3.5 UV–Vis measurement

Optical properties, including the energy bandgap, can be evaluated by UV–Vis spectroscopy. These factors are affecting the photocatalytic performance of photocatalysts. The samples’ UV–Vis spectra at room temperature are depicted in Fig. 6 and show absorption in the visible region. The bandgap values of 2.95, 2.90, 2.60, 2.57, 2.52 and 2.50 eV were estimated for CN450, CN500, CN550, CN600, CN650, and CN700, respectively. These results indicate that as the process temperature increases, the edge of the optical band of the sample shifts at longer wavelengths and its bandgap significantly decreases. The smaller bandgap corresponds to the absorption spectrum’s extension, which induces more absorption of light, more charge transfer on nanosheets, and more photodegradation activity.

Fig. 6
figure 6

a Absorption spectra of photographs of prepared samples in different heating temperatures, b Estimated optical bandgap of the samples using the Touc graph’s linear interpolation

3.6 Photoluminescence analysis

The room temperature photoluminescence spectra of the prepared samples were used to study the photogenerated charges’ separation and recombination. It was clear that all the samples displayed broad emission peaks from 425 to 465 nm. The intensity of emission peaks is impressively decreased with increasing heating temperature. As observed in Fig. 7, the most substantial emission peak is assigned to CN450, and the results were consistent with UV–Vis measurement and revealing the highest recombination rates of photogenerated electrons. Besides, CN700 exhibited the weakest emission peak, revealing the lowest recombination rates of photogenerated electrons and holes.

Fig. 7
figure 7

Photoluminescence spectra of CN450, CN500, CN550, CN600, CN650, and C700

3.7 Photocatalyst activity

Compared with samples processed at lower temperatures, samples prepared at higher temperatures are expected to exhibit better photocatalyst performance due to their more extended absorption range of light spectrum and a large number of active sites generated during thermal exfoliation. Based on the above measurements, CN650 and CN700 are particularly suitable for the rapid transport of charge carriers and should have excellent photocatalytic performance. As shown in Fig. 8, all samples’ photocatalytic performance was evaluated using the degradation of MB dye as a simulated pollutant under sunlight irradiation. Likewise, MB molecules’ surface adsorption was verified by treating the sample in the dark for 30 min. All samples show that the MB molecules are adsorbed in the dark, directly related to the increase in polycondensation temperature. As shown in Fig. 8c and Table 2, this adsorption was considerably large for CN700 because of its effective exfoliation during preparation processes. The photocatalytic performance of CN650 and CN700 samples shows that their degradation rate is faster than other samples. It is worth noting that CN700 degrades nearly 99% of dyes within 60 min after sun exposure, while CN450, CN500, CN550, CN600, and CN650 samples degrade about 77%, 80%, 85%, 87%, and 93% of the dye, respectively.

Fig. 8
figure 8

a Absorption spectrum of MB dye over time under sunlight for CN450 photocatalyst, b Photocatalytic activity of CN700 sample, c C/C0 vs. time for the comparative study of CN450, CN500, CN550, CN600, CN650 and CN700. d Pseudo-first-order kinetics fitting data for photodegradation of MB and evaluation of kinetic constant of samples

Table 2 Dark absorbance, light absorbance, and rate constant of g-C3N4 samples

In order to compare the degradation efficiency of the samples better and more completely, the plot of the C/C0 vs. time was drawn. As shown in Fig. 8c, CN700 has the fastest degradation rate. Furthermore, to analyze the samples’ photocatalytic performance and obtain a rate constant close to the pseudo-first-order, the relationship between Ln(C0/C) and time was plotted. The results are shown in Fig. 8d, which shows that from the equation:

$${\text{Ln}}\left( {C_{0} /C} \right) = k_{1} t$$
(1)

That theoretically describe the decomposition of the dye in photocatalytic reactions and is assigned to a pseudo-first-order kinetics reaction using a simplified Langmuir–Hinshelwood model [24]. It can be deduced from Table 2 that the photocatalytic degradation of MB confirms the pseudo-first-order degradation kinetics in the most samples where k1, C0, and C represent surface reaction rate constant, initial, and final concentration of MB at a various time interval, respectively.

Also, it is pointed out that CN700 with the constant of 6.49 × 10−2 min−1 displayed the highest photocatalytic degradation ability compared to that of other evaluated samples. However, the comparison of the regression coefficients (R2) shows that the quality of linear fit of the pseudo-first-order kinetic reaction equation with the CN700 data are not satisfactory. On the contrary, it shows that the pseudo-second-order kinetic reaction equation can be fitted perfectly as described below:

$$1/C{\text{ }} - 1/C_{0} = {\text{ }}k_{2} t$$
(2)

where C0, C and k2 (L/mg/min), respectively, represent the initial concentration of MB, the concentration of MB at different time intervals, and the second-order kinetic rate constant [25]. The kinetic rate constant is determined by a linear fit of the data of each sample. The data fitting for photocatalytic activity of CN700 shows a higher regression coefficient by using the pseudo-second-order kinetics reaction equation as shown in Fig. 9.

Fig. 9
figure 9

Degradation of MB using CN700 as the photocatalyst as a function of irradiation time. The fitted curves using: a Pseudo-first-order kinetics reaction equation and b Pseudo-second-order kinetics reaction equation

The photocatalytic performance improvement can be attributed to the decrease in bandgap and a further increase in surface area. Larger specific surfaces by harvesting more light and reducing recombination electron–hole pairs are two essential factors that eventually increased the photocatalytic performance. It can be revealed from PL spectroscopy that CN700 has the lowest electron–hole recombination, and it is expected to show considerable photocatalytic activity.

Furthermore, the photocatalytic activity of CN650 as a typical sample in three different heating ramping rates of 2, 5, and 10 °C/min was compared to confirm the effect of ramping rate on g-C3N4 photocatalytic performance. The photocatalytic activity of the three samples was evaluated in the same condition under sunlight irradiation. The heating rate variation during the preparation of the material affects its physical and chemical properties, including its energy band gap. Due to the above, the energy band gap is narrowed and more light is collected, so that it has better photocatalytic activity. As shown in Fig. 10a, the photodegradation performance depends on the ramping rate and increased with the decreasing ramping rate. Furthermore, the kinetic constant of three different ramping rates is evaluated in Fig. 10b.

Fig. 10
figure 10

a Variation of C/C0 with time for the comparative study of three ramping rates. b Evaluating the kinetic constant of three different ramping rates

To determine the reactive radicals and species in photocatalyst mechanism, four scavengers including AA, EDTA, IPA, and DMSO were used for degradation of MB with g-C3N4 under natural sunlight irradiation. The results of photocatalytic activity of the CN550 sample in presence of scavengers are shown in Fig. 11. As shown in Fig. 11a, the degradation of MB was significantly suppressed by addition of ascorbic acid and followed by EDTA, which implied that superoxide radicals (O2) and holes (h+) was major reactive species in the g-C3N4 system. When using IPA and DMSO scavengers during the experiment, the degradation of MB was not significantly inhibited, which indicates that the role of hydroxide (OH) and electron (e) species in photocatalytic degradation is beyond the role of superoxide and holes as it can be seen by comparing the degradation rate of the dye in presence of different scavengers in Fig. 11b.

Fig. 11
figure 11

a Effect of AA, EDTA, IPA, and DMSO as different scavengers on the photocatalytic activity of CN550 for MB photodegradation. b Kinetic constant of AA, EDTA, IPA, and DMSO scavengers

Therefore, the photocatalytic activity mechanism of g-C3N4 can be explained by hydroxide and superoxide-free radicals and electron-holes on the surface of g-C3N4 nanosheets, which break down MB in an aqueous solution.

As it can be seen from the schematic diagram of photocatalytic illustrated in Fig. 12, the photocatalytic activity mechanism is based on the absorption of light on the surface of the semiconductor and the generation of electrons and holes in the conduction band (CB) and the valence band (VB), respectively. When the energy photon () is absorbed on the semiconductor’s surface, the electron is excited from VB to CB and leaves a hole. The photogenerated hole and electron are powerful oxidizing and reducing agents, respectively. The produced holes can also oxidize organic compounds by reacting with water to generate hydroxyl radicals which are important as a high oxidation potential for degradation reactions. The reaction of holes with organic compounds resulting in their oxidation and production of carbon dioxide and water as final products. Hydroxyl radicals are electrophile and, therefore, tend to non-selectively oxidize almost all electron-rich organic molecules and finally converting them to water and carbon dioxide.

Fig. 12
figure 12

Schematic diagram of photocatalytic degradation mechanism of MB dye by g-C3N4 with the natural sunlight irradiation

4 Conclusion

Different g-C3N4 samples were prepared through thermal polycondensation of melamine at a wide range of temperatures. The XRD analysis results showed that, except for the sample prepared at 450 °C, the melamine was converted to g-C3N4. This result indicates that 450 °C is not sufficient for g-C3N4 formation. Instead, thermal treatment at 500, 550, 600, 650, and 700 °C resulted in the formation and extension of g-C3N4 networks confirmed by FTIR and PL analyses. FESEM analysis showed a granular morphology for CN450 (melamine) and a layered structure for other g-C3N4 samples. The BET analysis for g-C3N4 prepared at 700 °C showed a specific surface area as high as 38.38 m2/g, which is about four times that of g-C3N4 prepared at 500 °C (10.38 m2/g), suggesting more light-absorbing sites. Also, the mean pore volume was increased from 0.096 to 0.347 cm3/g. A considerable absorption in the dark and a high degradation rate of chemical dye under sunlight irradiation was detected for CN700 that can be mainly attributed to the lower thickness and higher surface to volume of g-C3N4 sheets. The heating rate effect was evaluated for the CN650 sample in three 2, 5, and 10 °C/min rates. The ramping rate of 2 °C/min showed the best photocatalytic activity assigned to more time to extend g-C3N4 networks in relevant temperatures. Finally, superoxide radicals (O2) and holes (h+) was determined as major reactive species by using AA, EDTA, IPA, and DMSO scavengers in the active radical scavenger experiment. These results make g-C3N4 a promising photocatalytic material for wastewater applications.