Introduction

Due to the growth of population and industrialization, the need for pure water is very urgent one for human life. Inadequate disposal of wastewater from industries can cause pollution of pure drinking water, and its consumption can cause diarrhea and bacterial and viral infections (Georgin et al. 2018; Salomón et al. 2021). At the same time, due to changes in human lifestyles and modern technology, people are very much interested in using various electronic portable devices with quick charging and long-lasting batteries. But the main problem is delay in charging time and the stability of the battery. So, the researchers and scientists are continuously researching to overcome all these problems by using nanomaterials and nanosized instruments. Nanoscience and nanotechnology are currently growing fields of science (Ahmed et al. 2014; Bayda et al. 2019; Hornyak and Rao 2016). In this way, nanosized metal oxides, such as ZnO, CuO, MgO, SnO2, CdO, and TiO2 have received considerable attention, especially, TiO2, due to its tremendous properties like light absorption capacity in the range of UV region and pseudocapacitive nature with redox states. There are different methods to synthesize TiO2 nanoparticles (NPs), such as hydrothermal (Steinfeld et al. 2015), co-precipitation (Tripathi et al. 2014), sol–gel (Dubey et al. 2019), microwave (Jena et al. 2010; Singh and Nakate 2013), and sonochemical (Alammar et al. 2010; Arami et al. 2007). The previously mentioned methods can produce some undesirable substances during the synthesis process. In order to avoid this problem, green synthesis route can be employed, which constitutes an easy, cost-effective, and toxic-free procedure.

Green synthesis method does not need for any specific hazardous reducing agents. The green extract acts as a capping and reducing agents, which can be used for the synthesis of several materials. Depending on the reducing agent employed, certain properties of NPs were enhanced, such as morphology, porosity, and particle size. Several works addressing TiO2 nanoparticle preparation by different green methods, such as fungi (Rajakumar et al. 2012), bacteria (Kirthi et al. 2011), enzymes (Biczak et al. 2014), and many plant extracts, like Camellia sinensis (Zhu et al. 2019), neem (Thakur et al. 2019), Coriandrum (Pushpamalini et al. 2021), Ocimum basilicum (Kantheti and Alapati 2018), and Moringa oleifera (Patidar and Jain 2017), have been addressed. Among the main existing forms of TiO2, anatase is considered the more active. TiO2 oxide has an indirect bandgap of 3.23 eV for anatase, while the rutile phase shows a direct bandgap of 3.06 eV and an indirect bandgap of 3.10 eV (Gupta et al. 2013; Sankapal et al. 2014). Due to its wide bandgap, it will be photoactive only under UV light. So, there is a need to improve the bandgap by doping with transition metals (Fe, Ni, Co, Mn, Bi) (Ali et al. 2017; Ganesh et al. 2012; Sarkar et al. 2013; Chauhan et al. 2012; Wang et al. 2016), noble metals (Pd, Pt, Au, Ag) (Wu et al. 2014; Hu et al. 2015; Armelao et al. 2007; Suwarnkar et al. 2014), non-metals (B, C, N, S) (Niu et al. 2020; Yang et al. 2015; Khan et al. 2021; Devi and Kavitha 2014), or conducting polymers (PIN, PNA, PANI, polypyrrole (PPY)) (Handore et al. 2017; Ameen et al. 2011; Yang et al. 2017; Ceretta et al. 2020; Leichtweis et al. 2021).

Electrically conducting polymers are fascinating materials due to their intrinsic properties, like high flexibility and stability. Poly (1-naphthylamine) (PNA) has a considerable small bandgap of 2.11 eV among the conducting polymers offered with electrochromic, environmentally stable, and strong visible light absorption. Due to its semiconducting property, it is used for applications like sensors and supercapacitors. However, there are few reports addressing the application of PNA as photocatalyst (Ameen et al. 2010; Riaz and Ashraf 2012). Another interesting two-dimensional conducting polymer is the polyaniline (PANI), whose bandgap range is 1.3–2.7 eV (Saha et al. 2020). Polyindole (PIN) is a wide bandgap semiconducting polymer (~ 4.4 eV). Redox potential for PIN is high compared to polypyrrole (PPY) and PANI, so it is feasible to be used for electrochemical studies (Mudila et al. 2019). PNA and PANI polymers are able to absorb visible light, and PIN exhibits absorption only at UV light. When the green-synthesized TiO2 NPs are coupled with these polymers, the recombination rate is reduced, so it will enhance the photocatalytic activity. In addition, the high redox potential of these polymers makes them suitable for supercapacitor application.

