1 Introduction

Under the high demands for energy resources with the increase in population and limited nonrenewable sources, the development of renewable and sustainable energy sources become an important field for researchers and scientists [1,2,3]. There have been several research done to provide more renewable energy sources including wind, biomass, geothermal heat, and solar energy. One of the more effective and low-cost renewable energy is the hydrogen gas [4,5,6,7]. The high combustion efficiency and clean by-product push the scientists to develop the sources of production of this gas.

With applications in photoelectrochemical water-splitting processes, solar energy is a viable renewable energy source [8, 9]. This process is based on the creation of electrons in the presence of light, in which the splitting of the outer energy levels results in the generation of electron holes. The H2O molecule’s conversion to hydroxyl radicals serves as the catalyst for the water-splitting mechanism, which involves both electrons and holes [10, 11]. Hydrogen gas, a potential fuel for combustion that is free of impurities and carbon residue, is produced by the water-splitting reaction. Additionally, this gas offers a large amount of energy that may be used in manufacturing facilities, automobiles, aircraft, and spaceships.

With the use of a semiconductor oxide material, such as Cu2O, ZnO, WO3, TiO2, and Fe2O3 [12,13,14], hydrogen gas is produced from the water-splitting process. Although they have low efficiency and certain corrosion restrictions, metal sulfides like PbS and CdS can be employed as photocatalytic materials for the water-splitting process and hydrogen production [15, 16]. Carbon compounds like g-C3N4, carbon nanotubes, and graphene oxide can occasionally exhibit photocatalytic activity in water-splitting reactions [17,18,19].

Conducting polymers are considered to be potential materials for photocatalytic water-splitting processes, such as PANI and its derivatives. The large surface area, stability, safety, and repeatability of these polymers are only a few of their many strengths. They also have economic advantages due to their inexpensive cost and simple preparation [20,21,22]. These polymers’ photocatalytic performance improves as their surface area grows through nanoscale or polymer composite preparations. The great optical properties of these materials cause the capture of the incident photons, after this process, these photons cause the production of electrons that oscillate on their surfaces. The resulting electrons are transmitted to the nearby semiconductor materials to create more generations of electrons, which eventually reach the water molecules to undergo a splitting process.

Previously, polymers have been investigated as potential photocatalytic materials. WS2/poly (3,4-ethylene dioxythiophene)/Au photoelectrode for H2 production from H2O was researched by Xiao et al. [23]. Poly (3-aminobenzoic acid)/organic framework was created by Modibane et al. [24], and it was used to generate hydrogen from an H2SO4 solution. When hydrogen is produced from a NaOH solution, Thimsen et al. [25] evaluated the effect of noble metals on Fe2O3. The photocatalytic activity of this polymer was also used by Ghosh et al. [26] to study the contamination decompositions.

The modest Jph values associated with the little hydrogen moles show that there are still numerous limits, although prior studies attempted to create a green energy source in place of fossil fuels. Additionally, prior investigations often employ sacrificial agents like NaOH, H2SO4, Na2SO4, and Na2S in water-splitting processes. The water supply was also fresh distilled water. High economic expenses are still associated with utilizing high-tech preparation tools, such as pulsed lasers, atomic layer deposition, and RF sputtering processes.

Here, the preparation of promising photoelectrode Ppy/GO is carried out for hydrogen gas production from wastewater. This electrode has a great optical property related to its great absorbance in UV, Vis, and near IR regions, with a small bandgap of 1.66 eV. The testing for hydrogen gas production is carried out from wastewater (pH 7.2) under a metal halide lamp (400 W), and through the electrochemical workstation, in which the Jph values represent of the hydrogen rate. Moreover, the effect of light on/off and monochromatic light is studied as an indication of electrode responsivity.

2 Experimental part

2.1 Preparation of Ppy and Ppy/GO

The preparation of Ppy is carried out using the in situ oxidation polymerization method. The dissolving of 0.1 M pyrrole is carried out under the ultrasonic stirring method, in which 0.2 M HCl is used as an acid medium. For the polymerization method, (NH4)2S2O8 is added for the oxidation process, through this addition, the dark green color is formed indicating the precipitation of Ppy.

