Highly soluble polyaniline was synthesized from a newly designed aniline derivative, namely 2‐[2‐chloro‐1‐methylbut‐2‐en‐1‐yl]aniline. The corresponding polyanilines, PClPA‐HA, PClPA‐SA, PClPA‐NA and PClPA‐PA, were characterized by means of 1H NMR, 13C NMR, high resolution mass spectroscopy, Fourier transform infrared spectroscopy, ultraviolet–visible spectroscopy and SEM images. The elemental analysis and electrical conductivity of the polymers are also presented. It is shown that the molecular weight of the polymers obtained depends on the method of synthesis. Spectroscopic studies confirmed the emeraldine form of the polyaniline derivatives. In the work, the dependence of the current passing through resistive structures based on thin poly[2‐(2‐chloro‐1‐methylbut‐2‐en‐1‐yl)aniline] films on the relative humidity of air was studied. The results of the studies showed the prospects of using thin polymer films in the design of chemical sensors. © 2020 Society of Chemical Industry