WiFi JR-module to control ARDrone2

27 Mar

This is yet another project with the versatile ESP-8266 WiFi chip. I have an ARDrone2 and a Turnigy 9X transmitter (flashed with the awesome ER9X firmware). The ARDrone2 is usually controlled with a phone or tablet over WiFi. This gives very bad control performance so I want to fly it with my Turnigy 9X. I’ve made a prototype of which the production process is described here. But first a nice video of the end result:

Prototype module assembly

The first step is to find a piece of proto-board and a female pin header that fits onto the pins of the transmitter.

20160327_185552

20160327_185810

For this module, I’m going to be using a NodeMCU board. This one is very good for prototyping because it has a USB port, but also a voltage regulator which I will be using. I also added some female pin headers for the NodeMCU.

20160327_190828
Proto PCB with headers for NodeMCU and JR-header.

Now it’s time to make the connections. This is the schematic of the necessary connections:

20160327_201232
Schematic of the proto-board.

It is important to check the voltage of the CPPM signal, because this differs between transmitter types. If you want to be sure that it does not destroy the ESP module, use a MOSFET like I did for the final version. In this case, I implemented a cheap and easy voltage divider with resistor values 6.8k and 3.3k, which gives me approximately 3.4V.

I also included a separate LED, because the NodeMCU will be facing down when its inserted. Put it in series with a 330 ohm resistor.

Voltage divider and resistor for the LED.
Voltage divider and resistor for the LED.

On the other side, the LED is soldered. I also added a thick yellow wire, which is not connected to anything. This thing helps me to remove the module from my transmitter.

LED and easy-unplug-wire.
LED and easy-unplug-wire.

Flashing the firmware

The prototype is now ready, time to try it. It is incredibly easy to make firmware using the Arduino IDE. A board support package is available for the NodeMCU board, so the right settings are configured automatically. First, I uploaded a blinky to test the LED. It worked 🙂

Screenshot from 2016-03-27 20:00:20

Blinky! :)
Blinky! 🙂

 

 

 

 

 

 

 

 

Now that the blinky code works, its time to upload the real thing. The firmware is open-source and can be obtained from github. Upload it and fly!

Proto module in a Turnigy 9X.
Proto module in a Turnigy 9X.

Update over the air

The firmware can also be updated over WiFi. Theoretically this is also possible from the Arduino IDE, but I had troubles detecting the module usually. Fortunately its also possible to call the python script directly. First, the firmware image needs to be built by pressing Ctrl+Shift+S in the Arduino IDE. Both the computer and the module need to be connected to the ARDrone2 (which acts as a router). When enabling the transmitter, you need to hold the aileron-elevator stick in the top-right position. The new firmware can then be uploaded with the following command:

python ~/.arduino15/packages/esp8266/hardware/esp8266/2.1.0/tools/espota.py -i txboxy.local -r -f ~/git/TXBoxy-AR/TXBoxy-AR.cpp.generic.bin

The procedure is also demonstrated in the following video:

From prototype to product

Because the prototype worked so well, I decided to make it nicer. I designed a custom PCB, ordered plastic cases and smaller parts and put it al together. A friend of mine designed a nice logo for it and we opened a small webshop for it. So if you would like to fly your ARDrone2 with your own transmitter, but don’t like to solder a prototype together like this, check out txboxy.com.

txboxy_pt_top_512x512_large

One Reply to “WiFi JR-module to control ARDrone2”

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.