Introduction

With the rapid development of the global economy, increasingly more resources are consumed, and the ecological environment is also damaged. Therefore, it is very important to develop new materials with low energy consumption and environmental protection functions. Since the discovery of electrochromic materials in the 20th century [1], these materials have received extensive attention because their optical properties can undergo stable and reversible changes with alternating voltage fields. In the last 30 years, electrochromic materials have experienced rapid development and have been applied in many fields, such as smart windows [2], displays [3], rear-view mirrors for automobiles [4], and fabrics [5]. According to molecular structure type, electrochromic materials can be divided into organic electrochromic materials and inorganic electrochromic materials. Compared with inorganic electrochromic materials, organic electrochromic materials have the advantages of rich color, good processability, and fast switching speed, but they still have some shortcomings, such as poor cycle stability. Inorganic electrochromic materials have some advantages, such as wide range of operating temperatures and high electrochemical stabilities. Therefore, the preparation of organic/inorganic electrochromic nanocomposites can solve their respective problems and supply enhanced electrochromic performances.

Conducting polymers have been used as important electrochromic materials because of their unique properties, such as abundant color, high contrast, and fast response speed. However, its shortcomings, for example, poor stability, are still puzzling. To overcome the shortcomings of conducting polymer-based electrochromic materials, many researchers have developed various methods, such as combining conducting polymers with inorganic nanomaterials, designing new molecular monomers, and preparing novel microstructures of conducting polymers. The preparation of nanocomposites with carbon nanomaterials (carbon nanotubes (CNTs), graphene or fullerene) and conducting polymers is another efficient approach to improve the electrochromic performance of conducting polymers [6,7,8]. CNTs are one-dimensional carbon nanomaterials that are widely used in various fields, including electrochromism, due to their outstanding mechanical and electrical properties. Chen et al. [9] reported poly(3,4-ethylenedioxythiophene): poly(styrene sulfonate)-multiwalled carbon nanotube (PEDOT:PSS/MWCNT) composites prepared via in situ polymerization of the monomer in the presence of MWCNTs for electrochromic applications. They found that when 0.3% MWCNTs were added, the color contrast of the PEDOT:PSS/MWCNT nanocomposites increased by 23% and still had good stability after 1000 cycles compared with that of the PEDOT:PSS materials. Lu et al. [10] combined PANI with single-walled carbon nanotubes (SWCNTs) by copolymerization to obtain PANI-SWCNTs nanocomposites. The charge transfer resistances and oxidation potential of PANI-SWCNTs nanocomposites were significantly reduced, and the optical contrast and switching kinetics were greatly improved compared with those of neat PANI. Ye et al. [11] synthesized a novel solution-processable composite material, multiwalled carbon nanotube-poly1,1′-[4,8-bis[5-(2-ethyl-hexyl)-2-thienyl]benzo[1,2-b:4,5-b′]dithiophene-2,6-diyl] bis[1,1,1-trimethylstannane (MWCNT-PBDTC), through a one-step synthesis. The composite material not only exhibits superior energy storage properties but also exhibits good electrochromic properties. The addition of CNTs greatly improves the mechanical properties of the electrode material and increases its cycle life. The results show that 96% of the initial capacitance is maintained after 5000 cycles and 95% of the optical contrast is retained after 1500 s cycles. Although the addition of CNTs can improve the electrical conductivity and enhance the cycle stability of the composite, the lower specific surface area of CNTs cannot provide a sufficient support region for the growth of the conducting polymer, so the interaction between the conducting polymer and CNTs is weak, and their composite structure is easily destroyed during the redox process. Graphene, as a two-dimensional carbon material, has also received extensive attention due to its large specific surface area, excellent electrical conductivity, and electrochemical properties. Xiong et al. [12] prepared polyaniline/functionalized graphene nanocomposites by oxidative polymerization. The results show that the electrochemical and electrochromic properties of PANI-GO nanocomposites have been greatly improved. Kim et al. [13] produced highly stable electrochromic poly(3-hexylthiophene) (P3HT) with a graphene oxide-octadecylamine (GO–ODA) complex as a protective layer by the Langmuir–Schaefer method. The GO–ODA layer had strong interactions with the P3HT film via s–π, π–π stacking, coulomb, and electrostatic forces. Due to the strong interaction between GO–ODA and P3HT, GO–ODA can effectively protect the P3HT film from falling off and enhance the stability of the cycle test. Reddy et al. [14] synthesized a poly(3,4-ethylenedioxypyrrole)-reduced graphene oxide/ionic liquid (PEDOP-rGO/IL) composite by an electrochemical method. In the PEDOP-rGO/IL composite, rGO/IL can act not only as a dopant for forming the polymer film but also as an electron conductor connecting the PEDOP grains to form a uniform conductive network; thus, PEDOP-rGO/IL has a larger coloring efficiency, faster bleaching rate, and higher electrochemical ion insertion–extraction capacity than the PEDOP-IL film.

While providing enough support regions for the growth of conducting polymers, the excessive addition of graphene oxide can increase the ion transport resistance owing to the two-dimensional layered structure of graphene. Therefore, to obtain highly conductive composites with good cycle stability, many researchers have added carbon materials with different dimensions to the composite at the same time. Liu et al. [15] prepared a good water-soluble multiwalled carbon nanotube-graphene oxide (MWNT-GO) composite by sonicating and centrifugation. The MWNT-GO composite demonstrates enormous application potential in biomedicine and functional nanocomposites. Richa et al. [16] reported three-dimensional cyanocobalamin (Cbl)-selective biomimetic imprinted polymer nanocomposites. They found that when graphene oxide and CNTs are simultaneously added, not only the solubility of the material but also the conductivity is increased, and the concentration response to methyl blue is reduced by 0.0056 ng mL−1. Jiang et al. [17] successfully prepared a PANI/GO/CNT composite of planar films and helical fibers by a roller-dipping approach. Synergistic effects from three components result in excellent electrochemical performance, with high flexibility and stability under repeated deformation (e.g., bending, stretching) cycles. Yang et al. [18] synthesized graphene oxide (GO)/gold nanoparticle (AuNP)/multiwalled carbon nanotube (MWCNT) nanocomposites. The AuNP/MWCNT/GO composites show excellent catalytic capabilities toward the oxidation of hydrazine and the reduction of H2O2, and the recoveries of hydrazine and H2O2 are as high as 95% and 96%, respectively. The synergistic effect of CNTs and graphene oxide can significantly improve the chemical and physical properties of the composite. Although rGO-CNT nanocomposites are used in various fields, there are very few applications in electrochromism. Therefore, to improve the electrochromism performance of PANI, we prepared polyaniline-reduced graphene oxide-single-walled carbon nanotube (PANI-rGO/SWCNTs) nanocomposites with interfacial covalent bonds.

In this paper, we report the synthesis of PANI-rGO/SWCNTs nanocomposites by in situ polymerization. Graphene oxide acts as a carrier and provides a location for the growth of polyaniline. SWCNTs can increase the conductivity of nanocomposites by forming a conductive network. The combination of two kinds of different dimensional carbon nanostructures can significantly reduce the ion transport resistance while improving the electrical conductivity of the composites. PANI-rGO/SWCNTs nanocomposites have been found to exhibit novel electrochromic performance with fast color-switching speed, good cyclic stability, and high optical contrast.

Experiment

Materials

Aniline was distilled at reduced pressure prior to use. All other reagents were purchased from Sigma-Aldrich (Shanghai, China) and used as received.

Synthesis of p-phenylenediamine functionalized graphene oxide (rGO-PPD)

GO was prepared by a modified Hummers method [19]. rGO-PPD was synthesized through an amidation reaction using GO, thionyl chloride and p-phenylenediamine as reactants. In a typical experiment [20], GO and thionyl chloride were ultrasonically dispersed in 50 mL of anhydrous ethanol, and the above solution was heated to 50 °C with stirring for 30 min. Then, PPD in 25 mL of anhydrous ethanol was added to the previous dispersion and refluxed at 50 °C for 24 h. The resultant solution was centrifuged, and the sediment was washed several times with chloroform. The final rGO-PPD was stored in N,N-dimethylformamide (DMF). This process is shown in Scheme 1.

Scheme 1
scheme 1

Synthesis route of GO-PPD through an amidation reaction

Synthesis of p-phenylenediamine-functionalized single-walled carbon nanotubes (SWCNTs-PPD)

SWCNTs were first treated at 400 °C in air to remove any amorphous carbon and then oxidized with concentrated nitric acid and sulfuric acid to yield carboxylic acid-functionalized SWCNTs (SWCNTs-COOH). SWCNTs-PPD were prepared using a method similar to that used for rGO-PPD.

Synthesis of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites

PANI-rGO/SWCNTs were prepared according to the following procedure. First, 0.465 g of distilled aniline monomer, 5.11 g of an 18 wt.% polystyrene sulfonic acid (PSS) aqueous solution/DMF dispersion of rGO-PPD (2.32 mg) and SWCNTs-PPD (2.32 mg) and 100 mL of water were dispersed with the assistance of ultrasound and stirred in an ice-water bath for 10 min. Then, 1.14 g of ammonium persulfates dissolved in 10 mL of deionized water was dropped into the previous solution in three separate doses in 30 min. The reaction solution was stirred for 24 h at room temperature, producing PANI-rGO/SWCNTs nanocomposites. PANI-SWCNTs and PANI-rGO were synthesized using the same procedure as that used for PANI-rGO/SWCNTs nanocomposites but without the addition of GO-PPD and SWCNTs-PPD, respectively. PANI was also synthesized using the same procedure as that used for PANI-rGO/SWCNTs nanocomposites but without the addition of any functional carbon nanomaterials, rGO-PPD, or SWCNTs-PPD.

Fabrication of electrochromic devices

The electrochromic devices were fabricated using a previously published procedure [21]. The gel electrolytes were prepared by dissolving 0.5 g of LiClO4 and 1.5 g of poly(methyl methacrylate) (PMMA, Mw > 15,000) in a mixture of 8 g of propylene carbonate and 30 mL of acetonitrile with overnight stirring. The electrochromic films of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs were formed on 5 × 3.3 cm indium tin oxide (ITO) glass by the spin-coating method. For easy comparison, we used the same coating solution (0.5 mL) and the same rotation speed (1500 r/min) and finally obtained four kinds of electrochromic films with thicknesses of 220–230 nm. The gel electrolyte and another blank ITO glass were used as the electrolyte and counter electrode, respectively. A typical sandwich-structured device (ITO glass//active layer//electrolyte layer//ITO glass) was fabricated for the device test.

Characterization

Fourier transform infrared (FTIR) spectra of the materials were measured by a PerkinElmer GX FTIR spectrometer. The surface morphologies of the samples were obtained on a JEOL 7600F and Hitachi S4800 scanning electron microscope (SEM). Thermogravimetric analysis (TGA) was conducted using a Mettler Toledo TGA/DSC 1 STAR system with a heating rate of 10 °C/min from room temperature to 700 °C in N2. The UV–vis spectra of the dilute solutions in water were obtained using a SHIMADZU 2550 spectrometer with wavelengths from 300 to 900 nm. The in situ spectral-electrochemical properties of the devices were recorded using an Autolab PGSTAT302N potentiostat with a SHIMADZU 2550 UV–vis spectrometer. Cyclic voltammetry (CV) was performed over a potential range of −0.3 to 1.4 V in 1 M LiClO4/PC using an Autolab PGSTAT302N electrochemical workstation. Pt sheet and Ag/AgCl (3 M KCl) were used as the counter electrode and reference electrode, respectively. The electrochemical impedances of films were determined over the frequency range of 10−2 − 105 Hz with a signal amplitude of 5 mV with the same three-electrode electrochemical cell as that used for CV tests.

Results and discussion

Structures and morphologies of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites

FTIR spectroscopy is a powerful tool to ensure the molecular structure of samples. The FTIR spectra of SWCNTs-COOH, SWCNTs-PPD, GO, and rGO-PPD are shown in Fig. 1a. The FTIR spectra of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs are shown in Fig. 1b. In Fig. 1a, we can see that SWCNTs-COOH and GO contain a large number of oxygen groups after treatment with strong acid and oxidant. The absorbance bands of OH (v carboxyl) and C=O (carboxylic acid) at 1387 and 1636 cm−1, respectively, suggest that GO and SWCNTs-COOH were successfully synthesized. After reacting with PPD, the oxygen groups of GO and SWCNTs-COOH disappear. At the same time, some new peaks for PPD are observed at 3231 and 3342 cm−1 (v primary amine) and 151 and 1615 cm−1 (v benzene ring). Furthermore, the band of the asymmetric 1,4 substituent of the benzene ring appears at 824 cm−1, and the C–N stretching band of the amide group is at 1086 cm−1, which indicates that one of the amine groups of PPD reacts with GO and SWCNTs-COOH, resulting in an amide band at 1636 cm−1. In Fig. 1b, PANI shows two characteristic PANI peaks, the C=C stretching vibrations of quinonoid and benzenoid rings at 1602 and 1487 cm−1, respectively. PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs exhibit almost the same characteristic peaks as those of PANI. However, some different peaks are also observed. First, the doublet peaks attributed to the primary amine at 3145 and 3016 cm−1 are replaced by a single peak at 3249 cm−1 attributed to the secondary amine. Second, the quinonoid stretching bands of rGO-PPD and SWCNTs-PPD at 1602 cm−1 are shifted to 1587 cm−1 for PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs owing to the short and rigid conjugated structure of the grafted PANI chains on the carbon nanostructure [22]. In Fig. 1b, all the curves show the characteristic bands of –SO3H and –SO2 at 1036 and 1126 cm−1, respectively, which come from the dopant agent PSS. In conclusion, GO and SWCNTs-COOH are reduced in the process of amino functionalization of PPD, and covalently bonded PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs have been synthesized successfully.

Fig. 1
figure 1

FTIR spectra of (a) GO, GO-PPD, SWCNTs-COOH, and SWCNTs-PPD and (b) PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs

The microstructures and morphologies of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs were observed by SEM. For clear observation, the film surfaces were etched by water to create a gap for the appearance of carbon nanostructures. As shown in Fig. 2a, with some PANI dissolved and removed by water, a gap appears in the spin-coated PANI film. As shown in Fig. 2b, the lamellar structure of PANI-rGO can be clearly seen after some PANI is dissolved by water. Because graphene has a large specific surface area, it can act as a substrate, providing a large support area and more nucleation sites for PANI. However, this lamellar structure may block the transport of ions and decrease the ionic conductivity of the material if overdosed rGO-PPD is added. As shown in Fig. 2c, many fibrous CNTs appear at the gap of the PANI films. The conductive network created by CNTs can significantly enhance the electron transport property of the material. However, compared with rGO-PPD, SWCNTs-PPD have fewer nucleation sites (or PPD groups), and the interaction between PANI and SWCNTs is relatively weaker. Thus, PANI-SWCNTs are liable to swell and shrink during the redox reaction, so the stability of the material will be affected. As shown in Fig. 2d, it can be seen from the gap and edge of the film that rGO and fibrous SWCNTs are dispersed in the PANI-rGO/SWCNTs composite matrix. The synergistic effect of rGO, SWCNTs, and PANI not only provides a channel for ion transfer but also constructs a conductive network to improve the electron conduction of PANI-rGO/SWCNTs. Enhanced electrochemical and electrochromic properties can be expected.

Fig. 2
figure 2

SEM images of PANI (a), PANI-rGO (b), PANI-SWCNTs (c) and PANI-rGO/SWCNTs

Thermal stability is one of the significant factors for the practical application of electrochromic materials. As shown in Fig. 3, the TGA curves of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs can be divided into three stages. In the first stage, from room temperature to 150 °C, there is a slight weight loss due to evaporation of absorbed water and volatile compounds. The second stage appears from 200 to 550 °C with a large weight loss. At this stage, we can see that PANI has the greatest mass loss compared with other nanocomposites because of the decomposition of the organic groups and doping agent PSS and breakage of the polymeric backbone of PANI. The third stage appears from 550 to 700 °C with a minor weight loss, which may be related to carbonization of PANI accompanied by removal of N and H. At 700 °C, 10%, 30%, 33%, and 35% of the initial weights are retained for the PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites, respectively. It can be clearly seen that the addition of rGO and SWCNTs to form a covalently bonded complex with PANI can significantly improve the thermal stability of PANI.

Fig. 3
figure 3

TGA curves of PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs

To study the effect of rGO and SWCNTs on the conjugated structure of PANI, aqueous solutions of PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs were analyzed by UV–vis spectroscopy, as shown in Fig. 4. The UV–vis curve of PANI shows three absorption peaks corresponding to the π–π* transition of benzenoid rings, the polaron band-to-π* band transition and the π band-to-polaron band transition at 343, 430, and 809 nm, respectively [23, 24]. With the addition of rGO and SWCNTs, we can see that the positions of the π–π* transition and polaron-π* transition absorption peaks in PANI, PANI-SWCNTs, PANI-rGO, and PANI-GO-SWCNTs do not change, but the π-polaron band shifts to 806, 795, and 793 nm, respectively. Compared with PANI, the UV–vis absorbance peak of PANI-rGO/SWCNTs is blueshifted by 16 nm. We can conclude that the rich active sites (PPD groups) on the carbon nanostructures can result in many short and rigid PANI chains, as proven by the FTIR spectra. The short and rigid PANI chain can cause a blueshift of the UV–vis absorbance peak of the π-polaron transition.

Fig. 4
figure 4

UV–vis absorbance curves of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites

Electrochemical and electrochromic properties of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites

From the CV curve (Supporting information, Fig. S1), we can determine the electrochemical activities of the materials based on the redox peak current density and the position of the peak. We can clearly observe two pairs of peaks—one attributed to the transition of PANI from its leucoemeraldine salt state to the emeraldine salt state and the other related to the formation of a fully oxidized state—and their corresponding reverse transitions. As the sweep voltage increases, we can see that the oxidation peaks shifts to the positive direction and that the reduction peak shifts to the negative direction, which proves that the redox process is affected by ion diffusion. In Fig. S1-e, with a sweep speed of 100 mVs−1, the peak current density increases with the addition of carbon material, especially when both rGO and SWCNTs are added simultaneously. The first peak current density of PANI-rGO/SWCNTs is as high as 2.8 × 10−3 A cm−2, which is higher than the values of 1.6 × 10−3 A cm−2 for PANI, 1.7 × 10−3 A cm−2 for PANI-rGO and 1.8 × 10−3 A cm−2 for PANI-SWCNTs. Similarly, the current density of the first reduction peak of PANI-rGO/SWCNTs is −3.4 × 10−3 A cm−2, while the current densities of PANI, PANI-rGO, and PANI-SWCNTs are −2.3 × 10−3, −2.4 × 10−2 and −2.5 × 10−2, respectively. At the same scan rate, we can see that the CV areas of PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs are larger than that of PANI. In particular, PANI-rGO/SWCNTs possess the largest CV area. This can be attributed to the fact that the addition of rGO and SWCNTs increases the electrical conductivity of the composite and increases the electrochemical activity. The simultaneous addition of rGO and SWCNTs cannot only enhance the electrical conductivity of the material but also reduce the charge transfer resistance and ion diffusion resistance. In Fig. S1-f, by analyzing the relationship between the current density and the square root of the scan rate, we find that they have a linear relationship. It can be further proven that the redox reactions of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs are controlled by ion diffusion. The slope of the curve can represent the diffusion coefficient of the materials. By comparing the curve slopes, nanocomposites have slightly higher slopes than PANI, especially PANI-rGO/SWCNTs, which have the largest slopes, which can be attributed to the loose PANI molecule packing induced by the introduction of carbon nanostructures. The high diffusion coefficient can have a positive influence on the switching speed of electrochromic materials.

The electrochromic properties of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs were tested by measuring the in situ UV–vis spectra in the visible region from 400 to 800 nm with various potentials from −2.0 to +1.8 V. To maintain uniformity of the test, the active layers in all devices maintain the same area (2.5 × 2.5 cm) and the same thickness (~220 nm). As the negative voltage increases, we find that the absorbance peaks are redshifted, and the color of the device is pale yellow when the voltage reaches −2.0 V. When a positive voltage is applied to the device, the absorbance peaks are blueshifted, and the devices exhibit a sky blue color when the applied voltage is 1.8 V. Photographs of the color change are shown in Fig. 5. In Fig. 6a, PANI exhibits a total change in absorbance (ΔA) of 0.39 at a wavelength of 691 nm (maximum absorbance, λmax). With the introduction of rGO-PPD or SWCNTs-PPD, the optical contrast is increased to 0.46 for PANI-SWCNTs at a λmax of 681 nm and to 0.48 for PANI-rGO at a λmax of 694 nm, respectively. When rGO-PPD and SWCNTs-PPD are added at the same time, the absorbance of PANI-rGO/SWCNTs is increased to 0.53 at a λmax of 670 nm. Compared with PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs exhibit nearly 16%, 23% and 35% contrast enhancement, respectively. The enhancement of the electrochromic properties can be attributed to the enhanced electrical conductivity, ion mobility, and promoted redox reactions. In other words, due to the high specific surface area and abundant PPD groups of rGO-PPD and SWCNTs-PPD, more active sites can be provided for the growth of PANI. In addition, carbon nanostructures are uniformly dispersed in the composite. The multidimensional nanostructures, high conductivity and strong interaction between PANI and carbon nanostructures create an effective conductive network and loose packing structure, thereby reducing ion and electron transport resistance and improving the electrochemical and electrochromic properties of PANI.

Fig. 5
figure 5

Photographs of PANI-rGO/SWSCNTs with different colors under different voltages

Fig. 6
figure 6

Absorbance spectra of the electrochromic devices with PANI (a), PANI-rGO (b), PANI-SWCNTs (c), and PANI-rGO-SWCNTs (d) as the electrochromic layers at potentials of −2.0, −1.8, 0, 1.4, 1.6, and 1.8 V in the visible range

The switching speed represents the response of the electrochromic material to the voltage. The faster the switching speed is, the higher the redox activity of the electrochromic material. Figure 7 shows the switching curves of PANI-, PANI-SWCNTs-, PANI-rGO-, and PANI-rGO/SWCNTs-based devices under a step potential. With the addition of rGO-PPD and SWCNTs-PPD, the optical contrast and switching speed of PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs nanocomposites increased significantly compared with those of PANI. The optical contrasts are 0.25, 0.30, 0.32, and 0.35 for PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs, respectively. The coloring and fading time of the device can be calculated by recording the time at which the device finishes its 90% coloring or bleaching process. Accordingly, the coloring and fading times are 2.59 and 2.39 s, 2.12 and 1.72 s, 1.63 and 0.94 s, and 1.33 and 0.78 s for PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs, respectively. When the rGO and SWCNTs are simultaneously added, the coloring time is reduced to half of PANI, and the fading time of the PANI-rGO/SWCNTs is shortened to one-third that of PANI. This can be attributed to the fact that the addition of graphene oxide and CNTs not only enhances the electrical conductivity of the composite but also builds a loose micro-nanostructure in the composites, which enhances the ion transport rate and reduces the charge transfer resistance, thereby reducing the coloration and fading time, which is further confirmed by EIS analysis.

Fig. 7
figure 7

Optical absorbance at λmax for the devices using PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs as the electrochromic layers under the step potential oscillating between +2.0 and −2.0 V with 20 s intervals

To obtain more electrochemical information about the material, electrochemical impedance spectroscopy (EIS) was performed in the range of 10−2 to 105 Hz. Nyquist plots of PANI, PANI-SWCNTs, PANI-rGO, and PANI-rGO/SWCNTs are given in Fig. 8. The four curves exhibit the same shape, with a semicircle in the high-frequency region and a straight line in the low-frequency region. The intercept with the X-axis represents the ionic resistance of the electrolyte and the contact resistance of the active material/ITO glass interface. In the high-frequency region, based on the diameter of the semicircle, we can estimate the charge transfer resistance (Rct). The values of Rct for the PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites are 135, 48, 35, and 30 Ω, respectively. With the addition of a carbon material, the value of Rct is significantly reduced. Although PANI-rGO and PANI-SWCNTs have the same mass loading as rGO-PPD and SWCNTs-PPD, respectively, the Rct of PANI-rGO is higher than that of PANI-SWCNTs because the unique two-dimensional graphene layer structure is easy to stack and hinders ion diffusion. When rGO-PPD and SWCNTs-PPD are added at the same time, PANI-rGO/SWCNTs have the lowest Rct, which can be attributed to the addition of SWCNTs as a spacer to avoid the aggregation of rGO nanosheets. At the same time, CNTs also serve as a bridge to connect different rGO sheets, thereby improving the conductivity of the material and enhancing the transfer efficiency of charges and ions. According to the electrochemical analysis and electrochromic performance of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs, we can see that the electrochromic properties and electrical conductivity of the nanocomposite containing graphene oxide and CNTs at the same time are greatly improved compared with the individual addition of rGO or SWCNTs.

Fig. 8
figure 8

Nyquist plots of PANI, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites

Conclusions

In this paper, covalently bonded PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites were successfully synthesized using an in situ polymerization method. Due to the high conductivity, novel nanostructures of rGO and SWCNTs, PANI-rGO, PANI-SWCNTs, and PANI-rGO/SWCNTs nanocomposites exhibit superior electrical conductivity and electrochromic properties compared with PANI. In particular, PANI-rGO/SWCNTs demonstrate the best performance, as rGO-PPD can act as a substrate to provide a large support area and more nucleation sites for PANI, and SWCNTs can act as conductive spacers for separating rGO nanosheets. PANI, rGO, and SWCNTs can form an effective conductive network with a loose PANI molecular packing structure, which improves the conductivity of the material and reduces the charge transfer resistance. As a result, the PANI-rGO/SWCNTs-based electrochromic device shows excellent performance, the absorbance is increased from 0.39 to 0.53, and the coloring and bleaching times also decrease from 2.59 and 2.39 s for PANI to 1.33 and 0.78 s for PANI-rGO/SWCNTs.