A nasopharyngeal cannula (1) comprising a main tubular body (2) made of soft and deformable material. The tubular body (2) comprises a bracket (3), provided with at least one support (4) for a sensor (5), which is associated, optionally slidingly, with its lateral walls; in the configuration for use the tubular body (2) is inserted within a nostril (A) of a patient (P) until its front (10) is aligned with the pharynx of the patient (P); the sensor (5), preset to measure the percentage of carbon dioxide that is present in the exhaled gas, is inserted at least partially in the other nostril (B) of the patient (P) and is struck by the exhaled flow.