An electronic device is provided. The electronic device includes a housing, light emitting diodes (LEDs) of a first number, photodetectors of a second number, and a control circuit operatively connected to the LEDs and the photodetectors. The control circuit is configured to cause the LEDs of a third number to emit light sequentially or simultaneously and to cause the photodetectors of a fourth number to detect light from the LEDs of the third number. The third number is 1 or 2. The fourth number is one of an integer that is not less than 2 and is not greater than the second number.