The preparation of GO sheets is based on the modified Hummer method and described in our previous literature [8, 24]. For the preparation of Ppy/ GO, 6 ml of the prepared suspended solution (11 mg/ml) is added through the polymerization of Ppy, this led to the decoration of Ppy on the GO sheet, for the formation of Ppy/GO. Under the presence of a Glass slide inside the beaker during the polymerization reaction, Ppy/GO thin film is formed, and then it is washed using distilled water and dried at 60 °C for 3 h.

2.2 Characterization

The chemical structures of the prepared materials are confirmed using XRD, XPS, and FTIR analyses, for the XRD, Bruker D8, u Kα device is used, while for XPS, K-ALPHA, Easton, MA, USA is used, and for FTIR, Shimadzu FTIR-340 device is used. The morphology of the prepared samples is characterized using SEM and TEM analyses, for SEM, FE-SEM, Hitachi, S-4800 is used, while for TEM, JEOL JEM-2100 TEM is used. To determine the optical analysis, the optical spectrophotometer, Perkin Elmer Lamba 950, USA, is used.

2.3 Electrochemical measurements

For testing the prepared Ppy/GO photoelectrode for the H2 production. The electrochemical measurements are carried out using an electrochemical workstation (CHI608E) at a scan rate of 100 mV s−1 with an applied voltage ranging from − 1.08 to 0.0 V. The testing is carried out under a metal halide lamp (400 W). The study is applied under on/off the light and monochromatic light (390, 440, 540, and 640 nm). From this study, the sensitivity of the prepared electrode for the incident light is confirmed. The hydrogen evolved from sewage water (pH 7.2) without using any additional electrolyte. Figure 1 represents the schematic diagram for the hydrogen generation test study.

Fig. 1
figure 1

The schematic diagram for Ppy/GO photoelectrode for hydrogen generation from wastewater

3 Results and discussion

The XRD pattern of the pristine PPy, GO, and the composite of PPy quantum dot-GO sheets are depicted in Fig. 2a. It is the evident presence of a broad peak at ~ 26.6° in the pattern of pristine PPy, which reveals the amorphous nature of PPy [27]. This nature is due to a high molar concentration for reducing agent and pyrrole, which hurries the reaction in a short time and leads to get the amorphous structure of PPy [28, 29]. Further, the value of d spacing for PPy was determined to be 3.33855 Å. The XRD data of the pristine GO diffraction pattern presents an intense peak located at 2θ ~ 12.2° ascribed to the inter-planar spacing (001) of GO, which agree with the literature data (JCPDS file no. 75-2078) [30, 31]. Additionally, it can be noted significant variations compared to that of the PPy after a combination of GO into PPy, in which new peaks are exhibited especially at ~ 24.1° and 31.04° assigned to (104) and (111) crystal planes of the PPy [32]. As a result, they confirm transferring the PPy from the amorphicity to crystalline nature after the addition of GO sheets. Besides, a small peak is also revealed located at ~ 11.86° in the composite PPy quantum dot -GO sheet, supporting the presence of GO sheet in the composite film. The small peak is an indication that GO sheets were effectively enveloped by PPy polymeric structure. More importantly, the average crystallite size (D) of the PPy and Go were calculated for a sharp peak at 24° and 11.6 using the Scherrer’s formula [33]:

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

where λ represents the X-ray wavelength (λ = 0.15406 nm), θ denotes the diffraction angle at maximum peak intensity, and β indicates the full width at half maximum of the diffraction angle in radians. Therefore, by applying in Eq. (1), the average crystallite size of about 6 and 55 nm for PPy and GO, respectively. Accordingly, XRD patterns affirm forming the crystalline PPy quantum dot-GO nano-sheets with a great structure property.

