The oligomers consisting of both thiophene and indole moieties were synthesized. The conjugated oligomers show different bandgaps and absorption behaviors. An electrochromic device based on oligomer (P3) displays a novel four-color changes. The oligomer of P3 exhibits high sensitivity and selectivity for Zn2+ detection.