In present, TiO2 NPs were synthesized by a simple green method and posteriorly coupled on different conducting polymers, PNA, PANI, and PIN, to improve the electrochemical energy storage and catalytic activity. Photocatalytic degradation of organic dye and electrochemical performances of TiO2 NPs, TiO2/PANI, TiO2/PNA, and TiO2/PIN materials have been investigated using the methylene blue dye under sunlight and three-electrode cell setup. The TiO2/PNA exhibits high catalytic efficiency as well as capacitive property compared to the other materials. To the best of our knowledge, this is the first to examine the TiO2 with various conducting polymers for the two different applications, such as photocatalytic degradation of organic dye and supercapacitor.

Experimental section

Chemicals

For the synthesis of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN, green tea bags (Camellia sinensis) were used and purchased from a local market (Brooke Bond, Taj Mahal, India). Titanium (IV) isopropoxide (C12H28O4Ti, 97%) was bought from Sigma-Aldrich. For the synthesis of TiO2/PANI, aniline solution (C6H5NH2, 97%, Merck) was used as a monomer, and ammonium persulfate (APS, (NH4)2S2O8, 99%, Merck) was used as an oxidizing agent. For the synthesis of TiO2/PNA, 1-naphthylamine (C10H9N, 99%, Sigma-Aldrich) was used as a monomer, and APS was used as an oxidizing agent, in addition isopropyl alcohol ((CH3)2CHOH, 99%). Indole powder (C8H7N, 99%, Sigma-Aldrich) was used as a monomer for TiO2/PIN synthesis, and anhydrous ferric chloride (FeCl3, Merck) was employed as an oxidizing agent. Hydrochloric acid (HCl, 37%) and ethanol (C2H5OH) were obtained from Merck.

Preparation of tea extract

Ten grams of teabag (2 g × 5) was boiled in 200 mL of distilled water until the tea extract was extracted from the teabag. Then, the tea extract was cooled to room temperature and filtered using Whatman filter paper (pore size of 10 µm). Finally, the obtained dark brown color solution of tea extract was stored in a dark bottle in the refrigerator for further use. Tea extract acts as a both reducing agent as well as a capping agent in TiO2 NPs formation. It contains the metal potassium in the large amount of 92–151 mg L−1 and other metals, such as sodium (35–69 mg L−1), calcium (1.9–3.5 mg L−1), aluminum (1.0–2.2 mg L−1), fluoride (0.8–2.0 mg L−1), iron (0.020–0.128 mg L−1), and manganese (0.52–1.9 mg L−1). Tea extract also have an antioxidant polyphenol group. This phenolic group contains four flavonoid groups, like epigallocatechin gallate (EGCG) (117 to 442 mg L−1), epicatechin (EC) (25 to 81 mg L−1), epicatechin gallate (ECG) (203 to 471 mg L−1), and epigallocatechin (EGC) (16.9 to 150 mg L−1). In the first step, C12H28O4Ti is converted into Ti0, and epigallocatechin (EGC) is used in the phenolic group. –OH is the major group in epigallocatechin (EGC) in the reduction process. The reduced TiOH particles are converted into TiO2 NPs during the calcination process.

Green synthesis of TiO2 nanoparticles

As prepared, 200 mL of tea extract was inserted into a conical flask and kept in the bath sonicator at the frequency of 40 kHz (50 W). At the same time, 5 mL of titanium (IV) isopropoxide was added dropwise into the tea extract solution, resulting in a pale brown color solution. After 12 h of continuous stirring at room temperature, the TiO2 NPs were obtained. Then, the solids were cleaned by using ethanol and water until the impurities were removed by centrifugation. The colloidal supernatant was dried in the hot air oven at 60 °C for 4 h, and finally calcined for 300 °C for 4 h. The preparation route of TiO2 NPs is shown in Fig. 1.

