An ingestible device (10, 300, 302, 304, 306, 308, 1900, 2500), comprising: a housing; one or more units (32,42, 332, 334, 342, 344) associated with the housing, the one or more units configured to: transmit a first wavelength of light towards an environment external to the housing; detect the first wavelength of light after it has reflected from the environment external to the housing; transmit a second wavelength of light towards the environment external to the housing, the second wavelength being different from the first wavelength; and detect the second wavelength of light after it has reflected from the environment external to the housing; and a processing module associated with the housing, the processing module configured to: at periodic intervals, store a first value in a first data set, the first value being indicative of an amount of light detected by the device at the first wavelength and store a second value in a second data set, the second value being indicative of an amount of light detected by the device at the second wavelength; identify a known or estimated location of the ingestible device; and determine a change in the known or estimated location of the ingestible device within the gastrointestinal tract of the body based on a comparison of the first and second data sets with each other. a housing; one or more units (32,42, 332, 334, 342, 344) associated with the housing, the one or more units configured to: transmit a first wavelength of light towards an environment external to the housing; detect the first wavelength of light after it has reflected from the environment external to the housing; transmit a second wavelength of light towards the environment external to the housing, the second wavelength being different from the first wavelength; and detect the second wavelength of light after it has reflected from the environment external to the housing; and transmit a first wavelength of light towards an environment external to the housing; detect the first wavelength of light after it has reflected from the environment external to the housing; transmit a second wavelength of light towards the environment external to the housing, the second wavelength being different from the first wavelength; and detect the second wavelength of light after it has reflected from the environment external to the housing; and a processing module associated with the housing, the processing module configured to: at periodic intervals, store a first value in a first data set, the first value being indicative of an amount of light detected by the device at the first wavelength and store a second value in a second data set, the second value being indicative of an amount of light detected by the device at the second wavelength; identify a known or estimated location of the ingestible device; and determine a change in the known or estimated location of the ingestible device within the gastrointestinal tract of the body based on a comparison of the first and second data sets with each other. at periodic intervals, store a first value in a first data set, the first value being indicative of an amount of light detected by the device at the first wavelength and store a second value in a second data set, the second value being indicative of an amount of light detected by the device at the second wavelength; identify a known or estimated location of the ingestible device; and determine a change in the known or estimated location of the ingestible device within the gastrointestinal tract of the body based on a comparison of the first and second data sets with each other.