Which device?
More:
The modern submarine has hundreds of devices on-board used for anything imaginable. Most devices have back-ups. The nuclear reactor has a back-up diesel. There are at least 2 primary propulsion plants. Even the distiller has a smaller back-up. The distiller is the second most important device to an underway crew. Without it there is not enough water for showers. Moral would plummet and no one likes a smelly shipmate.
A standard viewing device used on a submarine is a periscope.
A periscope.
Ballast tank
ASDIC
Sonar is used to detect other vessels or ships/submarines through a tube-like device> Andrea
location and ranging submarines
This sounds like it's probably the sonar system of a submarine.
During WW2, all the major countries involved used submarines.
By an electronic device called 'sonar' .
They were used by submarines to navigate when not in open waters, They were also used by submarines and anti-submarine ships to locate enemy submarines.
Submarines todaee are used for underwater exploration,funn,new life underwater.
Shallow diving submarines are used for reef watching in many parts of the world.