Fig. 1
figure 1

Schematic representation of preparation route of TiO2 NPs

Preparation of TiO2/PANI nanocomposite

The green-synthesized TiO2 NPs (1 g) were added in 100 mL of 2 M HCl and sonicated for 1 h at room temperature. Then, 1 mL of aniline monomer was added into the previous solution and stirred for 30 min. After, 0.25 g of 10 mL ammonium persulfate was added dropwise into the TiO2–aniline suspension under stirring condition. After maintenance under stirring at room temperature for 12 h, TiO2/PANI suspension was obtained. The suspension was centrifuged and washed with ethanol and water and dried at 40 °C for 24 h. The TiO2/PANI formation mechanism is illustrated in Fig. S1.

Preparation of TiO2/PNA nanocomposite

The green-synthesized TiO2 NPs (1 g) were added into 200 mL of distilled water and 40 mL of isopropyl alcohol and sonicated for 15 min at room temperature. Then, 0.1 g of 1-naphthylamine was mixed with ethanol (10 mL) and posteriorly inserted into the TiO2 solution, under sonication, being stirred for 1 h. After, 0.1158 g of 10 mL APS was dropwise added on the TiO2/monomer solution. Then, the mixture was stirred for 12 h at room temperature. The solution was centrifuged and washed with ethanol and water for several times. The colloidal supernatant was dried at 40 °C for 24 h. TiO2/PNA nanocomposite was obtained according to the mechanism presented in Fig. S2.

Preparation of TiO2/PIN nanocomposite

The green-synthesized TiO2 NPs (1 g) were added in 200 mL of distilled water and sonicated for 20 min at room temperature. In other glass recipient, 1 g of indole monomer was mixed with ethanol (10 mL) under stirring and posteriorly added to TiO2 solution, being kept under stirring for 45 min. After, 80 mL of FeCl3 solution (0.1 M) was added to TiO2-indole solution and maintained under stirred for 24 h at room temperature. The final solution was centrifuged and washed with ethanol and water for several times. The obtained solids were dried for 40 °C for 24 h. TiO2/PIN nanocomposite was prepared according to the mechanism presented in Fig. S3.

Characterization techniques

The structural property of the samples was investigated by using an Ultima III Max diffractometer (Rigaku), with Cu-Ka (λ = 1.5418 Å) radiation at the operating condition of 40 keV and 30 mA. The diffraction pattern was recorded in the range 20–80° at grazing angle 1° and step size 0.01 deg. The functional groups and molecular structures of the samples were identified by a Fourier transform infrared spectrophotometer (Jasco FT/IR-4600), over the wavenumber range from 400 to 4000 cm−1. The surface morphology and the presence of elements was investigated by field emission scanning electron microscopy (FESEM, SIGMA HV–Carl Zeiss), equipped with energy-dispersive X-ray spectroscopy (EDS, Bruker Quantax 200–Z10 EDS Detector). The optical behavior of the nanocomposites was investigated by a UV–Visible Jasco V-730 spectrophotometer. Room-temperature photoluminescence (PL) spectra of the nanocomposites were recorded by a Jasco spectrofluorometer (FP- 8300), at an excitation wavelength of 325 nm.

Photocatalytic assays

The photocatalytic dye degradation experiments were conducted for the TiO2 NPs, TiO2/PANI, TiO2/PNA, and TiO2/PIN materials, using malachite green (MG) dye as a model pollutant molecule. Dye concentration of 3 mg L−1, pH of the solution = 7, and catalyst amount of 0.0125 g were employed for the photocatalytic degradation experiments. The experiments were conducted under sunlight on October 7–12, 2021, timing 10 am to 3 pm in Madurai (9.9759°N, 78.1393°E). Madurai City receives an incidence of global solar radiation around 5.0 kWh/m2/day in the October month (Lakshmi et al. 2017). Before the photocatalytic experiment, the photocatalyst was added to MG aqueous solution (150 mL) and stirred (150 rpm) in the dark for 30 min to reach the adsorption equilibrium. Once the adsorption process was over, 5 mL of aliquots were collected and noted as “0” min. After that, the solution was left in the sunlight, and each 30 min, 5 mL of aliquots were collected, posteriorly centrifuged for 15 min, and characterized by a UV–Vis spectrophotometer (LI-295, 8W, 50 Hz), at a maximum wavelength of 620 nm. The degradation efficiency was calculated according to Eq. (1) (Ali et al. 2017; Jarvin et al. 2021).

