How to Control Your Drone From a Computer

After reading my post about how I used my computer to fly a Cheerson CX-10 drone, several people have asked me if it is possible to control other drones in a similar way.  It is in fact pretty straightforward, and in some cases you can re-use exactly the same hardware that I used to control the Cheerson CX-10 – the Arduino UNO and the Addicore nRF24L01+ Wireless Kit .

Component Description
Arduino Microcontroller Board Arduino UNO R3 Board Module With DIP ATmega328P(Blue)
Nordic Semiconductor 2.4GHz Wireless Card Addicore nRF24L01+ Wireless AddiKit with Socket Adapter Boards and Jumper Wires

It turns out that a large number of toy drones use the same nRF24L01+ compatible RF chips.  The word compatible is necessary because most of them seem to not use the Nordic Semiconductor chipset, but rather something like the XN297 from Panchip.In the original Arduino code, the author made it possible to select the protocol by various combinations of the flight joysticks.  For my version, I hard-coded it to always select the Cheerson CX-10 Blue protocol (see line 366 of nRF24_multipro.ino), but left the rest of the code intact so you can easily modify the code to select one of the other drones on this list.

Here is the list of drones that can be controlled by making this small modifications to the Arduino code (taken from nrf24_multipro).

Cheerson CX-10 (older red PCB)/CX11/CX205/CX30, JXD389/391/393, SH6057/6043/6044/6046/6047, FY326Q7, WLToys v252 Pro/v343, XinXun X28/X30/X33/X39/X40
WLToys V930/931/939/966/977/988
HiSky RXs, HFP80, HCP80/100, FBL70/80/90/100, FF120, HMX120, WLToys v933/944/955
Syma X5C (older model), X2 …
MJX X600
EAchine H8 mini 3D, JJRC H20/H22
Syma X5C-1/X11/X11C/X12
Attop YD-822/YD-829/YD-829C …
EAchine H8(C) mini, BayangToys X6/X7/X9, JJRC JJ850, Floureon H101 …
EAchine H7
WLToys V202/252/272, JXD 385/388, JJRC H6C, Yizhan Tarantula X6 …
EAchine CG023/CG031/3D X4
Cheerson CX-10 green pcb
Cheerson CX-10 blue pcb & some newer red pcb, CX-10A, CX-10C, CX11, CX12, Floureon FX10, JJRC DHD D1

Another set of very popular toy drones such as the Hubsan X4 and Estes Proto-X series use the A7105 / XL7105 wireless modules instead of the nRF24L01+.  These can also be controlled by an Arduino Uno, and instructions and code can be found here.

2 thoughts on “How to Control Your Drone From a Computer”

  1. This is a great project!

    I built up a version of the camera project using a Eachine E010 rather than the Cheerson drone. I am able to fly the Eachine via serial commands, can find the blobs,etc, but when I run the script, press ‘w’, the drone flies wildly and out of camera field and the script crashes.
    I suspect Eachine E010 is set up a bit differently than the Cheerson? What parameters would most likely need tweaking? Or, might it be the height of my webcam? Size of blobs? Distance between blobs?

    1. Hi John,

      Sounds like you’ve made it pretty far already, so congratulations!

      Most likely the issue is that the control gains between the E010 and the Cheerson CX-10 are different. I would start by reducing the absolute value of the gains Kx, Kz, and Kt in the file. Each of the 4 axes (x,y,z, and rotation) has its own PID loop. Reduce these three parameters until so that your control loop responds very slowly, and then gradually increase them. YOu should be able to edit this file and save it and have the new parameters take effect just by restarting the drone (press ‘s’ and then ‘w’). It reloads the parameters every time you press ‘w’.

Leave a Reply

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