Abstract Stilbazolium merocyanine (1-(12-hydroxydodecyl)-4-[(3-hydroxy-4-oxocyclohexa-2,5-dienylidene)-ethylidene]-1,4-dihydropyridine) was investigated in form of Langmuir and Langmuir–Blodgett films for potential sensor of environment pH and presence of metal ions applications. Two forms of the merocyanine, free-base and protonated were observed in Langmuir films depending on the pH of subphase. The complex comprised of merocyanine and Cu 2+ or Co 2+ metal ions are also able to form stable Langmuir films which compression isotherms are different from non-complex merocyanine. Also films composed of a mixture of merocyanine and fatty acid (eicosanoic acid) were prepared. Attractive and repulsive interactions between molecules in mixture films were observed. All types of the films were successfully transferred onto hydrophobic quartz plates for the purpose of producing solid samples of ultrathin sensors. Multilayers of free-base merocyanine films remain sensitive to the pH of the environment. From the changes in absorbance spectra of the merocyanine film it is possible to evaluate the pH of the microenvironment.