$$\mathrm{Degradation\;efficiency}=\frac{{C}_{0}-C}{{C}_{0}}\times 100$$
(1)

where C0 and C are the solution concentrations at t = 0 and at an irradiation time of t, respectively.

Electrochemical measurements

A typical three-electrode system on an electrochemical analyzer (CHI-7007E) at room temperature was used to carry out the electrochemical measurements. The electrochemical cell was manufactured from Perspex glass. The outer surface was painted black, and the entire study was conducted inside the closed wooden box to prevent any impact of unwanted light on the working electrode. Platinum wire and Ag/AgCl were used as counter and reference electrodes in the Na2SO4 aqueous solution (0.1 M). The working electrode was prepared by a combination of nanocomposite material TiO2 NPs, TiO2/PANI, TiO2/PNA, and TiO2/PIN (90% weight), polyvinylidene difluoride (PVDF, 10% weight), and the appropriate amount of N-Methyl-2-pyrrolidone (10 mL). The paste-like 1 mg active material nanocomposite was loaded on 1 cm × 1 cm flexible graphite sheet dried at 80 °C for 12 h.

The specific capacitance Csp (F/g) can be calculated from the cyclic voltammograms (CV), and galvanostatic charge-discharge (GCD), by the Eqs. (2) and (3) (Azman et al. 2018).

$${C}_{\text{sp}}=\frac{\int IdV}{\nu m\Delta V}$$
(2)
$${C}_{\text{sp}}=\frac{I\Delta t}{m\Delta V}$$
(3)

where I, t, V, ν, and m are the discharging current (A), discharging time (s), potential window (V), scan rate (mVs−1), and mass of active material (g), respectively.

Results and discussion

Characterization results

Structural and crystalline properties of the synthesized nanocomposites were analyzed by X-ray diffraction technique, as shown in Fig. 2. Figure 2a exhibits the respective diffractograms for TiO2, TiO2/PANI, and TiO2/PIN materials. TiO2 NPs exhibit peaks located at 2θ values of 25.53, 37.88, 48.21, 54.07, 55.14, 62.84, 68.97, 70.43, and 75.18°, which corresponds to the planes of (101), (004), (200), (105), (211), (204), (220), (107), and (215), respectively. This result clearly shows the formation of TiO2 NPs in anatase form. These results are associated with the JCPDS card No. 73–1764 (Maharana et al. 2021; Sofyan et al. 2018; Yang et al. 2012). TiO2/PANI and TiO2/PIN nanocomposites show similar patterns to the pristine TiO2. TiO2/PANI nanocomposite exhibits decreased peak intensity, and the position of the peak also shifts towards lower angle. This clearly shows that the incorporation of amorphous PANI to the TiO2 NPs will alter the phase composition or crystallinity of the TiO2 NPs (Wen et al. 2019; Sasikumar and Subiramaniyam 2018; Kumar and Pandey 2018). TiO2/PIN nanocomposite also shows some changes in the intensity and width of the peak. This will make some changes in the crystallinity, but it will not create considerable changes in the TiO2 NPs compared to TiO2/PANI. The peaks at 25.53° and 48.21° reveal that the TiO2/PIN nanocomposite is in anatase form [34]. Figure 2b shows the XRD patterns of PNA and TiO2/PNA nanocomposite. In the case of TiO2/PNA nanocomposite, it does not show any peaks related to the TiO2, where only the peaks at 15.35, 17.24, 18.38, 20.51, and 23.66° were noticed, which are related to semi-crystalline nature of PNA (Ameen et al. 2010; Saidu et al. 2019; Riaz et al. 2016). This denotes that the insertion of PNA over TiO2 NPs will increase the peak intensity of TiO2/PNA nanocomposite, where a small shift towards lower angle was also noticed in the peak. This shows PNA deposited over the surface of TiO2 NPs. This will be the most supporting parameter for photocatalytic activity. Table S1 shows the parameter comparison of the TiO2, TiO2/PNA and PNA samples.

