Close
0%
0%

rudRemote

Customizable NRF24L01+ radio control for multiple vehicles (AKA making a 40 year old radio fly a quadcopter!)

Similar projects worth following
Building robots is fun. Building autonomous robots is even more fun. But sometimes, especially when fleshing out chassis or drivetrain designs, you just want to drive the darn thing. Or maybe you've built a simple telepresence bot that needs to be controlled everywhere it goes. Perhaps you've built an arm that doesn't need to go anywhere, but has several channels in need of input. Wouldn't it be swell to have one radio transmitter that could talk to any of your creations justby adding a simple radio transceiver that costs as little as $3?

That's what rudRemote is for. Using almost anything with potentiometers you can build the multi-model controller that you didn't even know you wanted.

And what could make it even better? In the name of freedom, and democracy, and stuff... All the code is freely available under the MIT License!

A project three years in the making, rudRemote takes an old R/C transmitter (or a new one, or a game controller, or a box of parts) and creates a new controller that speaks CRTP (Crazy RealTime Protocol, the language of the Crazyflie 2.0) to whatever is listening.

There are three basic parts to this project. The first is building the physical transmitter itself. This is the hacker/maker part of the project and can be accomplished in so many ways it's silly. You can buy gimbals and laser cut a housing to hold the parts, or duct tape them into a cardboard box. You can take apart an old Playstation controller and stuff the new electronics inside, or just pilfer the thumbsticks and put them in a plastic sandwich container (using duct tape if you like). Or purchase an old R/C transmitter from the thrift store, or a new one from the hobby shop, and use it to serve as the basis of the project and adapt its internals to fit up with the new electronics. Let your imagination guide you.

A transmitter that doesn't transmit anything isn't very useful. As such, the second part of this project is programming the microcontroller to speak out to the devices (quadcopters, robots, toy cars) you want to control. Since one of the devices I need this transmitter to control is a Crazyflie 2.0, making it speak CRTP seems a no-brainer. Even better, CRTP allows for up to 29 bytes of payload data, but the Crazyflie itself only uses 14 bytes. That leaves 15 bytes free to add other input, like buttons, toggle switches, or potentiometers.

The final part of this project will be the receiver software needed to make these other devices work with rudRemote. As the radio is built around a readily-available NRF24L01+ module it is easy to add a hardware receiver to just about any microcontroller that speaks SPI. Then simply add the rudReceiver (name subject to change) code to your device's code, set the channel, and start receiving CRTP packets. How your device interprets and uses a packet of data is up to you. E.g. the first piece of data after the header is called "roll," but on a land-based driving robot roll could be used to signify "turn" instead, and "yaw" could instead be used to pan the camera.

Same thing we do every night: Try to take over the world!

To be clear, this project is destructive to the donor transmitter. The controls will be interfaced directly to the I/O of a Teensy 3.2 rather than intercepting the data from the existing transmitter hardware. There are other methods of using old hardware to control modern hardware. See the links section for some of the inspiration for this project.

This is a DIY, hobby project that I am sharing as "here's what worked for me." I assume no liability for any damage or injury that may be caused by others' use of this project or software. The finished transmitter should not be used to control any flying model larger than a nano-quadcopter (e.g. the Crazyflie), especially anything fuel-powered (e.g. glow engine airplanes). Nor should it be used with any large land-based devices (e.g. lawnmowers, automobiles, etc...) or anything that might be potentially dangerous to any living thing.

Schematic_rudRemote.pdf

PDF of schematic

Adobe Portable Document Format - 41.95 kB - 10/22/2018 at 06:10

Preview
Download

  • 1 × Donor RC transmitter As found at a thrift store or the like
  • 1 × Teensy 3.2 Microcontroller from PJRC, https://www.pjrc.com/store/teensy32.html
  • 1 × (option 2) Portable power supply The kind that you recharge a dead phone with
  • 1 × NRF24L01+ or NRF24L01+PA+LNA Radio module Generic from eBay, Amazon, etc... Or higher quality from Adafruit, Sparkfun...
  • 1 × Generic 0.96" OLED I2C display Generic from eBay, Amazon, etc... Or higher quality from Adafruit, Sparkfun...

