1 Introduction

Polymer electrochromic materials (PECMs) are highly flexible and exhibit rich color variations, rapid responses, and high contrasts, along with controlled experimental conditions [1, 2]. They are essential for flexible-display, wearable-electronics, and optical-detection applications [3, 4]. Therefore, various PECMs (polythiophenes [5], polyanilines [6], and donor–acceptor-type polymers [7]) have been developed and reported over the decades.

Triphenylamine (TPA) and its derivatives exhibit stable and rich color changes at low oxidation voltages. Their outstanding morphologies and thermal  stabilities make them highly desirable as photoelectronic materials. Several TPA-based polymers have been investigated as electrochromic materials. Miao et al. synthesized dual-function electrochromic polymers containing TPA groups that exhibit memory-storage functions [8]. These polymers are highly soluble, thermally stably, and fluorescent. Furthermore, they exhibit excellent “write–read–erase–rewrite” property. TPA-based polyimides that are highly stable and do not show any obvious color changes have been used in the semiconductor and electric-packaging industries [9, 10]. Polymers with broad spectral responses (400–2100 nm) have been prepared by modifying or salifying groups [11, 12]. Liou et al. reported a sequence of TPA-based polymers with high contrast ratios, outstanding coloration efficiencies, and multiple color-change capabilities. Furthermore, they fabricated thermally stable electrochromic devices that were multicolored and flexible [13,14,15].

Electrochromic properties are fundamentally determined by the structure of the polymer backbone. And excellent TPA-based PECMs with various backbone structures have been reported, including TPA/metal complexes (multiple redox processes) [16, 17], TPA/electron-accepting conjugate polymers (good film-forming characteristics, high coloration efficiencies, and near-infrared spectral responses) [18, 19], TPA/imide polymers (high electrochromic performance) [20, 21], and TPA/electron-donating conjugate polymers (multicolored and convenient to operate) [22, 23]. Indole groups are attractive owing to their high stabilities and oxidative activities. The P5Fin polymer can transition between green (neutral state) and blue–black (oxidized state) for long times with a long-term memory effect [24]. Polyindole is a promising material for several energy-storage applications, including supercapacitors [25]. Presently, 3,4-ethylenedioxythiophene (EDOT) is another group used in the electrochromic field. Co-polymerizing EDOT with other monomers is a good method for improving performance and electropolymerization activity [26, 27].

In this study, we synthesized four novel TPA-based polymer films containing indole and EDOT moieties via electropolymerization; this method facilitates convenient control over film thickness and polymer structure. The three electrochromic groups in the polymer backbone contribute to high color variations. The polymer structures were tuned by adjusting the proportions of the TPY (N4,N4′-bis(4-((6-(1H-indol-1-yl)hexyl)oxy)phenyl)-N4,N4′-diphenyl-[1,1′-biphenyl]-4,4′-diamine) and EDOT monomers. Double-layer electrochromic devices (ECDs) were fabricated in which polymer films and WO3 act as active layers; these devices exhibited wide voltage-dependent spectra. Superior contrast and coloration efficiencies were obtained compared to those of similar polymers. The EDOT content was found significantly affect polymer-film thickness, contrast, and memory. The structure–activity relationship was preliminarily explored. This study provides a convenient reference point for future research in this area. It should be emphasized that the oxidized TPA-EDOT co-polymers absorb strongly in the near-infrared region (> 800 nm) while fully absorbing across the visible region; some also performed memory tasks effectively.

2 Experimental

Acetonitrile (ACN) and dichloromethane (DCM) were purified via distillation prior to use. Polymethacrylate (PMMA), polycarbonate (PC) and LiClO4 were commercial purchase and used directly. Indium-tin-oxide-coated (ITO-coated) glass substrates were purchased from commercial sources and cleaned by sequential sonication in an alkaline rinse, deionized water, acetone, and isopropyl alcohol prior to use. TPY was synthesized by laboratory staff (NMR data are available in the Supporting Information). EDOT was purchased from commercial sources. Atomic force microscopy (AFM) was performed on an SPA300HV instrument equipped with an SPI3800N controller (Seiko Instruments, Japan) in tapping mode under ambient conditions using silicon cantilevers (Applied Nanostructures, nominal spring constant: 2.0 N/m; nominal resonance frequency: ∼75 kHz). Scanning electron microscopy (SEM) images were obtained using a field-emission scanning electron microscope (XL30 ESEM-FEG, Philips, Netherlands) at an accelerating voltage of 10 kV. Electrochemical experiments were performed using a CHI660b electrochemical workstation in an argon atmosphere at room temperature. UV–Vis-NIR absorption spectra were recorded using a Shimadzu UV-3700 spectrophotometer. Film thicknesses were determined using a step profiler (KLA-Tencor D600).

