Ormosils were prepared in different ratios of tetramethoxysilane and organically modified sol-gel precursors of type R'Si(OR)(3) and R'Si-2(OR)(2). The pH indicator aminofluorescein was incorporated into various ormosils and the resulting materials were tested for their relative response to pH and dissolved ammonia at constant pH. R'Si-2(OR)(2)-based layers were recognized as the most promising materials because of their high permeability to ammonia, impermeability to ions (protons), long operational lifetime and good photostability. (C) 1998 Elsevier Science S.A. All rights reserved.