The Submarine is built from the Lego Wedo 2.0 educational kit. When a torpedo or other objects are detected, the periscope is set in motion due to the operation of the distance sensor installed in front of the submarine. To raise the periscope, a rack transmission was used.
The kit includes step-by-step building instructions and an example of program (in Lego Wedo 2.0 environment).