For further investigation, FTIR spectra are utilized to confirm the active form of the pristine PPy, GO, and their composite of quantum dot PPy–GO sheets as shown in Fig. 2b. The FTIR spectrum of the pristine GO presents a broad absorption band from ~ 3017 to 3572 cm−1 is attributed to the stretching vibration of the O–H group [34]. Very weak peaks are seen at ~ 2927 cm−1 owing to the symmetric and asymmetric ratio of the C–H bond. However, the spectrum of GO also includes the number of strong-to-medium sharp bands at 1722, 1630, 1472, 1285, 1172, and 1069 cm−1 which are associated with carbonyl stretching vibration of C=O, stretching vibration of non-oxidized graphitic range C=C, O–H deformation, C–O stretching of epoxy groups, the stretching modes of C–OH, C–O alkoxy group stretching vibration, respectively [35,36,37]. Two peaks are also exhibited in the GO spectrum located at ~ 887 and 580 cm−1 for the =C–H group. For PPy spectrum, it can be noted small band at ~ 3006 cm−1 is assigned to the N–H and C–H stretching [38]. The characteristic peaks at 1538 and 1455 cm−1 corresponded to the asymmetric and symmetric ring-stretching manners of pyrrole, respectively [39]. Moreover, the bending of C=N (1303 cm−1), stretching wagging vibrations of C–N (1168 cm−1), =C−H bending vibrations (1036 cm−1), the out-of-plane bending vibrations of C–H (872 cm−1), and the C –H out of plane ring deformational vibration (780 and 672 cm−1) were also recorded in the spectrum of the pristine PPy [40]. For the composite of PPy quantum dot-GO sheets, we have seen that all characteristic peaks of PPy appeared in the composite spectrum. However, it is interesting to note that the bands at 872 and 1168 cm−1 in the pristine PPy were shifted to 880 and 1170 cm−1 in the composite, respectively. Also, new peaks appeared in the composite, e.g., the peak at 2893 and 487 cm−1. This is attributed to the π–π interactions between the aromatic PPy quantum dot and the GO sheets [41].

Fig. 2
figure 2

a XRD patterns and b FTIR spectra. of the pristine PPy, GO, and the composite of PPy quantum dot-GO sheets

XPS analyses are utilized to conclude the elemental composition and functional groups of the PPy quantum dot-GO sheets composite. Figure 3a implies the survey spectrum to determine the chemical composition of the composite. The peaks shown in Fig. 3a are assigned to C, N, O, S, and Cl elements with ratios of 66.55,11.20, 16.77, 2.81, and 267%, respectively. It can be noted that the composite of PPy quantum dot-GO sheets has been washed several times using Deionized water to eliminate the unreacted, DBSA, and Cl− anions residue. However, this result demonstrates the presence of DBSA, and Cl− in the composite. In addition, the C1s spectrum in Fig. 3b exhibits four strong peaks located at 284.1, 285.11 and 286.83, 288.46 eV, corresponding to the C=C, C–C group, C–OH, and C-epoxy, respectively [42]. Meanwhile, the spectrum of N1s in Fig. 3c affirms the presence of a pyrrolic-like N atom and reveals the successful incorporation of PPy quantum dots and GO sheets. In which, bands at 399.92 and 401.03 eV are associated with the neutral and pyrrolium nitrogen (–NH–) groups and positively charged polaronic nitrogen (N+), respectively [42]. Figure 3d displays the XPS spectrum of O1s, in which this spectrum holds peaks located at 531.32 and 532.55 eV ascribed to the C–O group and C=O bonds, respectively [43].

Fig. 3
figure 3

XPS spectra for the composite of PPy quantum dot- GO sheets a survey spectrum, b C1s, c N1s, and d O1s

To confirm the successfully prepared quantum dot spheres of PPy–GO sheets, the SEM images of the PPy quantum dot spheres and the composite of PPy–GO have been presented in Fig. 4a, b, respectively. It can be seen that PPy quantum dot spheres have been formed exclusively of a great amount of uniform quantum dot spheres with an average diameter from 3 to 7 nm. For PPy–GO composite, we observed that the composite is formed by GO sheets and PPy quantum dot spheres. For PPy–GO composite, we observed that the composite is formed by GO sheets and PPy quantum dot spheres. In which the surface morphology of GO shows a typically flat structure. Further, PPy quantum dot spheres have been uniformly grown on the surfaces of GO sheets with small diameters and more agglomeration. The smaller size is beneficial for improving the electrochemical performance owing to their large surface areas [42]. Besides, TEM images under different magnifications of the composite of PPy–GO sheets are depicted in Fig. 4c, d. These figures also affirmed that PPy quantum dot spheres have been formed with different sizes ranging from 5 to 8 nm on the surfaces of GO sheets.

Fig. 4
figure 4

