1. A bio-sensing device, comprising:a light source circuit;
a first photodetector;
a transimpedance amplifier coupled to the first photodetector and configured to convert a current produced by the photodetector to a voltage;
an analog-to-digital converter (ADC) coupled to the transimpedance amplifier and configured to convert the voltage from the first photodetector to a digital value; and
a controller coupled to the ADC and the light source circuit and configured to:
initiate a light source sense phase followed by a first ambient sense phase and a second ambient sense phase, wherein in the light source sense phase, the controller is configured to receive a digital value from the ADC while the light source circuit is enabled and wherein in each of the first and second ambient sense phases, the controller is configured to receive a digital value from the ADC while the light source circuit is disabled, wherein a first time period between the light source sense phase and the first ambient sense phase is equal to a second time period between the first and second ambient sense phases; and
iteratively vary the second time period, while maintaining the first and second time periods equal, until the digital value received during the first ambient sense phase is within a threshold of the digital value received during the second ambient sense phase.