View all 11 components

  • Video!

    Rudolph10/22/2018 at 08:21 0 comments

    Woot, the contest entry video is done and uploaded with almost 6 hours to spare! I'd like to thank the Academy... but they really didn't have anything to do with it. All thanks be to kiddo for handling the recording and then editing it all together at (near) the last minute.

  • Receiver example code

    Rudolph10/21/2018 at 07:49 0 comments

    Got some more work done last night and tonight, resulting in working receiver code in the form of an example robot. I used the old Mr. General platform that's been kicking around for years, and a knockoff Arduino Pro Mini for brainz. You can see/grab the code at GitHub.

  • Schematic is done

    Rudolph10/19/2018 at 02:32 0 comments

    Took me a while to get it done, but I finally knocked out a schematic for this thing. Part of why it took so long is that I spent a decent amount of time finding an online schematic maker to use on the Chromebook instead of just firing off Eagle on the computer. Then another bit of time to figure out just how to represent some of the parts... Still, a schematic of the project is finally available, and it can be found (and tweaked) via its EasyEDA project page.

    (please forgive my lack of schematic skillz)

  • OLED, menu, flying thing

    Rudolph05/28/2018 at 12:19 0 comments

    Been noodling around with just how to do menus on this thing. I probably had 5 or 6 attempts before finally getting one that seemed right.  At the moment it's a few placeholders and such, but the core functionality is there. When the remote is first turned on it shows the "choose a mode" menu to select between Robot Mode and Crazy Mode. After that, when in the main screen, clicking the encoder button takes it into menu selection. Here's a short video showing where it's at right now.

    As you can imagine, Crazy Mode is what talks to the Crazyflie. Choose that one and the remote successfully sends flying commands to the 'copter. Again, doggo was not impressed with the sounds of the Crazyflie.

    There's still plenty to be done. I really want to be able to set the sticks' min/max values from the remote itself instead of hardcoded (these old sticks seem to migrate a bit). And that info should be saved to EEPROM. Speaking of EEPROM, I also want to make it remember the last mode it was set to and default to that on power up instead of dropping to the Choose Mode menu at boot. While trying to come up with other things that should be menu-mo-tized I realized that the Teensy breakout board kit included a watch crystal for the Teensy's RTC. So I figure to add a clock (you can see the fake placeholder clock in the upper-right corner in the video). I also want to tap into battery power for a battery level icon, as well as figure out how to determine if it's plugged in and charging and show an icon for that instead of battery level.

  • Better power

    Rudolph05/15/2018 at 08:42 0 comments

    The new power parts showed up yesterday (I love Amazon's delivering on Sunday). Putting it together was straightforward but it took me a while to end up with a 3D printed holder that worked as I wanted. I went with the Adafruit PowerBoost 500C because it can handle powering the project while the battery is charging. I used a separate USB Micro-B Breakout so I could run the D+/D- lines to the Teensy. That lets me charge the battery and/or program the Teensy from the same plug, which is accessible through the transmitter's original charge port.

    Tx's power switch now connects the PowerBoost's ENable pin to ground to shut things off.

    The itty bitty micro-b jack looks kinda silly in that big ol' hole
    I have to properly shorten the D+/D- wires

    I still need to make a short wire to connect the PowerBoost's Low Battery pin to a Teensy input. Or maybe I should just measure the battery voltage with an analog input and have a battery meter icon in the OLED. Guess I could connect both of them too. I may also experiment with a light pipe thing so the charging/done light can be seen at the connector.

  • Nothing to show...

    Rudolph05/12/2018 at 04:20 0 comments

    I have nothing to show for the last couple days of "working" on this project, but at least that doesn't mean I've accomplished nothing. 

    One thing I've got pretty well worked out in my head is a different (better?) way of powering the transmitter. The little portable charger thing I'm currently using works, most of the time. If the NRF24L01+ isn't running the power brick just shuts off. I think the circuitry isn't pulling enough current for the brick to believe it's connected to something. So far it's not been an issue when the radio module is on but I'd hate for it to decide mid-flight that the transmitter isn't pulling enough juice. Also, as mentioned in part 6 of the destructions, I can't see how much (or little) charge is left when the case is closed up. Aand I would really like to be able to charge the transmitter without opening the case. Aaand it sure would be great to be able to program the Teensy without opening the case and unplugging the battery. So I think I've decided to go with something like this and a bog-standard lipo battery (kiddo had a 2000mAh one just sitting around). I'll grab a micro-usb breakout board and I should even be able to use the transmitter's original charger hole.

    That was the easy part though. Now, I freely admit that the current code (rudRemoteCrazyOnly.ino) is mainly copy-pasted from what I had running a few years ago. And that was largely copy-pasted from other peoples' Crazyflie transmitter projects. There was something in there that didn't make a lot of sense to me: What was RADIO_CHANNEL doing in crtp.header? It turns out that it doesn't belong there at all, instead that part of the header is used to request a specific channel of certain ports (e.g. Logging). It doesn't cause problems so far because the Commander port doesn't have channels. That got me wondering what else I'd missed the last time I'd actually worked on rudRemote. So I've been slogging through documentation and source code, refreshing what I thought I knew about RF24, seeing how much I actually remembered about CRTP (answer: not much), and generally making a plan about how I want to proceed.

    At the very least I can say that, as it sits, this project works for one of my goals. I have successfully flown my Crazyflie (much to my wife's dog's chagrin) with a 40 year old transmitter and I crashed ever so slightly less than when I fly it with my phone.

  • It begins. Began. Whatever...

    Rudolph05/07/2018 at 04:36 0 comments

    Three years ago was shocked to learn that I had won a Crazyflie 2.0 for my entry in the 2015 Hackaday Prize. Pleasantly shocked, but shocked nonetheless. It turned out to be quite an entertaining little device, but I always had a difficult time with the controls. I just couldn't make my brain accept using my phone's touchscreen to command it and almost always ended up crashing. I already had a two-stick radio I'd bodged together out of a couple old R/C transmitter gimbals and a Sparkfun box. That used a NRF24L01+ to talk to my Wall-E bot, and was intended to be able to control multiple robots. I decided I'd re-program that to speak Crazyflie and have "normal" physical controls and maybe crash less.

    old radio bits and the wall-e chassis

    Right about that time I got a new job and went from being a stay-at-home dad to a work-at-home dad. Spending 40 hours a week in my office/lab-OR-a-tree for the job somehow made me want to spend less time in that room, and my projects stagnated. Time went on, weeks became months, I would periodically pull out the box o' parts and noodle around with case options and such. Nothing ever quite seemed to come together though and the parts all went back in the box under the bench.

    Then a few weeks ago I was thrift store shopping with kiddo and acquired these gorgeous things:

    inside the tower hobbies one I found a handwriiten date of Sept. 10, 1978

    This was the kick in the pants I needed to revisit my custom transmitter idea. So I dismembered them both, cleaned them to a fare-thee-well, and finally decided to use the Tower Hobbies transmitter to be the basis of the rudRemote project. And, at long last, be able to fly my Crazyflie with stick controls instead of a phone!

View all 7 project logs

  • 1
    Acquire the transmitter parts

    Step one has some options. You can acquire an old Tx from the thrift store and either use it as the basis for your Tx, or pilfer its parts (e.g. the gimbals) to put into some other housing (another Tx body or a custom one). Or you can just acquire some gimbals to build into a custom box. However you see fit.

    If you're going with an old Tx, open it up and clean the blech out of it. Make sure you know how parts go back together if you intend to reuse it. I learned the hard way (had to ask a forum for help) that the sockets for the sticks in my Tower Hobbies (made by Kraft, btw) do not get screwed down all the way (even though the radio came with them that way).

    I had to desolder the antenna mount and the battery/RF meter from the PCB
    I cut the bundles of wires about an inch off the pcb, so if I ever want to put things back I can match up wire colors easily.

    Whether you're putting the gimbals back in the donor, or just taking them to put into another housing, take this opportunity to clean the pots, check the solder joints, and test the pots with your multimeter. A classy vintage radio look is useless if the sticks don't work.

  • 2
    Prepare the electronics

    This project uses a Teensy 3.2 on top of a breakout board which makes servo-style connections easier. Follow the instructions that came with your breakout board to assemble, including cutting the trace between VIN and VUSB. However, do not solder in the switch in step 3, instead opt for the 3 pin header. That way you can solder a couple wires to the transmitter's power switch and use it to switch the transmitter on and off. For good measure I also added a couple 100µF capacitors to the 3.3V power rails.

    If, like me, you had to cut the gimbals' wires off the Tx pcb you'll need to decide how you want to connect them to your Teensy. I was out of connectors so I grabbed a "Dupont Connector" kit from Amazon to put connectors on the wires. (No, I will not be using affiliate links anywhere in this project.)

    This was the part where I fell deeper and deeper down the Google rabbit hole looking into cable lacing.

    Once your gimbals are wired up and connected to your microcontroller you'll want to find out just what their ranges are. Grab the "rudRemoteStickFinder" sketch from the repository, set the pin definitions, and load it onto your Teensy. This just simply spits out the analog values of the pots to Serial. Make note of the minimum and maximum values of each stick's X and Y travel.

  • 3
    Decide on, and perform, any necessary hardware modifications

    For the time being I've decided to forego a bunch of hardware modifications. Because this controller is intended to motivate some robotic things, and the Teensy has a preponderance of I/O, I will likely end up adding more pots and switches down the line. But for now I decided to just go with a little OLED display, and a rotary encoder for navigating the configuration menus displayed on said OLED.

    It was with a heavy heart that I decided to put the OLED in place of that beautiful analog RF/battery meter.

    If you have the same 0.96" OLED as me, and you have a Tower Hobbies (or Kraft) transmitter like mine, you can grab the screen-to-hole adapter I bodged together.

    This is also the time to add the rotary encoder. I used some 1" angle aluminum from Lowe's and made a bracket to hold the encoder, then attached my bracket to an existing bracket that holds another pot above the right stick.

    Hole and encoder locations were calculated by measuring 47 times and still putting the holes in the wrong place.

    Hopefully your encoder shaft lines up to where you want it to poke through the transmitter's face. If not, keep on trying until it's where it is supposed to be. Then lay out and drill a hole in the transmitter just big enough for the encoder shaft to fit through. By making it a hair small it allows you to see where the shaft actually is, and then you can embiggen the hole in the direction it needs to go to match. If it doesn't match up by a lot, there is absolutely nothing wrong with needing to re-figure your mounting bracket at this point. We've all been there. Anyone who says differently is selling something.

    Where the parts actually ended up

View all 9 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates