An optical sensor for sensing information relating to an analyte liquid or
gas, has a a planar substrate having a refractive index n.sub.c. The
planar substrate supports a ridge waveguide having an unclad top portion
having a refractive index n.sub.r. The substrate serves as cladding layer
for the ridge waveguide at a location where the ridge waveguide contacts
the substrate. A Bragg grating inscribed in the ridge waveguide has two
modes for providing information relating to both temperature and
refractive index of the surrounding analyte liquid or gas. A cladding
mode has a different response to the analyte when compared to a Bragg
resonance response. Both modes have a same reaction to temperature,
wherein said Bragg grating is formed within the unclad region of ridge
waveguide, wherein n.sub.c.