A novel excellent candidate for the optical pH sensor based on diazocine is presented in this paper. Diazocine serves as a cyclooctatetraene analogy which has a nonplanar 8‐membered ring structure with nitrogen atoms. It is the first example to present the optical properties of cyclooctatetraene analogy with chemical (trifluoroacetic acid) pH gradient by UV‐visible absorption and NMR spectra. Specifically, reversibility of protonation/deprotonation reaction is clearly demonstrated by the UV spectra when triethylamine is added. In this work, we also investigate the spectral properties and sensitivity of polydiaryldibenzo[1, 5]diazocines (PBDA) retaining its optical properties in liquid state. This study features an innovative detection system for H+ measurement through a low cost optical device by means of polymer spin‐coating on the support material (PE films). Furthermore, the optical characteristic collected in the solid state is in excellent agreement with the data previously found in the liquid state. The transient response of optical device is very rapid upon pH change from 6.9 to 1.5. As a result, optical device based on PBDA can be applied to test H+ or pH in organic or aqueous solvent and even extended to sensing of some other analytes.