This article describes the design process, development and assembling operation of the underwater drone prototype powered by Raspberry Pi.
I’ve watched a lot of programs about inventors on Discovery channel and once I decided to do something interesting by myself, so that it could be really impressive and difficult at a time: some electric motors, controllers, handling, camera. After buying a lot of useful (and not very useful) stuff, I began to think what kind of project should I start. Finally I came to the conclusion that there are a lot of flying and driving drones, but it’s not about underwater drones (ha ha, but as I understand now, I was terribly wrong then).
After surfing the Internet, I found several interesting projects, but most of them were either in the development stage or they were not to come cheap (3k++ dollars). Those who are interested in this projects can find some here.
Looking ahead, I can say that I’ve got a working prototype that can swim several meters deep, although it has its pros and cons. I can’t assert that finally I’ve got an easy-to-control stuff or stuff that can do more than just to calm down my engineer enthusiasm. But all the units of this stuff work properly, and it is very important that my mistakes and experience can help someone to create something really significant (even if it will be significant only for himself\herself).
As there was done a good deal of work, this article can be divided into the following chapters:
- Crazy idea (teaser)
- Choosing the components
- ESC programming
- Raspberry Pi Server configuration
- Electric motor handling using Raspberry Pi
- Raspberry Pi Flashlight control
- Client-server communication protocol
- Application for Android
- Video stream
- Screen and joystick control
- Construction assembling and testing
Crazy idea (teaser)
Well, Firstly I want to say that I am an amateur, and most of things I did, were done by scientific trial and error, because it is fun for me to construct something and test it, than to allow for all possibilities and understand, that it won’t work in theory. There was a variety of possible projects and ideas, and among them there were really absurd ideas (one of them will be described below, just for fun). The first and the main task for me was to construct sealed housing in domestic conditions and at the same time to transmit torque to the driving propeller. As it usually happens, the ideas in the beginning are not the smartest one (and I’m not used to thinking twice), so I tried an experiment with transmitting the torque using magnets. I’ve chosen the simplest design and constructed such a “high-tech” device:
Two magnets were screwed in gear and connected to the electric motors (respecting the polarities of the magnets), there is a plate between the gears which imitates the walls of the housing. If you have a desire to close the article and poke out your eyes after seeing this, this is a normal reaction, but I warned you at the beginning 🙂 Despite some defects, after launching the model, you can surely say: “And yet it moves” (c).
The torque is transmitted, the parts rotate, but magnetism increases friction. One more drawback, apart from dozens of others, is that if you stop an imaginary screw, then the magnets will lose their contact and won’t stick together one more time due to the speed difference
It won’t be the best idea even if you assemble such a model using bearings, gears and magnets, because efficiency, ease of implementation and just common sense are weak points of this model.
Finally, it was decided not to rack brains and take the brushless motor, and if necessary, cover the motor winding with varnish. So the idea was to put the wires out of the housing right into the water and just to seal them. It would be much easier than to construct a model with oil and oil seals or some other complicated mechanism in order to keep mechanic and electronic parts away from water.
So let’s move on to more important things.
Choosing the components
Below you’ll find a list of different stuff that was used to create the device.
Among the variety of controllers I’ve chosen Raspberry Pi 3B. I would not recommend Arduino-like boards for this project, because it won’t manage such a complex task, as it is necessary to control at least 4 motors, diodes, gyroscope, send video stream from the camera and at the same time receive and process commands from control devices. Raspberry Pi 3B comes with built-in Wi-Fi and Ethernet for RJ-45 connector, what will undoubtedly help you with all these operations.
Well, yes, you are right, a twisted-pair wire. It was always difficult to transfer the data under the water. Water is an excellent shield, and, therefore, you can forget about any wireless data transfer (fans of “and what about submarines” – please find out what is the size of the antenna for implementation of such a transfer and the cost of technology, complexity and width of the transmission channel). So there was no other way out. There was a checklist that was successfully passed:
- The ability to transfer data under the water.
- The speed of data transfer under the water.
- Universalism (it perfectly fits Raspberry Pi 3B and the transmitter).
There is a special cable for water with neutral floating and, but you can’t buy 100 meters separately, and I did not want to spend 500+ dollars on a reel.
NEXX mini router There were 3 main options of transfer:
- Try to wire a Wi-Fi antenna from water to land (in this case instead of a twisted-pair wire a solid wire should be used), but there were a lot of controversial points.
- Create a client-server bridge connection between two Raspberry Pi 3B (it would be appropriate, but more expensive and troubling).
- Connect a mini-router with Raspberry using a twisted-pair wire. This option was taken as the basis, as it is the most reliable, fast and cheap. Experience has proven that this is quite a good option.
After testing 3 different motors, I chose this model. You may ask why? Well, it is powerful enough, it has a second axis so you can use 2 propellers. In general, all motors operate normally in water until the algae or sand get inside the motor. If you choose high-speed and less powerful one, you’ll find out that these types of motors are not the best fit for water. Cheaper motors also fell short of expectations. Well, the quality meets the price.
Control board (ESC)
It’s also pretty simple. It can be programmed to switch forward/reverse, and the power of 30 amps should be enough for the tested motors. Besides, I did not have to wait for it for a month or two to deliver it from China (but, of course, there is one catch 🙂 ).
Afro ESC USB programming tool
Programming tool for ESC. With this device you can upload the necessary firmware. But actually, this is the catch. I had to wait a month and a half for it.
This model is intended to burn out everything with its light. So, this was the goal.
LED pulse driver
This is a perfect fit for our purposes – it holds two above-mentioned LEDs, and it also connects to the Raspberry and allows you to adjust the brightness of the LED.