Small submarine powered by Arduino Nano

Hi there!
I am planning to make a small submarine using Arduino Nano. This submarine will only swim inside the aquarium. I think there should be four small motors with propellers - to move up - down and left - right.
And what's the most important, it should swim near the glass wall, but not touching it. Does anyone have any idea, how should the arduino sense if the wall is near on not?

Also i think that making the electrical motors water resistant isn't so big problem as it is with bigger ones (ROVs and AUVs). I can use some lubricant or something..

Great idea for a project.
I think that if you have the sub do a random walk (well swim really) then it will just bounce gently off the walls and not get stuck. I would not worry about sensing. Except perhaps for a sensor to tell when it is on the surface.

So are you going to have some nervous fish in there too?

Well, no fish in the tank. Just trying to make something for my school science project. I am very fond of underwater vehicles. I think the hardest part would be to make the sub really dive and swim up. Must play a little with the weights.

You could cheat and simply fix some stiff but flexible transparent plastic "whiskers" to the front and sides of your sub. These will touch the walls and so keep the body away and with luck won't be seen when submerged
jack