An optical fiber sensor for measuring the pH in interstitial fluid is described. Microdialysis is the approach followed for extracting the sample from the subcutaneous adipose tissue. The interstitial fluid drawn flows through a microfluidic circuit formed by a microdialysis catheter in series with a pH glass capillary. The pH indicator (phenol red) is covalently immobilized on the internal wall of the glass capillary. An optoelectronic unit that makes use of LEDs and photodetectors is connected to the sensing capillary by means of optical fibers. Optical fibers are used to connect the interrogating unit to the sensing capillary. A resolution of 0.03 pH units and an accuracy of 0.07 pH units are obtained. Preliminary in vivo tests are carried out in pigs with altered respiratory function.