This work presents the principles of a novel micro-optical system for micro- and nano-fluidic analysis. It is based on diffraction, occurring in total internal reflection conditions. The developed detector is integrated in an autonomous micro-fluidic device, produced by a unique combination of different techniques for micro- and nano-structuring and micro-machining. The micro-fluidic sensor is examined both experimentally and theoretically with respect to the parameters of the light and the diffraction grating. The most beneficial configurations with respect to maximum sensitivity towards the fluidic optical constants are discussed. Optical experiments show sensitivity of 5×10-4 to the fluidic refractive index and of 3.5×106 m-1 to the absorption coefficient. Envisioned applications of the integrated micro-sensor are concentration and composition analysis, environmental protection control, medical, biological and chemical diagnostics, and so on.