Fig. 2
figure 2

XRD patterns of a TiO2, TiO2/PIN, and TiO2/PANI and b PNA and TiO2/PNA

The presence of functional groups in the synthesized samples was analyzed by the FTIR technique (Fig. 3). For TiO2, the broad peak around 3320 cm−1 is due to the adsorbed water molecules on the material surface. The strong peak at 1730 cm−1 represents the carboxylic ester (-COOTi). Band at 1624 cm−1 denotes the water molecules absorbed on the TiO2 NPs (Lu et al. 2015). Symmetric bending of CH3 was confirmed by the appearance of a small peak around 1433 cm−1. The peak at 1373 cm−1 clearly shows the presence of the carboxyl group. Transmittance peak within the range of 400–800 cm−1 shows the formation of Ti–O-Ti (Steinfeld et al. 2015; Thakur et al. 2019; Pushpamalini et al. 2021). TiO2/PANI nanocomposite shows a similar IR spectrum to TiO2, where only the peak at 1730 cm−1 decreased after polymerization. A small peak at 1128 cm−1 is due to the doped PANI’s quinonoid group (Wen et al. 2019). Ti–O-Ti stretching mode of anatase peak is also present in TiO2/PANI nanocomposite. This will suggest that TiO2 does not alter or change during polymerization. For TiO2/PNA nanocomposite, the peaks at 1390 cm−1 and 1604 cm−1 are due to the benzenoid (N-B-N) and quinonoid (N = Q = N) rings of PNA. The decreasing peaks at 1373 cm−1 and 1730 cm−1 indicate the interaction between TiO2 and PNA. The existence of a peak at 711 cm−1 also confirms the polymerization of 1-naphthylamine monomer to PNA in the nanocomposite (Ameen et al. 2011). For TiO2/PIN nanocomposite, the broad peak at the range of 3400 cm−1 denotes the –NH stretching of polyindole. The small transmittance peak at 1617 cm−1 indicates the aromatic C = C stretching. Band at 1445 cm−1 is assigned to the stretching of benzene on the indole ring. Band around 1333 cm−1 corresponds to the C = N stretching (Handore et al. 2017). The band at 744 cm−1 indicates that the benzene ring will not alter to any other form during the polymerization process.

Fig. 3
figure 3

FTIR spectra of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Morphological properties and elemental composition of samples were analyzed by FESEM/EDS technique (Fig. 4). Figure 4a shows the FESEM image of TiO2 oxide, presenting spherical and granular-shaped nanosized particles. The average particle size of 48 ± 23 nm was calculated using ImageJ software, represented by the histogram inset in Fig. 4b. TiO2 NPs showed low agglomeration, which is due to the presence of biomolecules in the tea extract during the synthesis process. For TiO2 NPs (Fig. 4b), the intense peaks at 4.6 keV and 5 keV and small intense peaks at 0.6 keV correspond to Ti, while the presence of O occurs at the range of 0.4 and 0.6 keV. The presence of oxygen vacancies leads to better photocatalytic application. The weight percentage of Ti was found the highest at 5.44%, and oxygen was 48.22%. The small peak of silicon (Si) (1.34%) corresponds to the optical reflection of Si surface during the characterization analysis. For TiO2/PANI, the particles are more spherical, and their size also increased to 90 ± 70 nm, as shown in Fig. 4c. This occurred due to the coating of PANI over the surface of TiO2 NPs. In addition, it is possible to observe that the particles are less agglomerated after doping with PANI. EDS spectrum of TiO2/PANI composite is shown in Fig. 4d. The presence of peaks of Ti and O corresponds to the TiO2 oxide, while S is attributed to the ammonium persulfate used during the synthesis process of the TiO2/PANI composite. TiO2/PNA shows an irregular shape, with a particle size of 65 ± 42 nm, as shown in Fig. 4e. This irregularity might arise due to the effective interaction between TiO2 and PNA. Figure 4f shows the presence of Ti, O, S, and Cl elements, where trace residues of S and Cl elements are due to the compounds FeCl3 and ammonium persulfate used in the synthesis process of the TiO2/PNA nanocomposite. Figure 4g displays a porous structure with a particle size of 45 ± 20 nm, found for TiO2/PIN nanocomposite. This porosity may be due to the high amount of PIN on the TiO2/PIN composite. This structure is more feasible for supercapacitor applications. The presence of trace residue of Cl (Fig. 4h) is due to the FeCl3 salt used during the synthesis process of the TiO2/PIN composite.

