How I invented a bicycle, or rather a submarine controlled via mobile Internet

Hi everyone, I once saw that submarines with a long range, more or less tolerable functionality and less than the price of a brand new iphone are not sold and decided to do it myself.


It is controlled via the Internet, and now the mobile Internet covers a large area of ​​Russia. Small ponds are completely covered by it, and from the shores of large Internet there is even tens of kilometers from the coast.



Also, Elon Musk announced the creation of a worldwide Internet.

I decided to print the boat on a 3D printer, the models are made in compass_3d. The code is written in python 3.
Link to github .

Equipment and materials


• 3d printer
• Raspberry pi single board computer
• 4g modems (2 pieces)
• laptop (2 pieces 1st — transmitter, 2nd — server)
• servomotors
• webcam
• engine
• Pb batteries
• other (relays, soldering iron, sensors, adhesives, paints, sealants ...).

Details


As already mentioned, the details were printed on a 3D printer with a 0.3 mm layer with a 0.4 mm nozzle
on an aluminum table with a substrate of bf2 glue for better adhesion, the longest details were printed for about 14 hours. Bottom assembly drawing.



Tightness


For tightness, the servomotors and the leading BC motor are sealed with silicone sealant and grease. The boat itself, due to the size of its parts and the tendency of abs plastic to shrink (resizing after printing), in some places these places cracked with PVC glue, in places of bolted joints silicone sealant for aquariums.

Nutrition


As a power source - two 6 v lead-acid lead batteries in series capable of delivering 3.3 AmH, lead-acid batteries are used because they are cheaper, fewer charging contacts need to be routed outside the boat and they are also heavy (the boat is too bulky and its average density should be about 1000 kg / m ** 3).

Data transfer


Now about the main thing, data transfer.

Since water absorbs EMV, the modem must be brought to the top, so that boat operates with a float.

In the local network, at home, a server is installed that transfers everything arriving at it from one address to another. At the moment, the boat transmits the video, and the laptop commands the control. This is all organized through sockets.

Since I wanted to do as much as possible, in order to be more interesting , and to reinvent the wheel , I did the video transfer myself, as I already said, so without thinking up anything better, I decided not to transfer the video, but frames in jpg. One image is transmitted, then the stop word “stop” is poisoned, and since it does not occur in jpg, the code easily separates where and when to display the image.

while bytes('stop','utf-8') not in data:
          image_result.write(data)#записывает картинку по 1 Кб в файл
          data = sock.recv(1024)#принимает данные с сервера 1 Кб  
if bytes('stop','utf-8')  in data: 
            image_result.write(data[:data.index(bytes('stop','utf-8'))])#записывает в файл то что пришло до стоп слова



Playback pictures, and camera reception using opencv. There is no compression yet, so the delay is as much as 9-13 seconds. The control buttons are written using Tkinter.

3D bottom model


While uploading the 3D model to github, I saw what the stl file consists of, and decided to write code to create a 3D model of the bottom topography from the list of distances taken with it by an ultrasonic range finder (which has not yet been installed).

tetrahedron.stl example in txt
solid
facet normal 0 0 0
outer loop
vertex 0 0 0
vertex 2 0 0
vertex 1 1 2
endloop
endfacet
facet normal 0 0 0
outer loop
vertex 2 0 0
vertex 1 2 0
vertex 1 1 2
endloop
endfacet
facet normal 0 0 0
outer loop
vertex 0 0 0
vertex 1 2 0
vertex 1 1 2
endloop
endfacet
facet normal 0 0 0
outer loop
vertex 0 0 0
vertex 1 2 0
vertex 2 0 0
endloop
endfacet
endsolid



Next are photos interesting and not very

























Summarizing


This is actually all that I wanted to tell, my main idea who did not understand was the creation of an apparatus that allows receiving information from under water at a great distance from the control laptop. Bye, until the next article.

Only registered users can participate in the survey. Please come in.

Make an article about creating 3d models using python?

  • 76.2% Yes 80
  • 23.8% not 25