Barrys Magnetic LevitationThis device uses two photodetectors: the “signal” detector looks for an interruption in the light beam, and the “reference” detector measures the background light. The circuit subtracts one signal from the other to determine the ball’s position. source