Fig. 4
figure 4

FESEM images and EDS analysis for a, b TiO2, c, d TiO2/PANI, e, f TiO2/PNA, and g, h TiO2/PIN

The light absorption ability of TiO2 and TiO2/polymer composites was characterized by UV–Vis analysis, as shown in Fig. 5. Photocatalytic property greatly depends on the number of photons absorbed by the photocatalyst during the photocatalytic process. So, the optical absorption study is nut and bolt for photocatalytic material. The green synthesized TiO2 shows a very sharp edge from 300 to 400 nm. This clearly shows that TiO2 nanoparticles are more active in the UV region and absorb UV light only (Nabi et al. 2020). TiO2/PANI nanocomposites’ absorption peak shifted to a higher wavelength region compared to TiO2 alone, which means that the material will absorb visible light. This is due to the well interaction between the PANI with TiO2 nanoparticles (El-Hossary et al. 2020). The band around 400 nm is due to localized polarons, indicating protonated PANI (Mitra et al. 2019). For TiO2/PNA, a very sharp edge around 300 nm occurs due to the combined effect of TiO2 and π-π* transition in the benzenoid ring of PNA. The absorption peak at 513 nm can be due to the presence of excitonic and polaronic (n-π*) transitions of the quinonoid rings (Ameen et al. 2010; Riaz et al. 2008a, b; Riaz et al. 2008a, b). The absorption peak of TiO2 is altered by the introduction of PNA (shifted to a higher wavelength region), and the peak intensity also increases. It clearly shows the interaction between TiO2 and PNA moieties. The change in the intensity and the shift in the peaks occur due to the interaction of organic/inorganic composites through the hydrogen bond (Ameen et al. 2011, 2010). Similar to TiO2/PNA, the TiO2/PIN shows a shift in the peak, and the change in the intensity will confirm that the addition of PIN will change the TiO2 property. The absorption peaks at 270 nm and 395 nm are due to the π-π* and n-π* transitions of PIN (Costa et al. 2012; Anjitha et al. 2019). The bandgap energy values for TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN were calculated using Tauc relation (El-Hossary et al. 2020), being 3.12 eV, 2.88 eV, 2.84 eV, and 3.24 eV, respectively, as shown in Fig. 6. Table S2 shows the crystallite size, particle size, and bandgap values of the TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN samples.

Fig. 5
figure 5

UV–Visible spectra of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Fig. 6
figure 6

Tauc plots of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Figure 7 exhibits the photoluminescence (PL) emission spectra of TiO2 and TiO2/polymer nanocomposites. Photoluminescence (PL) emission is a very useful analysis to study migration efficiency and recombination rate of electrons and holes. Photocatalytic activity always depends on the photoexcited electrons and holes, i.e., photocatalytic activity is proportional to the recombination rate of photoexcited electrons and holes and PL intensity (Ansari et al. 2014; Jing et al. 2014). The pure TiO2 exhibits strong intensity peaks at 370 nm and 415 nm, while the TiO2/PANI, TiO2/PNA, and TiO2/PIN nanocomposites show weak intensity peaks at the same wavelengths. It implies that there is a lower recombination rate of photoexcited electrons and holes in the hybrid nanocomposites than that the pure TiO2. This will clarify that polymers could effectively interact with TiO2 nanoparticles and effectively suppress the electrons and hole recombination.

Fig. 7
figure 7

PL spectra of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Photocatalytic dye degradation activity