a SEM image of PPy. b SEM image of PPy quantum dot -GO sheets. c, d The TEM analyses under different magnifications for the composite of PPy quantum dot -GO sheets

The UV–vis spectra are carried out to reveal the conjugated structure of the pristine PPy and interactions of PPy quantum dots with GO sheets. Figure 5a records the optical absorbance of the PPy, GO, and the composite of PPy quantum dot-GO sheets. It can see that the absorption spectrum of the pristine GO reduced exponentially, in which the absorption is very close to zero with increasing the wavelength. Moreover, the pristine GO holds two characteristic bands at λmax of 330.3 and 374.1 nm are assigned to the ππ* transition of aromatic C–C ring and nπ* transition of the C=O group, respectively [44]. For the pristine PPy, two absorption bands are observed located at ~ 337 and 467 nm are indicated to the ππ* transition in benzenoid rings of the PPy and the formation of conducting PPy [45]. Additionally, a broad peak also is depicted at 907 nm and is assigned to the electron transition from the valance band to the bipolaron band of the conjugated PPy chain [45]. Interestingly, changes in the position and intensity of these absorption bands of their composite should be noted. For example, the peak at 337 nm in PPy has been shifted to 324.1 nm in the composite and the band at 467 shifted to 455 nm. This shift is due to extending the conjugation lengths of PPy chains, which results from the stacking of ππ* between the conjugated structure of PPy quantum dot and GO sheets. The optical absorption bands of the composite cover a broad optical region which render the composite of PPy quantum dot-GO sheets is suitable for optoelectronic devices. The optical bandgap (Eg) of the pristine PPy, GO, and the composite of PPy quantum dot-GO sheets is computed by employing Tauc’s expression [46]:

$$\alpha h{\nu }=A {(h{\nu }-E_{\text{g}})}^{m}$$
(2)

where denotes the incident photon energy, which is determined using \(h\nu = 1240/\lambda\) [47], A represents the absorption width parameter, and m demonstrates the type of the optical transition. The indicator m is 1/2 and 3/2 of the direct allowed and forbidden transitions, respectively. While m = 2 and 3 for indirect allowed and forbidden transitions, respectively. 1/2 or 2 for direct and indirect allowed transitions, respectively. Moreover, the transition type and values of the optical bandgap are illustrated in Fig. 5b. This figure displays the direct allowed transition with the bandgap values of all samples, which were found by extrapolating the linear portion of the plots to intercept the photon energy axis. It can be noticed that the direct bandgap energy of the pristine PPy is 2.22 eV, which is significantly reduced after combining with GO sheets to be 1.66 eV. This reduction in bandgap is attributed to the change in the PPy disorder grade owing to the synergistic interaction of GO and PPy matrix [27, 48]. As a result, values of bandgap show improving the optical properties of the composite, which becomes convenient for application in H2 generation systems.

Fig. 5
figure 5

a Absorbance spectra and b Optical bandgap plots of the pristine PPy, GO and the composite of PPy quantum dot -GO sheets

3.1 The electrochemical measurements

The testing of photoelectrochemical reactions for sewage water splitting is carried out using a three-electrode cell through the electrochemical workstation (CHI608E). The sewage water (the third-stage treated) is used as an electrolyte without using any additional chemical electrolyte. The prepared nanocomposite (Ppy/GO) is used as the working electrode, while graphite is the counter electrode, and the calomel electrode represents the reference electrode. The measurements are carried out at 100 mV/s and 25 °C under a light source (400 W metal halide lamp). The chemical composition of the used sewage water (third-stage treated wastewater, Beni-Suef city’s water and sanitation company) is mentioned in Table 1.

Fig. 6
figure 6

a The effect of light and dark and b the hydrogen rate with time for the prepared Ppy/GO photoelectrode

Table 1 The chemical composition of the used sewage water

Using Ppy/GO as a working electrode consider a promising study, in which the polymer has great stability for increasing the lifetime of the electrode. Moreover, the optical properties of both Ppy and GO combine with each other through the prepared composite that can work in a large optical region. Figure 6a shows the effect of on/off light on the sensitivity of the prepared Ppy/GO photoelectrode for H2 generation under the sewage water splitting reaction. There is a great enhancement in the produced current density (Jph) in light in comparison to dark conditions, in which the Jph values increase from 4 to 12 µA cm−2 in dark and light, respectively. The dark current confirms the semi-conductivity nature of the prepared photoelectrode. The great increase in Jph value in light is related to the energy level splitting under light conditions, in which the incident photons motivate the energy levels for the formation of hole–electrons pairs. The nanostructure and large surface area of the composite motivate the high increase in the produced Jph values.

