MRAP Controller Project
Video Transcript:
I have had this really cool, military grade control box that I’ve been wanting to use for 10 years. I really wanna use it to control something. In this video, I’m finally gonna put it to use. I’m gonna attach a wireless transmitter and I’m gonna send some signals to a receiver that then is gonna power some DC motors. I’m gonna walk through the prototyping process, electronic selection, soldering and building this thing, programming it, some 3d design, actually assembling the controller, doing some connection testing. And then I’m gonna show off a fun proof of concept, wirelessly controlled wheeled chassis, stay tuned. Subscribe to our YouTube channel to get more videos like this. All right, anytime I start a project, I like to have a little process I go through, I like to draw it out, kinda list some stuff about it and then make some specifications. And then I gotta, yeah, I like to prune all that stuff off. So I’ll fast forward this and just kind of get to the details here. All right. So I’ve drawn this thing out here. Basically, this is the controller. So that’s this thing right here. And then I’m gonna have to have some type of micro controller, connected to it that’s gonna read the signals. When I move this stuff, it’ll read the signals. That’s gonna have to have a battery. And then I’ll have a transmitter and a receiver, So the receiver will be on that wheeled box, I guess, cardboard box, right? And then the receiver’s gonna be connected to another micro controller, and Arduino very likely, some type of Arduino compatible board. And if you don’t know what Arduino is, we got a video called, What is Arduino? You can check that out, it’ll talk to you about what that is. The wheel thing, this, I need to come up with a cool name for this thing. But wheel box is going to need a battery supply, obviously, right? Then I’m gonna get a motor controller for the motors that will speak to the micro controller. And then, just these hobby motors right there. I think that’s the components I need. I might be missing something here, I don’t know. I’m gonna have to be thinking about this. But, so then what I do once I’ve drawn it, I kinda list out just in words, all this stuff. I think I got everything covered here. You can see I’m just really fast and loose with this, I’m really not too… It’s just trying to get my ideas out here. But on a lot of these specifications, this is where it’s like here, I just list out what the thing is, right? The controller that’s again, this thing, right? Or the transmitter and the receiver, that’s the transmitter and the receiver. But over here, I try to get a little more specific about what this stuff is. What am I actually gonna buy? Or what am I gonna use? And, I’m drawing blanks on a couple of these things. I’m not sure what type of transmit receiver I wanna use. So I definitely need to do some research. So I was looking around trying to find what I had for radio frequency stuff. And like I was thinking, I just want some short range thing, like you’d use for a remote control car or whatever. But I could’ve swore I had some somewhere, but I don’t know, I found this stuff. This is Long Range, right? Long Range radio. I don’t know. These are cool little, I got these after talking to a guy. See, look at this board, isn’t that sweet? It’s got a build in LCD on it. I don’t, maybe I should just use this, but I don’t know. This looks really cool. It’s built by this Heltec company, even comes with these cool, look at this sweet case. At least I think that’s pretty cool. It fit in there. Anyway, I wanna use these, but I was like, man, I just want some short range stuff. And I’m like, so it’s still looking around, and I came across this box. It’s like, I just buy random crap sometimes, I guess. And then, it’s like, oh, well, Hey, maybe this will work. Well, this is just stuff from Adafruit. And guess what it is. It’s like long range, radio stuff. It’s like this, what is it? It’s an RFM9X Adafruit, Feather, MO Radio, Lower Radio Module. So it’s like the same thing, another long range thing. I’m like what? I can’t find any short range stuff. I don’t necessarily feel like buying some short range stuff either though, I think probably be a better solution. So I’m just gonna try, I think I’m gonna try this Adafruit stuff, throw it together, and we’ll see what happens. I mean, maybe I could control stuff from, I don’t know, half a click away. That’d be kind of cool. So apparently, when I bought this stuff, I thought I bought a cool antenna looking thing, but I bought a bunch of different antennas, I guess, but I bought a 2.4 gigahertz antenna when I was supposed to be getting the, 915 megahertz antenna. So yeah. And I bought this cool edge connector looking thing, but like I said, I could use that for a different antenna, but I got two of these simple spring antennas that, I have two, so I might as well connect ’em so I’m not gonna use this edge connector, but, oh well it happens. So I connected the board and I wanna be able to see the board. I was thinking I’d just be able to go to boards manager, but what you see here is based on, getting the most up to date ones. You gotta go into preferences right here, Arduino preferences. And you can basically add board manager URLs. So this right, what URLs you put in here is you gonna pull information and it’s gonna populate that list. So you can see, I have some for the esp32, and this is just a comma separated list, right? So I just put a comma there, and then I’m pulling this URL from the Adafruit website, just copying this URL. I’m gonna paste it in here and I’m gonna hit, okay. And now I have a feeling I’m gonna have to restart the Arduino IDE, but let’s see if those show up now. Boards, boards manager. All right, so what I’m gonna do, all right, this is downloading the platform index. But before I wasn’t seeing any Adafruit board options here, and I’m gonna just see if I can, let’s see, Adafruit. Oh yeah, here we go. So here it is. Adafruit, AVR, I didn’t have to restart. So, I’m gonna go ahead and install this and then I should be able to see, yeah, this is Adafruit Feather 32u4. What the board I’m using is a version of that. So I’ll go ahead and click install, close that out. And now maybe this is the point I’ll have to, open and close the Arduino IDE. So I’m just going to tools. Then we got a board, Adafruit boards. All right, there we go. I think this is the one I want, Adafruit Feather 32u4. That’s it, all right. So I’m gonna select that. And then I’m gonna go to tools and I wanna get the right port. So I’m pretty sure this is it, ’cause it’s the only Arduino board I have plugged in right now. I think, sometimes I just have a ton plugged in, I forget, what’s what? Anyway, there we go. Okay, so I got that. Now what I’m gonna do, I just wanna make sure that I got the thing actually working. I am gonna make an assumption here, that’s probably wrong, but there’s probably an LED on this thing somewhere at pin 13, so I’m just gonna see if I can upload. Let’s see. I’m gonna go to examples, basic, blank. And I’m just gonna try, this is what I call a smoke test, right? I’m just gonna try to see if I can upload this and make sure that I’m actually talking to this board. All right. So lemme go ahead and click upload, says it’s uploading. Oh man. AVR, dude. It’s getting up in my business. All right, so now what I’m gonna try, I’m gonna holding this reset button, and then I’ll hit upload. Let’s see, I don’t know. Maybe I tried this already, but I’m gonna do it again. All right, I’m holding that reset button. Let go. Now it’s going into that nice little thing. Now I’m gonna upload. How do you that? All right, programmer is not responding. Yeah, I just like to press buttons. All right, this cable, I got a feeling, this cable might be no good, I don’t know. All right. Well, if you ever feel stuck, don’t feel alone. It happens to me all the time. I’m sure it happens to all of us, right? So, and I guess that’s just part of the process. Anyway, so here’s what I realized, AVR dude was giving me trouble, like it always does. AVR dude. Anyway, so I restarted my Arduino IDE. Okay. And then what I was that I was selecting this USB serial. So I probably do have another, you’d think I’d know, but my wires are anyway, this is the right board to select. So I’m gonna select that one and then just double check. Yep, okay. So, now I’m gonna go ahead and let’s go to this blank sketch again. Examples, basics, blank. Here she is. Verify, upload. Let’s see. Okay, now that’s looking good. It’s on, and it’s off. Now, it was blinking way faster before. So now I can thumbs up, like sweet. I got this smoke test done. All right, let’s move on. All right, like I said, I like to do this as incremental as possible. So this is usually the first thing I do when I’m trying to work with a board. All right, so after messing around for quite a bit longer than I thought I’d have to, I got it working. And I got two separate boards talking together. One is the breakout board for the, it’s like a RF95 And then the other one is the feather using the U32. Anyway, long story short, took me a while. But right now I’ve got the breakout board connected to a Arduino mega. And that is connected to, USB to my computer. And that’s set up as the receiver. And the other board I’ve been playing around with how far away I can take it. Right now, it’s downstairs in my foyer and they still seem to be communicating. That’s pretty cool. I’m gonna have to test how far away I can put that, but I don’t know. It’s been an interesting journey to try to get this right. I think my biggest difficulty was just making sure I had the right code, the right pin outs correct, and everything like that. It was a little more, I don’t know, a little more challenging, but of course, I’m easily challenged. So hey, par for the course. Anyway, one thing I’m realizing is, I probably should use something more appropriate for this design, right? ‘Cause I’m like, the idea is that I control a remote controlled car, why would I be using a long range radio to do that? That just doesn’t make any sense. But that’s what I have here, I’m having fun playing around with this stuff. So I’m just gonna keep pursuing this route and see where it goes. All right, let’s keep chugging. Who knows? Let’s see how this turns out. Yeah, so I’m not a 3d dude, son of a, doesn’t that look, is it me? Or does that look? It looks like an oval, I don’t know. Okay, look you’re that, and then I do this 1.75, and then I do two. Okay, sure, a sweet, all right. Yeah. It’s like, I’m new to this whole 3d printing thing. I’ve been just doing a bunch of trial runs because I’m apparently not that good at measuring. And what I think is the right size when it actually prints seems not quite right. So that’s why I’ve had to keep playing with these, but. Oh man, some of these breadboards that you get, they just are horrible. They just won’t fit in, you know what I’m saying? It’s like, oh man, I’m hurting my fingers. And on top of it, I got that greatest showman song stuck in my head. Never Again. or Never Enough. ♪ Never, never ♪ It’s like. Geez, crappy breadboards, good music though, I love that song. I couldn’t find a connection for this. So what I did is I 3d printed this thing that like, yeah, I know. I can’t say I’m the best 3d print. Anyway, okay. So if fits like this and then I was thinking, I could somehow use this to mount the box that’ll hold the transmitter stuff. Anyway, so then I have these things, and if the spacing doesn’t work out. Maybe I could try to make the spacing work out though, maybe that’s what I’ll do. Anyway, and then the idea is I could push those in and then just use these. What I was gonna do is, I pulled one of those out, one of these pins and I was gonna stick the down in there. And then I was thinking like, yeah, I think it’ll be easier just to cut this and then, okay, that’s what I’m gonna try. Okay, so I’ve got this controller, and now I’m trying to figure out like, what the heck? When I do this stuff, turn buttons and flip stuff. What happens down at these pins? There’s nine pins here. And so I’m trying to figure out, like I thought maybe I’d magically be able to, into it, like what is going on? But I can’t, I’m just not magical like that, darn it. So anyway, what I’m doing is right now, I’m gonna just go through and test every single one of the pins to every other pin, make a little matrix, and then see if there’s continuity, right? So I’ll check and see if, when I turn it a certain way, it’s continuity come up or whatever. Maybe, this is like already figured out. I’m sure it’s already figured out, and I just, I don’t know. Anyway, this oughta be interesting. Let’s give it a shot. All right, well, I just went through all these measure them with the multi meter to see if there was a connection. So I basically connect one pin here, one pin here and I made this table, right? Pins, verse pins, so I connected pin one to pin two, moved the stuff around and all these different positions. And I came up with this graph. So these arrows represent the little joystick thing and it was kind of fun to do. Actually it didn’t take me as long as I thought. And so, you can see, certain connections indicate certain directions. And this switch right here, when it’s in the up position, it connects pins seven and pin six. And then the master on switch here, when that’s in the on position, it connects pin eight and pin nine. Anyway, details, details, details. But given this, oh, Shooks, I should be able to come up with some code that is gonna translate all this into commands that I can send to the receiver. So I’m feeling pretty hopeful right now, let’s see how this gets dashed and destroyed to reality, but I’m gonna go with it. All right, I gotta tell you I’m feeling pretty good. Okay, so what I usually do, if I’m trying to like, when I’m putting code together. I had that other sketch where I had the communication working, but I just went to a completely new sketch. ’cause what I’m trying to figure out now is this control stuff, right? And instead of trying to add the control stuff, to that other sketch, what I prefer to do is just start with a brand new sketch. Just figure out the control stuff, right? I don’t have any other thing I’m trying to work about. And then once I can figure out the control stuff, then I will merge it into the other thing, right? So, this way, I’m not dealing with multiple unknowns, ’cause I got a small brain, I get confused really quick. So I try to keep everything just incremental as possible, right? So basically what I did is I wrote some code, that’s just printing some stuff out to the serial monitor, right? And this is basically the joystick, all right. So I have all these pins. I have the pins set up as input pullups, right? So all the pins on here are reading a high state, right? Until I turn ’em one direction or another, and then it’s reading a different state. Okay, so let’s see if we can get this thing to work right now, who knows it can work? Let’s see. Let me clear this. So if I press up, I should see a zero at the top. Let’s see that. Okay, see, I got a zero at the top. Sweet. Now I’m gonna let go, it goes back to one. Now if I press left, I should see a zero on the left. Let me do that. Okay, there’s my zero. Sweet, do you see that? All right, now I’m gonna press, right. I think you get the picture, then I’m gonna press down or, yeah. Okay, sweet. Okay, well that’s pretty cool. Now what I gotta do is figure out how to, I’m probably gonna get these buttons in here working. I haven’t figured that out quite yet. And then what I’ll do, is I’ll send this commands somehow over to the receiver, which is then it can get control that super awesome car. Well, you know what I mean? Cool progress. All right, make a little bit of progress. So I got, it seems like now I can transmit direction to this, right? So let me open up the serial monitor window real quick here. Okay, so, if I push forward, it should say forward. Again, the serial monitor is reading this 18 mega, right? Not this right here. If I push down, it’s saying backward or if I push backward. If I go left, it’s saying left. And if I go right, it’s saying right. So that’s pretty cool. So transmitting. Let’s see if I take this battery, I’m gonna plug this battery in. I mean nothing should change here, but I’m gonna just unplug this. All right. I should expect a little reboot here, right? But let’s see if this keeps working. I’m just gonna clear the output. Okay. So, for good. All right, still working. All right. Back. Yep. Okay. Left and right. Sweet. Okay, so this is just on battery power. Got this. So now the next step is to set up the motor control on this, so that when I do this, it does the appropriate motor stuff. So cool. All right, let’s go for it. Are you ever sure you have something and then you just can’t find it? Well, I was sure I had one of these just laying around, in the wild, well, I couldn’t find it. So I had to open up this thing and of course, it looked like it was, I don’t know, underwater for three years. Like at a shipwreck, like I sunk. Anyway, all the batteries were just nasty. And then when I was trying to clean it out, I accidentally threw these screws into the trash and I had to dig through my trash. I was like, man, just to find it, whatever. Anyway, got a battery pack and now I gotta hook this up. That should be enough. Okay, I know I’m just complaining, but hey. Cool. All right, well, I hooked up these motors to a L293D. It’s like a motor driver, essentially. I just had one in a kid I found. I wanted to use a shield, but I was using some pins that weren’t gonna work with the motor shield. Anyway, okay so. Got the motors hooked up. Yes, this is the most ghetto box. I know, you don’t have to remind me. And then I’ve this hooked up. All right, so this has got, this is on the battery. I’m using the battery pack to power the mega with VN, right? And then it’s also the source for the motor driver ship. All right, so now check it out. Again, nothing’s plugged in, this is all just wireless. Right? So forward. Then when I let go. All right little, let’s see like, yeah okay. That’s backwards. Should be left. And right. Yeah, sweet, so it’s good. Look, so all I get do is throw this in there and I should have this kind of set up. We’ll see.