Magnetic levitation used in technical applications such as transport systems in particular high-speed trains requires position control of the levitation system. It is precisely by suitable position control that there are no hazardous situations of contact of the mechanical parts outside the magnetic cushion, which can cause a dangerous state at very high speeds. However, for correct regulation, it is necessary to first turn out a reliable position sensing subsystem. It is precisely sensing the position using the optical method that this work is devoted to. The method of shielding is verified, when a smaller collimated beam falls on the photodiode. In order to measure the changes as accurately as possible, a laser collimating beam of light was chosen as the source.