Polyaniline (PANI) films and its electrochromic devices based on various porous substrates were obtained by electrochemical deposition. The pore size distribution of the porous substrate has shown important influence on the infrared emissivity variation (∆ε) of the device. Morphology and structure of PANI were characterized by scan electronic microscopy (SEM) images and Fourier transform infrared spectra (FTIR). SEM images present the morphology difference of PANI on different substrates, which suggest that large pores will prevent PANI particles from forming orderly and compactly films. FTIR spectrum indicates that pore size of substrates affects the orientation of PANI chains. Furthermore, electrochemical properties and stability of PANI films were analyzed by cyclic voltammetry (CV) curves. And the CV curve revealed that the generation of irreversible degradation products is the reason for poor stability of PANI films. Finally, greatly improved ∆ε of 0.559 in 3–5 μm waveband and 0.39 in 8–14 μm waveband is achieved by choosing a small pore substrate.