An ingestible device , comprising: a housing ; one or more units 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 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. <EOS>