TiO2 NPs and TiO2/polymer composites show dye degradation efficiencies depending on their bandgap values. Figure 8 shows the photocatalytic activities of TiO2 NPs and TiO2/polymer composites, while Fig. 9 shows the degradation efficiency and kinetic plots. TiO2 NPs presented an efficiency of 57% in 180 min. The rate constant for MG photodegradation was estimated by linear regression, whose value found for TiO2 NPs was 0.005 min−1 (R2 = 0.920). For TiO2/PANI and TiO2/PNA composites, efficiencies of 76% and 84% within 180 min were observed, with photodegradation rate constants of 0.0085 min−1 (R2 = 0.9718) and 0.01 min−1 (R2 = 0.9752), respectively. TiO2/PIN composite showed 34% efficiency in 180 min, with a rate constant of 0.0021 min−1 (R2 = 0.8562). Figure 10 represents the dye removal percentage using TiO2 NPs and TiO2/polymer composites.

Fig. 8
figure 8

Dye photodegradation spectra for a TiO2, b TiO2/PANI, c TiO2/PNA, and d TiO2/PIN

Fig. 9
figure 9

Dye photodegradation kinetics for TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Fig. 10
figure 10

Dye removal percentage using TiO2 and TiO2/polymer composites

Photocatalytic degradation mechanism

Photodegradation activity of MG dye involves different stages of the process, including (i) interaction of MG dye with nanocomposite, (ii) photosensitization of nanocomposite, (iii) excitation of electrons (e −), (iv) transfer of e − to TiO2 surface, and (v) degradation of MG dye into a colorless product. Under visible light irradiation, TiO2 NPs does not excite the e − from the valence band (VB) to the conduction band (CB), because of its absorption in the UV absorption range. So, it will not act as a photosensitizer for TiO2/polymer nanocomposites. PANI and PNA acted as good photosensitizers under visible light for TiO2/PANI and TiO2/PIN, due to their low bandgap energies, 1.8 eV and 2.1 eV, respectively. Insertion of polymers into the TiO2 NPs makes the TiO2/polymer composite a photosensitizer, as well as it will also hinder the e − and hole recombination process. Sunlight was absorbed by the polymers (PANI and PNA) and induced the transition of an electron to form the highest occupied molecular orbital (HOMO) to the lowest unoccupied molecular orbital (LUMO), i.e., π-π* transition (Saha et al. 2020). The conduction and valence band potentials of TiO2 are − 0.3 eV and + 2.9 eV, and LUMO and HOMO values of PANI ranges from − 1 to -2 eV and 0.4 to 0.6 eV (Jahdi et al. 2020; Sakar et al. 2019; Ekande and Kumar 2021). The energy levels of TiO2 and polymers are as follows: E(LUMO) > E(CB) > E(HOMO) > E(VB). This photogenerated e − is injected into the d-orbital (CB) of TiO2. At the same time, holes in the valence band of TiO2 are transferred to the highest occupied molecular orbit (HOMO) of the polymer, and oxidation process occurs. Holes will react with water to form •OH radicals. Then, the MG dye was degraded by the reactive oxygen species (ROS). A simplified general mechanism for the MG dye degradation is depicted as follows (Eqs. 411) (Amorim et al. 2021), as well as illustrated in Fig. 11.

Fig. 11
figure 11

The mechanism of MG dye photodegradation

$$\mathrm{Polymer}+\mathrm{hv}\longrightarrow\mathrm{Polymer}\;\left(e_{CB}^-+h_{VB}^+\right)$$
(4)
$$\mathrm{Polymer}\left(\mathrm e^-\right)+{\mathrm{TiO}}_2\longrightarrow\mathrm{Polymer}+{\mathrm{TiO}}_2\left(\mathrm e^-\right)$$
(5)
$${\mathrm{TiO}}_2\left(\mathrm e^-\right)+\mathrm O_2^-\longrightarrow{\mathrm{TiO}}_2+\cdot O_2^-$$
(6)
$$\cdot\mathrm O_2^-+\mathrm H^+\longrightarrow{\mathrm{HO}}_2$$
(7)
$${\mathrm{HO}}_2+\cdot\mathrm O_2^-+\mathrm H^+\longrightarrow{\mathrm H}_2{\mathrm O}_2+{\mathrm O}_2$$
(8)
$${\mathrm H}_2{\mathrm O}_2+\mathrm e^-\longrightarrow\mathrm{OH}^-+\cdot\mathrm{OH}$$
(9)
$$\mathrm{Polymer}\left(\mathrm h^+\right)+{\mathrm H}_2\mathrm O\longrightarrow\cdot\mathrm{OH}$$
(10)
$$\cdot\mathrm{OH}+\mathrm{MGDye}\longrightarrow D\mathrm e\mathrm g\mathrm r\mathrm a\mathrm d\mathrm a\mathrm t\mathrm i\mathrm o\mathrm n\;\mathrm p\mathrm r\mathrm o\mathrm d\mathrm u\mathrm c\mathrm t\mathrm s\;\left({\mathrm{CO}}_2,{\mathrm H}_2\mathrm O\right)$$
(11)