2.1 Polymer-film electropolymerization

The monomers (TPY and EDOT) were co-polymerized in a conventional three-electrode system, with ITO as the working electrode, Pt wire as the counter electrode, and Ag/Ag+ as the reference electrode. A cyclic voltage of between 0 and 1.4 V was applied. Polymer films in 0.1 M solutions of n-Bu4NPF6 in dry acetonitrile were subjected to spectroelectrochemistry in transparent electrochemical cells.

2.2 Fabricating electrochromic devices (ECDs)

Each ECD contained a polymer-film-coated ITO anode and a WO3-coated ITO cathode, with a PMMA-based gel electrolyte used as the conducting medium. A 70:20:7:3 ACN:PC:PMMA:LiClO4 gel electrolyte was prepared according to the literature. After being formed, the transparent gel was carefully coated onto the WO3 electrode, and the polymer electrode was placed on the gel electrolyte. A 10 × 10 mm ECD active area was maintained.

3 Results and discussion

3.1 Electropolymerization and electrochemical characterization

Four polymer films (PTPY, PTPY–EDOT-1, PTPY–EDOT-2, and PTPY–EDOT-3) (Fig. 1) were prepared by anodic electrochemical polymerization, during which cyclic voltammetry (CV) was performed in the 0–1.4 V range at 50 mV/s. PTPY was obtained by homopolymerizing TPY, while the other three polymer films were obtained by co-polymerizing TPY and EDOT in various proportions: m(TPY):m(EDOT) = 10:1, 8:1, and 5:1.

Fig. 1
figure 1

The electropolymerization of polymer films

As shown in Fig. 2, the TPY monomer was electroactive, and repeated cycling led to a dramatic increase in current, which indicated that a conductive polymer film had been deposited on the ITO working electrode. Two pairs of redox couples were observed, and the PTPY film became more difficult to oxidize owing to the higher oxidation onset. The polymer film was electroactive, with first and second oxidation potential of 0.67 and 0.76 V, respectively.

Fig. 2
figure 2

A Cyclic voltammogram (CV) during electropolymerization of TPY in ACN. B CV of monomer TPY and PTPY film

TPY was poorly soluble in ACN; consequently, forming a thick polymer film in a short time was difficult. Therefore, we used DCM instead of ACN, and the EDOT monomer was added to simultaneously enhance polymer depositability on ITO. EDOT monomer inserting to the polymer chain improves electrochemical, optical, and film-forming properties of polymers [28]. PTPY–EDOT co-polymer electropolymerization results are shown in Fig. 3. While the addition of EDOT increased the oxidation potential, it decreased when the EDOT content exceeded a critical value. Noticeably, the highest oxidation potentials of 0.97 V were obtained at m(TPY):m(EDOT) = 8:1.

Fig. 3
figure 3

The CV of electrochemical polymerization of PTPY–EDOTs: A PTPY–EDOT-1, B PTPY–EDOT-2, C PTPY–EDOT-3

As respected, the introduction of the EDOT monomer affected the conductivity of the polymer film. Figure 4 shows CV traces obtained for the co-polymerization of PTPY–EDOT-1, which shows that the current gradually increases between 0.4 and 0.9 V as the number of scanning cycles was increased. However, the current decreased in the 0.9–1.4 V range, and also decreased in the 0.4–0.9 V range when the number of repetitive cycles exceeded ten. That indicates the conductivity of PTPY–EDOT-1 declined gradually with increasing film thickness. A co-polymer was initially obtained due to the high activity of EDOT.

Fig. 4
figure 4

The electrochemical polymerization of PTPY–EDOT-1: A the first 10 circles, B the continued 25 circles

Polymer-film thickness was controlled by adjusting the number of scanning cycles, with a higher number of cycles leading to a thicker film; however, the growth rate was lower. The thickness of the homopolymer PTPY film increased slowly; on the other hand, the thicknesses of the co-polymer film initially increased rapidly and then decreased. Meanwhile, the growth rates of the PTPY–EDOT films were observed to be similar, which, as discussed above, was consistent with co-polymerization occurring first, followed by homopolymerization. The relationship between film thickness and cycle number is summarized in Table 1.

Table 1 The interrelation of film thickness and cycle number

3.2 Film morphologies

