A method for diagnosing constipation comprising the steps of providing an ingestible capsule (20) having a given density and a pH sensor (22) and a temperature sensor (24), having a subject ingest the capsule, recording pH measurements from the pH sensor as a function of time as the capsule moves through at least a portion of the gastrointestinal tract of the subject, transmitting the pH measurements to a processor (19) outside of the gastrointestinal tract of the subject, recording temperature measurements from the temperature sensor as a function of time as the capsule moves through at least a portion of the gastrointestinal tract of the subject, transmitting the temperature measurements to a processor (19) outside of the gastrointestinal tract of the subject, determining transit time of the capsule between a first location in the gastrointestinal tract of the subject and a second location in the gastrointestinal tract of the subject as a function of the pH measurements and the temperature measurements, providing a reference transit time that is a function of the density of the capsule, and comparing the determined transit time to the reference transit time to evaluate the subject for constipation.