Electrochemical results

Electrochemical behaviors of the TiO2 and TiO2/polymer nanocomposites are illustrated in Fig. 12. The cyclic voltammograms (CV) were recorded from − 0.4 to 0.8 V at various scan rates (5 to 100 mV/s). For TiO2 NPs, the CV curve shows a nearly rectangular shape, which reveals the reversible capacitive behavior of faraday redox reaction. All the CV curves of TiO2 samples show the same profile under various scan rates from 5 to 100 mVs−1. At the scan rate of 5 mVs−1, TiO2 NPs show a specific capacitance value of 69 Fg−1. When increasing the scan rate to 100 mVs−1, the integrated area of the CV curve increases and in turn results in a decrease in capacitance. High specific capacitance at a low scan rate is due to the slow intercalation and deintercalation process of ions with the electrode material. At the high scan rate, ions do not have sufficient time to migrate into the active sites of the electrode, leading to a decrease in the capacitance value. TiO2/PANI, TiO2/PNA, and TiO2/PIN composites show capacitance values of 55, 98, and 25 Fg−1, respectively. Generally, conducting polymers have high redox potential, and it will combine with TiO2 metal oxide synergistic effect created between polymer and the metal oxide. These properties make TiO2/PNA nanocomposite a perfect supercapacitive material, while the other two nanocomposites show low capacitance values. Low capacitance values for TiO2/PANI and TiO2/PIN nanocomposites, due to the excess amount of PANI and PIN in the composites, will restrict the insertion of ions into the electrode materials. Generally, polymer materials have low mechanical stability when the polymer is combined with TiO2 NPs, and it will prevent the breakage of polymer structure during the charging and discharging process. The capacitive behavior of the TiO2 and TiO2/polymer nanocomposites was also confirmed by the investigation through the galvanostatic charge–discharge technique at the operating potential window between − 0.4 and 0.8 V, for the specific current from 0.5 to 100 A/g. For all the nanocomposites, the curves are not ideal; straight lines show the faradic behavior of nanocomposite. The maximum specific capacitance of TiO2/PNA was 53 F/cm2 at 1 A/g current density, being superior when compared to other samples, which is attributed to its high surface area and large number of active sites. Figure 13 depicts the specific capacitance values of TiO2 and TiO2/polymer nanocomposites from the cyclic voltammograms (CV) and galvanostatic charge–discharge (GCD).

Fig. 12
figure 12

a, c, e, g CV plots and b, d, f, h GCD plots of TiO2, TiO2/PANI, TiO2/PNA, and TiO2/PIN

Fig. 13
figure 13

Specific capacitance values from the a CV and b GCD at different scan rates and current densities

Conclusion

In this work, TiO2/polymer hybrid materials were successfully prepared by an in situ chemical polymerization method. The TiO2/PNA nanocomposite showed higher photocatalytic activity and capacitive behavior compared to the binary nanocomposites TiO2/PANI, TiO2/PIN, and pure TiO2. The higher photocatalytic activity and better capacitive behavior occurred due to the insertion of PNA and PANI to the TiO2. The extended visible light absorption and the higher charge separation enhanced the catalytic activity, and the conducting properties of the polymers increased the capacitive behavior. The low capacitive and catalytic behavior of TiO2/PIN is due to the poor optical and electronic properties of the respective nanocomposite.