The hydrogen moles are calculated using the Faraday’s law (Eq. 3) [49,50,51], as shown in Fig. 6b, this equation depends on the change of time, the photocurrent, and the Faraday constant (F = 9.65 × 104 C mol−1). The calculated hydrogen moles are 1.02 µmole/cm−2 h for the photoelectrode in which the glass is the substrate, this confirms that all the hydrogen evolution is related to the self-material reaction.

$${\text{H}}_{2} ({\text{moles}})\mathop {\mathop \smallint \limits^{t} }\limits_{0} \frac{{J_{{{\text{ph}}}} {\text{d}}t}}{F} \cdot 1/2$$
(3)

Under the level splitting, the electrons are collected on the outer surface of the composite and then transfer to the neighbor wastewater solution, in which the produced Jph represents the rate of the H2 generation [49,50,51]. The reaction is carried out through the generation of OH. radical that reacts again with water molecules for a final product (H2 gas). Although the nanocomposite Ppy/GO is prepared on a glass electrode, the Jph has a great value that can be compared well with previous literature. Using Ppy cover well the GO materials, so the stability of the prepared nanocomposite appears well in the figure, in which under many runs, the produced Jph value has almost the same values.

The effect of monochromatic light wavelength on the photoelectrode sensitivity is shown in Fig. 7a. under the different light wavelengths, the photoelectrode has various sensitivities that are represented in the produced Jph values. These values increase from − 4.32 to − 4.89 µA cm−2, with decreasing in the wavelengths from 730 to 440 nm, respectively. These values are mentioned in Fig. 7b which represents the Jph values at 1.08 V. The high Jph value at 440 nm is related to the high-frequency optical photons that can transfer electrons to the conducting band under high light energy. Thus, the sensitivity of the prepared photoelectrode increase in the UV and initial Vis regions as confirmed through the optical wavelength curve.

Fig. 7
figure 7

The effect of light wavelengths on the responsivity of the prepared photoelectrode through a voltage-current density relation and b The values of the produced current density at 1.08 V

The general mechanism for hydrogen generation is the response of the prepared Ppy/GO nanocomposite for the incidence photons under different light regions. These photons motivate the active sites on the surface for level splitting and the formation of electron–hole pairs. Then the electrons are accumulated on the surface as hot electrons. Then these electrons can transfer to the neighbor solutions for additional reactions, in which the water molecules are split under the formation of OH. Radicals attract water molecules many times. The great optical properties of the composite confirm that this composite can work in a large optical region. The final product is the current density (Jph) value that represents the rate at which H2 gas evolved. Under 400 W, the incidence photons’ number is 8 × 1021 photon/s, this photon’s numbers are based on the Equation, N = \(\lambda P/hc\) that depends on c, P, h, and \(\lambda\) that represents the light velocity, light intensity, Plank constant, and light wavelengths [52].

4 Conclusion

Ppy/GO composite with great optical and morphological properties is prepared with simple and low-cost technique methods (in situ polymerization in the presence of GO). The great morphological properties related to the quantum dot of Ppy are related to its very small size particles of average (5 nm). The optical properties are very promising, in which the composite can absorb light in UV, Vis, and IR regions with a small bandgap of 1.66 eV. The chemical structures are confirmed through XRD, XPS, and FTIR analyses. The application as photoelectrode is carried out through a three-electrode cell, in which the prepared composite film is applied as a working electrode, and the measurements are carried out under a metal halid lamp (400 W). The effect of on/off light has confirmed the sensitivity of the prepared photoelectrode, the Jph values increase from 4 to − 12 µA cm−2, respectively. The effect of monochromatic light is applied from 730 to 440 nm, in which the Jph values change from − 4.32 to − 4.89 µA cm−2, respectively. Under the low-cost and easy technique preparation process, our team will work on designing a three-electrode electrochemical cell for hydrogen generation under the conversion of sewage water into H2 gas directly soon.