The homopolymer film exhibited a porous-like structure with a surface that presented a tubular concave–convex morphology (Fig. 5A and B). Roughness was observed to decrease with increasing film thickness. The PTPY–EDOT-1 co-polymer aggregated into a grid and exhibited a very distributed morphology owing to the introduction of EDOT (Fig. 5C); however, it exhibited a porous-like structure with a tubular concave–convex morphology similar to that of PTPY with increasing PTPY–EDOT-1 film thickness (Fig. 5D). We infer that a TPY/EDOT co-polymer was first deposited on the working electrode in the TPY–EDOT system, and that the EDOT content gradually decreased to zero as electrochemical polymerization progresses, with a TPY homopolymer subsequently deposited on the surface of the co-polymer.

Fig. 5
figure 5

AFM micrographs of the polymer films (embedded pictures are TEM images): A PTPY film of 80 cycles, B PTPY film of 200 cycles, C PTPY–EDOT-1 film of 10 cycles, D PTPY–EDOT-1 film of 15 cycles

3.3 Spectroelectrochemistry

Figure 6 shows the spectroelectrochemical characteristics of the polymer films. The absorption spectra reveal that the thin films are highly transmissive in their bleached states and fully colored in their charged states. The film possessed an independent dual-wavelength response in visible (400–900 nm) and near–infrared (900–1500 nm) spectral regions under different voltages. The PTPY homopolymer was light yellow in the neutral state. Strong absorptions were observed at 354 nm, with a broad weak absorption at around 1000–1500 nm which ascribable to π–π* electron migration. The polymer began to oxidize and anion doping occurs as the oxidation potential was raised to 0.7 V. Stepwise increases in oxidation potential led to the gradual weakening of the absorption peak at 354 nm, and polaron charge-transfer peaks appeared at 410–480 nm and 730 nm, with a bipolaron migration peak simultaneously observed in the near-infrared region (> 1000 nm). PTPY turned brown.

Fig. 6
figure 6

Spectroelectrochemistry of: A PTPY, B PTPY–EDOT-1, C PTPY–EDOT-2, D PTPY–EDOT-3

The co-polymers exhibited significantly different spectral changes to those observed for PTPY. The neutral state of PTPY–EDOT-1 absorbed strongly at 500 nm (yellow–green) without any obvious peak, with two polaron charge migration peaks observed at 420 and 730 nm upon oxidation. However, characteristic PEDOT peaks were not observed, which indicates that EDOT was directly bonded to the TPY. In other words, EDOT did not self-polymerize. The neutral state of PTPY–EDOT-2 strongly absorbed at 300–500 nm. Stepwise increases in oxidation potential resulted in significantly enhanced visible-region absorption at 400–800 nm and revealed a tendency to absorb across the entire visible region, along with a light-brown to dark-brown color change. PTPY–EDOT-3, which contains the highest proportion of EDOT, exhibited strong spectroelectrochemical behavior. Two characteristic absorption peaks were observed at 480 and 720 nm following oxidation. In addition, significantly enhanced absorption was observed at wavelengths above 900 nm, and a bluish to blue–black color change was also observed. The absorption at the near–infrared region could be ascribed to the inter-valence charge transfer excitation caused by the electron coupling between neutral nitrogen and cation radial nitrogen or sulfur centers via the conjugate moiety [29]. These results show that a block co-polymers is formed at a critical EDOT content. The homopolymer and co-polymers could be reversibly converted between their neutral and doped states.

3.4 Electrochromic devices and performance

The PTPY device was yellow in the bleached state and brown–green at 1.7 V (Fig. 7), along with a significantly lower transmittance. Similarly, the color of the PTPY–EDOT-1 device changed from grayish-yellow (bleached state) to dark blue (colored state), along with a significantly lower transmittance.

Fig. 7
figure 7

Color changes of A PV-1 and B PV-1–EDOT-1 ECDs in bleached state and oxidized state

We acquired chronoamperometric spectra to determine the electrochromic contrast (Δ%T), switching time, coloration efficiency (CE), and memory effect of each polymer. The polymers were completely oxidized at 1.6 V, while potentials above 1.8 V led to over-oxidized and damaged films. Testing was performed under laboratory conditions. Here a square-wave potential step was maintained between − 0.5 and 1.7 V to probe transmittance–time profiles, with time intervals of 10, 5, and 3 s used at 720 and 480 nm.

