DIY : The World’s First Youtube-Powered Water-Drone – Jonny Kalambay – Medium
If you’d rather watch hear this story through a quick 4-minute video, I’ve got you covered:
The little guy in the picture above is Roshi. He is a one and a half year old Mississippi Map turtle and the inspiration for the world’s first Youtube-powered water-drone. Having had my interest sparked when I saw how Bryan Hughes made an fascinating use of his Raspberry Pi by hooking it up to his aquarium, I ordered one myself and decided to try my own aquatic project. Before I show you what this thing looks like. Let me show you how it works.
How It Works
The bot has a camera inside the Roshi’s tank that streams a live video feed to Youtube.From Youtube, I, or anyone else who’s watching the stream, can control the camera by writing comments in the live chat.If someone types in left, it the camera will turn left, if they type in right, it’ll turn right, it can also go down, backwards, forwards, and even up, even out of the water, in case you want to see Roshi on his rock. At the end of the article I’ll show you how to try it yourself.
How It Was Made
This bot is mainly just a Raspberry Pi 3, hooked up to a camera module, as well as some motors.
I work as software engineer, writing the code for this was relatively straightforward, but the hardware wasn’t. I haven’t actually built anything physical or wired up any electronics since middle school shop class, so just getting the motors working took me longer than I’d like to admit. And it gets worse. After wiring up the electrical components. With a project like this, typically you want to design a frame cut it out of wood or out of plastic using professional tools.That’s obvious to any DIY enthusiast. But I’m new to this, and, in case I haven’t made it clear, I have no idea what I’m doing.What did I do instead? I went to the dollar store, and got cardboard, chopsticks, microwave covers, paper cups and a bunch of other random stationery, and I ended up this absolute mess of a prototype.
Just to give you an example of the hacky craftsmanship is that went into this, I didn’t know how to make a waterproof casing for the camera and cable, so I gave up and just passed the whole thing through a long piece of poly tubing, that I closed off on one end with a heat seal.[ Camera module ]This machine isn’t pretty but it works, and unlike the sloppy frame, the software behind this work is something that I actually am somewhat proud of, so let’s talk about that.
The code is made of three main parts:
- A script written by Alex Ellis that runs on the Pi and uses a program called FFMPEG to encode the video feed from that camera and stream it to Youtube.
- A Node.js script I wrote, that tracks the Youtube comments in that stream’s live chat, checks certain keywords, and when it finds them, sends out commands.
- A Python server running on the Pi, which moves the bot around by turning on an off the different motors, based on the commands it receives from the Node server.
There are links in the description with all of the code. I know some of you are like me and you prefer being walked through how to write it, don’t worry that’s coming next.
Actually, there are a couple things that I’d like to do next with this project. For starters, this could use a much better view. Right now the only place I have to try this in is my Roshi’s tank, but it would be much more interesting to use in a bigger aquarium with lots of fish and other animals. That would make for a really immersive experience, almost like virtual scuba diving.
Maybe one day I’ll meet someone who can get me into the Vancouver Aquarium one night and try it out there. Or maybe it’ll be someone else who does it. That’s why the other, and more important next step for me, is to teach people how to make something like this. And I’ve already gotten started.
Thanks for reading!