Sessions is temporarily moving to YouTube, check out all our new videos here.

Building Drones

Chris McKirgan speaking at Bristol JS in August, 2017
Great talks, fired to your inbox 👌
No junk, no spam, just great talks. Unsubscribe any time.

About this talk

Sure you can buy a drone, but where's the fun in that? We'll walk through everything you need to know to build your own full-scale first-person-view multi-rotor drone - a type of drone that lets you take to the sky as if you were on board, using special video goggles. If that's too scary for you, we'll also see how you can hack together your very own tiny & simple indoor FPV drone like above.


Let's get into it shall we? So in only recent history, drones used to be something only entirely limited to the military. In the past few years we've seen this huge explosion of the drone market. From these little tiny outdoor things to some giant colossal flying machines. Drones have been revolutionising industries already. In Rwanda, automated drones are being used to deliver blood between rural hospitals, cutting delivery time from hours to minutes. And then in Italy we saw a series of drones we used to automatically 3D map the Tower of Pisa. And drones are often seen at the forefront of technology news at the moment where we're promised by companies like Hammers in the near future, we're gonna have our orders delivered in just 30 minutes by drone. And then we see in San Francisco and other places these big budget drone leads. That's my brother's dog, Woody. And we got the rapid advancement of drone technology come to it's own problems as well. We see in the headlines that someone strapped a gun to a drone. Someone strapped a flamethrower to another. And we get some idiotic people flying around airports. This is not around an airport. But as a hobby it's a really fascinating time to join. It's got a really huge, enthusiastic community with great online resources to help you along your way. So, first of all, hi, I'm Chris. I'm not a drone expert. I'm a web developer. I do backend stuff with Laravel and APIs. And I build drones as a hobby for fun. I've built this one here and the little one here. And we got some guys from Hillbilly Hotquads here. Give us a wave. They've brought all this stuff here. They're the drone guys. So if you go to the pub afterwards, if you want to ask questions, they're the guys to ask the questions to. So I've got a couple of plans. I want to equip you guys with some foundational knowledge about how drones are built. So you'll have the resources to be able to go out and make your own drone. And we're looking at FPV drones. So that's a drone that's got a camera on it which transmits live video so you can fly line of sight, looking like through the eyes of the drone without any latency. So in order to achieve that, I want to show you what a drone is made of, all the components inside a drone. Then I want to show you how you put those components together. And then after that give you some information so you can go out and practically find some help, find some details, tutorials and walkthroughs. I'm not gonna be able to show you exactly every single tiny bit of how to put a drone together tonight. But I want to equip you so you can go and do that yourself. So, this is a really nice diagram I found after trying for hours to make a beautiful one. I stumbled across this, it's fantastic. So what I'm gonna do is I'm gonna show you all the different parts. There's gonna be a lot of detail pointing at the middle. We'll come to what's in the middle. But I'll walk through what's made of the drone first. 'Cause it's a little bit complicated but we'll walk through it. So we have the frame. That's kind of like the main chassis of the drone. This one's got four arms on the frame. This one here's got six arms. So this is a hexacopter. That's a quadracopter. Pretty self explanatory there. And in the middle we got this thing called a flight controller. A flight controller's like the brain of the drone. Everything wires into the flight controller and it gets fed loads of data and it does loads of computational things. So what happens when wind hits a drone as you're flying into the wind? How does it correct itself? All these sorts of computational things and what happens when you feed in from the controller, how does it react to that? How does it understand the GPS signals going in? That's the brain of it. And there's loads of different flight controllers on the market you can buy. I use a Naza-M in this big one here, which is made by a company called DJI, a big manufacturer. And then we have ESCs which are called Electronic Speed Controllers. On this one, they've stuck them in the middle of the drone. On my one it's actually buried under the arms here, strapped with a nice cable tie, nice and secure. What they do is they convert a high amount of power, which come from these big batteries here, which could give you a nasty shock if you would stick your tongue on the end of that. Don't do that. It converts the direct current... I'm not doing that. Maybe after a few pints. I'm not doing that. So the Electronic Speed Controllers, they turn this really high power direct current into alternating current so you can power these motors on the end of it. But what they also do is they connect into the flight controllers so the flight controller can dynamically change the speed of the different motors. So that's how it controls the flight of it. And then we've got the motors again. We got four motors on this one. This one's got six. You can get different orientations of drones with different amounts of motors. Then we have a GPS unit. Normally it's got a dedicated antenna. You don't want to get any interference. So mine here actually sticks on the little stand on the top. I always worry about that in transport. That's another story. That just reads in the GPS data and then we have new systems out there GLONASS and you can get one that GLONASS supports and other things as well. Then we have an RC radio receiver unit. So what that does, that takes the signal that's coming from the controller, which is what you're controlling it with, sends a radius signal to the drone, that takes that signal and it pipes it into the flight controller. Normally you don't often have a dedicated big aerial with that. On mine, I actually have it like a thread thin. If you come and have a look afterwards, it's strapped to one of the arms. It's quite a little thin thing. Then we have an FPV video transmitter. If you're making an FPV drone, you want to be able to send the signal back to you. So have a transmitter for that. On mine, I've got it mounted at the top, here on this aerial. Again, have a little look afterwards. So that takes some power, quite a bit of power, and then that broadcasts it back. And then you get a set of goggles at the other end which receive that which I'll show you in a minute. Then on the bottom of the drone, you can have a camera or gimbal. You don't have to have a gimbal. I mean you don't have to have a camera. But if you want FPV you do. On my drone, I've got two cameras. 'Cause my set is a bit more complicated. But the standard setup is you'll have a camera and it's connected to a gimbal. What a gimbal is, is a device which allows you to have a different axis of motion. So it'll do two things. It'll stabilise the video during flight. So as the drone gets hit by wind and is moving around it will stabilise it. And the other thing it can do is actually rotate in different degrees of motion. You can control that remotely. So if you want to pan down as you go across or pan across, you can get different degrees of motion. You can get two degrees or three degrees or no degrees. So x-y, x-y-z. Or maybe you just want it stabilised so it doesn't really have any controllable degrees of motion. Now we have the landing gear which is something which you can kind of overlook. 'Cause I almost overlooked that with this thing. Soon as I stuck a gimbal on the bottom, I never really took into account, hang on, the legs have to be longer than the camera. Otherwise when you land you're just gonna smash your gimbal. So you do have to think about that. And you have to think about you're going into a field most of the time. And grass gets quite long. Your blades are gonna get caught up in the grass. So these are the worries of flying drones. So landing gear is cheap. That's what's important. Now we have props. Same number as the motors you have, which seems kind of obvious. You have different colours on here. You'll see the front ones are in orange and the reason for that isn't really technical. It's just so you can orientate yourself in space. So some of the drones come with different colour chassis. So this one has got four arms in the back which are white. And two arms which are red. And that's just if you're flying and it's in the sky and you kind of lose track of what direction it's facing, you can look up and you can see where it is. So you'll find that some drones have coloured arms. Otherwise they have some coloured props on the top. So the props are interesting with the motors as well. You'll find that they spin in different directions to give a centre of gravity to the drone. So normally it'll go clockwise, anticlockwise, clockwise, anticlockwise. And the props actually are bent in a certain way to match that orientation spin as well. So you have to make sure you put them on the right ones to get the motors... We'll come back to that. Actually I'll tell you this story. When I first built this thing and when you get to the software stage of this, if you screwed it up and get it the wrong way round, you're not gonna have a fun time. 'Cause I took this out to the field on its maiden voyage, took off and it just started going like this. And luckily I was flying it low. And it took me about 10 minutes to realise, ah did I check the orientation of the spin? I had to run back to my car, sort it out, no problems since. But it's an important thing you can overlook. And then in this diagram there's a battery that's mounted underneath the drone as well. So battery, that's that big green thing here. Mine is mounted on the top here. And on this one it's mounted under the bottom. Along with the battery you also have something called a Power Management Unit. That's something which reads in the voltage and the current in the battery. And you can feed back things over telemetric data to a controller. But it also tells the drone stuff. So it'll feed that back to the flight controller, then the flight controller can make informed decisions of what to do. So if the battery gets low, does it do an automatic landing? Or maybe it starts beeping and flashing to you to tell you that the battery's getting low. And you can configure that in software, which we'll come to in a moment. So that's everything that's made up inside the drone. These are the components of an FPV drone. Once you've got the basics tonight, you can do some really interesting things with it. You can build on top of that. But that's the bare bones to get you flying in the air with a first person view camera. Also, you'll need a controller. You're not gonna get far without one. And you also need a set of goggles or a screen. Say this is an FPV set of goggles. These are not top of the market anymore but they were when I bought them. Technology moves fast. This just transmits video. Stick on your face, you look really stupid. And you can see that live video stream through them. So have a look at that in a minute as well. So now I told you what's in it. I want to give you a bit of an idea of how it sticks together. Because by understanding what's in it and how it sticks together, you can really get an understanding of how to actually build one and have some level of confidence to build it. So we talked about the motors. On the end of this diagram we have the motors, which are the six on here. Or the four on the diagram we looked at before. And they wire into these electronic speed controllers. They get some power from a battery and the next item on the diagram here... Battery. Power Management Unit. Let's talk about them. So the battery obviously is that thing. That gets power and it powers all the various different components. Has this Power Management Unit the battery plugs into and reads some voltage information. That sends it back down to the flight controller here. So that's the flight controller. The electronic speed controllers get fed information from the flight controller, which will tell it how fast to spin that motor, specific motor. So we'll have multiple of these. Then we have the radio receiver unit. Normally a thing that I find to be a bit too chunky for what it is. I'm not quite sure why that's so big. But they'll feed out loads of different channels. So if you go the pitch, the roll, yaw, thank you, the different things you have on your controller. So basically all the different dials and buttons they get fed back as channels and then they go as individual wires. And they plug into the flight controller. And the radio controller will send that to the flight controller. Then we have the camera and gimbal. And we have a gimbal controller. So in my case, my gimbal controller is a little piece of circuitry which controls the movement of the gimbal. Mine is connected inside one unit. I never had to worry about it. I just plugged some stuff into the flight controller and I don't have to worry about it in other things. It's a separate thing you buy. And the camera obviously is a camera. In this case it's a GoPro. A lot of people are using these tiny GoPros now that are like little cubes. This one doesn't have a screen on it. It was the cheapest one at the time. But the little ones are lighter. And weight's a big deal when you've got something like this in the sky. It affects your battery life dramatically. And if you're flying the kind of things these guys are flying, it's gonna affect your flight times in races. So video transmitter. So you'll see that this camera connects directly into this video transmitter. That gets some power. And then that's got an aerial of its own. So that's got a dedicated aerial at the back of mine. And that's important 'cause you need to get that away from other interference on the drone as well. So that takes quite a bit of power. That'll broadcast it back and then these goggles receive it. And then we have a GPS unit which is that thing stuck in the top here. That'll connect right back to the flight controller so we can understand its orientation in space and that sort of thing. It'll do its latitude, longitude, and altitude with a GPS. And then that often is kind of built into a unit of itself, rather than having an antenna. So mine is actually that whole white thing on the top. It's just glued onto a stick. And then we have some dedicated antennas there as well. So once we've kinda built the hardware, we've got everything together, we've wired it all together. We've figured out how to make this like this, we need to configure it in software. And different software out there get different capabilities. I use a company called DJI. And DJI have a flight controller called the Naza. And Naza's like a big brand of different things. There's different versions of them out there. So the Naza-M V2 is the one that's built into this. And when you open up the software for that, you download it on the computer, you're presented with something like this. With my drone, some flight controllers you can plug directly into them, into your computer. On my drone, I had to buy, it came with a kit I bought actually, a little thing that looks like this which has a USB port on the end. I plug the other end into the drone and then that straps on and it's flashing LED which gives stuff like battery warnings, GPS locked by different colours. You plug that into the computer and then it boots up and you see this thing. And this is where I made my mistake when I first took off and I'd done the orientation incorrectly. I selected that one instead of that one I think. Yeah, and it just went crazy in the sky. So this gives you lots of control of different things. So it can be the orientation of the motors and which direction they spin. In different circumstances like this with a quadcopter, you can have one blade going forward or two blades pointing forward. You can do all sorts of things with what happens when a battery gets low. Is it gonna do an emergency landing and land where it is? Do you want it to return home and land? You can do things like distance settings. So you can say I only want you to go 50 metres away from me in any direction and no further. And if it reaches that it stays there. And all sorts of emergency things on what happens if your controller cuts off. What's the behaviour you want to programme the drone? When you build something yourself you have a lot of fine control over that sort of stuff. So that's kind of a big rush summary of how to build something colossal like this. And it can be quite complicated. But I didn't want to leave you guys with a headache of well that's quite a lot. That seems very expensive. And it is an expensive hobby. I wanted to show you how to build a little tiny drone which looks like this. You might have seen one flying around earlier. This is something that's cutely named a Tiny Whoop. Some very fanciful person came up with that amazing name. And it looks like this. And this is me looking beautiful flying it and someone's chasing it round with a camera. All it is is a off the shelf small drone with an FPV camera with a built in aerial soldered onto the board. And that gives you some cool flight like this. And this is one of my old client's offices. I'll let it run because you get to see me crash it into a pole in a minute. It's super fun to fly. And being able to fly these sort of things indoors, one of the big hatreds of these things is British weather. Never serves you well. The wind and the rain and this sort of stuff. Whereas I just annoy the heck out of my wife with this thing. So, I'll show you quickly what this is made of. 'Cause it's actually really simple. This is an Inductrix drone. You can buy them with or without a controller. So that controller I bought for my drone here works with it. And you can buy them with a controller which makes it a bit cheaper if you just want to get something up and going. And then you buy this camera with an antenna built into it. So that's actually glue gunned onto the front of my drone there. You need to upgrade the batteries. If you have the standard batteries, you're not gonna have a good time. It lasts in the air about a minute. So you buy an upgraded set of batteries. And then you can't quite see that on this screen, but that's a 3D printed mount for a camera. A lot of people do that. I didn't really see the point in it. So I just glue gunned it to the front. So you don't even need that. I say these are arguably optional. If you just want to get a drone in the sky you do not need to upgrade the motors. But you probably should. You'll find that these guys when they fly around it's got a lot more stability and power. This thing it's got a bit of wear and tear as well. But that's not really an excuse. The motors don't serve it justice. So that's kind of all that's in this thing. You need the goggles to be able to view the video. But you can do that cheaper by getting a screen. I have a screen hooked up here as well. It's a dedicated little screen that runs on a battery which receives a signal. And then you're gonna need a soldering iron and some solder. But the connection points are really simple. You take a bit of plastic off the top of it. That exposes two terminals. You have this little camera. You solder the positive to the positive, negative to a negative. Either secure that on with a mount or glue gun it. And that's it. That's a micro FPV drone done really quickly. And you're gonna need a set of goggles and you're gonna need a controller as well. So, I got some tips for you because I learned this the hard way. Start small, think big. You can really get easily carried away. There's this stuff that I want to keep doing with this. So I've done some additional things with this, taking my kind of coder brain into it. I built my own GPS tracker which works over 3G. It's a dedicated little unit I stick on the top. It goes to a mobile app and I can kind of see wherever it is. If I crash my drone I can go find out where it is. I want to do some more interesting stuff with parachuting little things off the bottom. I've been thinking about sticking a Nerf gun on the bottom as well. But once you've built something like this that can carry more weight, you can do some really interesting stuff with it. Keep those dreams but don't start there 'cause you're gonna have a massive headache. Start small, think big. What I would say is get an Almost Ready to Fly Kit if you want to build something more like this. This is more to have a bit of a play around with filming perhaps and get some camera and just get in the air. With these guys it's a bit different 'cause they've got some racing variants here which are very specific. But you can buy these kits. They call them ARF Kits. Almost Ready to Fly. It comes with everything apart from a controller. And that's really good because you don't have to worry about voltages that's gonna work with this. I don't quite understand. Start simple. That was an ARF Kit. And I've built stuff on top of it afterwards. So it's a really good place to start. Find a good detailed tutorial. Again, I did that with this and I've put tutorial on the end of the one I followed. It's some random guy that just loves drones. And he found this drone and he thought I'll build it and I'll record it as he did it and he shows his mistakes along the way. I find that particularly helpful. But at the same time, some of the stuff that he did wasn't quite the stuff that I was doing. I think my electronic speed controllers were different to his. So I had to do a bit of my own research. So be prepared to go out and do your own research. Check things as you go through. Join a club. And there's loads of model flying clubs. And as drone clubs, these guys I'm sure point you in the right direction. Have a pint with them at the pub later. And a Facebook group. I found finding a very specific Facebook group for my drone really helped. This, guys is an F550. I found an F550 drone group. I originally was posting questions in generic drone groups. They don't know the specifics of that. I joined an F550 drone group, started posting questions, get amazing instant responses. The communities are really enthusiastic and really wants to help. Don't be stupid. The classic cliche in this hobby is you're gonna get this hobby banned. So yeah. People flying at airports, people fly at trains, people fly over huge crowds of people. It's just not a good idea. There's something called the drone code that the UK's put up to try and encourage people to not be stupid. And this is the kind of drone little acronym here. So don't fly near airports or airfields. If one of these things goes in a plane engine, which I'm sure at some point is gonna happen, it runs the risk of downing a plane, and there's people on board. It's not a good idea. People shouldn't have to say this. But a lot of people fly around airports. So don't do that, okay. Remember to stay below 400 foot, 120 metres. That's the legal cap. Above that is like a flight zone. So you're gonna fly into planes. Below that you can fly to your heart's content. You're legally allowed to fly there. As long as you're not in an airport, air runway, you can fly up to 120 metres anywhere you like. Observe your drone at all times and stay 50 metres away. Something's happened there. But what that means is you have to observe your drone by line of sight. Maybe if I wobble that, that will help. I don't know. But you have to observe your drone at line of sight at all times. If you're not observing your drone by line of sight, then you're technically breaking the law. That becomes confusing when you've got FPV vision here. You go ahead. FPV vision here, so. When you're observing through the goggles, you can legally have someone spot you. So they keep a line of sight on the drone but in the UK you're supposed to have a line of sight on it. Don't fly near aircraft. So if there is a plane or something that's even stationary, like maybe an emergency helicopter's landed and someone goes oh that would be cool if I got a shot of that. Just don't fly near it. Again, shouldn't really need to be said. We're all sensible people I'm sure. But people keep doing it and it's gonna get the hobby banned. So don't do that. And enjoy responsibly. Like really it's just about being sensible. So have fun, go fly in fields, go fly in other places, have some cool filming shots. Experiment like chucking Nerf guns on the bottom. Maybe not actual guns. But some other interesting stuff. And have fun with it. It's such a fun hobby to be a part of. And it really is great community around there. So what I want to do now is I want to have a bit of fun. So I'm gonna play some video footage that these guys have brought over. And whilst you do that I'm gonna do a little bit of setup. So enjoy and I'll be back in a moment. And I'm gonna look really stupid with these on my face. So... Here's some video. Where's a good place. As good as any. It's a crash session video. It's actually really fun to watch. The stuff they sent over is amazing, thanks for that. Cool, right, sorry I'm pausing this. 'Cause this is more fun. Right, this hasn't been tested. It could go terribly wrong. Sorry if it hits you. It's a tiny thing, it doesn't hurt, I promise. So what you're seeing is there's a screen here with an aerial on it. And you're getting an input of that to laptop to the screen. I've got a separate set of goggles. You look really stupid whilst doing it but whatever. I'm gonna fly it round here and then come back round. But what's really cool is you can actually fly around corners and fly all sorts. You kind of get used to it. Hello. This is like a really cool selfie right? Hey, I saw that. There's still some pizza left. One more sweep and then I'll come back. Hello guys. Good to see you. Thanks for showing up. I can't see behind me which is the only daunting side of this. I just hope I don't crash into anything. Right, I'll come in for a landing. Ooh, that was successful.