The chronoamperometric spectrum of the PTPY ECD is shown in Fig. 8, which reveals a switching time (90% response time) of 10 s at 720 nm, a maximum contrast (Δ%T) of 36.7%, and a coloration efficiency of 418 cm2/C (Table 2). Compared with the similar electrochromic film reported by Pi that produced by oxidation electropolymerization of a triphenylamine derivative with an enhanced electron-withdrawing group (doubly N-methylated salt) [30], CE of PTPY ECD was much higher; while the contrast was 40% lower. Over all, compared with published similar triphenylamine-based polymer films and traditional polymer films, the contrast and CE were significantly improved [8]. Δ%T of the PTPY ECD was observed to drop to 19.1% at a switching time of 3 s because polymer requires a long time to completely oxidize; hence, contrast is severely time-dependent. An average switching time of 5.2 s was required for a 25% change in contrast. On the other hand, it needed 10 s for complete oxidation at 480 nm, with the highest electrochromic contrast of 26.9% observed. Δ%T dropped to 15.1% when the switching time was reduced to 3 s. This value is equal to other reported polymers [31].

Fig. 8
figure 8

Chronoamperometric spectrum of PTPY ECD: A was monitored at 720 nm and B was monitored at 480 nm

Table 2 Electrochromic performance of the ECDs

The electrochromic contrasts and coloration efficiencies of the PTPY–EDOT ECDs were significantly lower than those of the PTPY ECD (Fig. 9). The PTPY–EDOT-1, PTPY–EDOT-2, and PTPY–EDOT-3 ECDs exhibited contrasts of 22.8%, 8.6%, and 5.4%, respectively, at 480 nm; with values of 7.0%, 4.6%, and 3.4%, respectively, recorded at 720 nm. On the other hand, these ECDs switched faster than the PTPY ECD. A higher EDOT content clearly led to lower contrast. In addition, even lower electrochromic contrasts were observed at longer wavelengths, which suggests that the introduction of the EDOT monomer adversely affected the electrochromic contrast. That is quite different from some literature reports [32, 33].

Fig. 9
figure 9

Chronoamperometric spectrum of PTPY ECD and PTPY–EDOTs ECDs: A was monitored at 720 nm and B was monitored at 480 nm

These devices were quite stable, with contrasts showing almost no attenuation over 1000 switching cycles.

3.5 ECD memory effects

The ECD memory effect corresponds to the ability of the device to remain discolored for a period of time after the applied voltage had been terminated; this effect plays an important role in electronics research. The capability of trapping the electron within a particular redox state is an important criterion [34]. In the current case, electrooxidized TPA moiety is the leading cause for trapping electrons tardily in the electrolyte, ultimately leading to the remarkably long-lasting memory effect. We examined the memory effects of the PTPY and PTPY–EDOT ECDs by first applying a 1.7 V potential for 10 s, with transmittance–time curves recorded after removing the voltage. The PTPY ECD exhibited a memory time of approximately 3 min at 720 nm, while it was 20 min at 480 nm; hence this ECD exhibited a good electrochromic memory effect at short wavelengths (Fig. 10) [35]. In contrast, the PTPY–EDOT ECDs exhibited mediocre memory effects (< 3 min) (Fig. 11). It indicates that EDOT moiety contributed to the ability of polymer to trapping electrons.

Fig. 10
figure 10

Transmittance–time curve of PTPY ECD (A at 720 nm and B 480 nm)

Fig. 11
figure 11

Transmittance–time curve of PTPY–EDOTs ECDs (A at 720 nm and B 480 nm)

4 Conclusion

An electrochromic PTPY homopolymer and three PTPY–EDOT co-polymers were electrochemically synthesized from TPY, which contains triphenylamine and indole groups. The addition of EDOT led to significantly thicker polymer films. The co-polymer was formed first during co-polymerization. The four polymers exhibited excellent electrochromic properties. The PTPY–EDOTs exhibited more-colorful spectral behavior than PTPY. In particular, PTPY–EDOT-2 absorbed across the entire visible region, while oxidized PTPY–EDOT-3 absorbed fully across the visible region and strongly in the near-infrared region. Hence, these polymers are visible–near-infrared electrochromic materials. These results demonstrate that introducing EDOT into polymer backbone is an effective strategy to improve the polymer-film-forming property and broaden the spectrum response. The ECDs exhibited particularly different electrochromic performance. The PTPY ECD exhibited the best performance, with a maximum contrast of 36.7% at 720 nm and a coloration efficiency of 418 cm2/C. Response time ranged from 4 to 10 s, with a memory time of 20 min recorded at 480 nm for the PTPY ECD. Overall, this work provides new structure polymers for full color electrochromic display applications and energy-storage applications. TPY is very promising in the field of electrochromism. Nevertheless, two issues are need to further research: One is improving the film-forming property of polymers while maintaining its outstanding performance. And the other is maintaining the excellent properties of polymer active layer in the devices as it does in the film.