Introduction: Control Quadcopter From Your Phone in 30 Minutes! [ESP8266 + A7105 + Blynk App for IOS/Android]

I was dreaming about making this kind of project for quite some time. But the complexity of phone integration was frightening me. And it would be hard to reuse the work for my future ideas.

Now this became super-easy with Blynk :)

So I spent 1 evening and got it working. I hope this will be interesting for you.

To start working on this you will need:

  1. Hardware
    • Hubsan X4 quadcopter (no modifications will be needed)
    • ESP8266 breakout (ESP-07, ESP-12 or similar)
    • USB <-> TTL Serial converter (3.3V)
    • Breadboard + jumper wires
    • Amic A7105 transceiver breakout
  2. Software
  3. Skills
    • Some easy soldering might be needed (depends on the hardware you have)
    • Uploading firmware to ESP8266
      [good example here]

References and thanks :)

So... let's go!

Step 1: Setup Blynk App

Every time I use the Blynk app, it reminds me of the tricoder.

Tricoder: multifunction hand-held device used for sensor scanning, data analysis, and recording data.

The app has different widgets (buttons, sliders, displays).
You can perform actions you like. It's a universal remote, that can also display and plot data.

Here are some easy steps to get started:

  1. Install Blynk App:
    1. Android
    2. iOS
      [there is no joystick widget on iOS yet, but it will be added in 2 weeks]
  2. Create Blynk account.
    Just push the "create account" button on the login screen.
  3. Install Blynk library into Arduino IDE: https://github.com/blynkkk/blynk-library/releases
    [in case you forgot how to install Arduino libraries: check here]

[Optional]

You can install the local Blynk server to get the best control and responsiveness.
Read more about it here: https://github.com/blynkkk/blynk-server/blob/mast...

BTW, we're now working on adding direct connections through BT 4.0 BLE and
later WiFi, to eliminate the server link (specially for cases like this).

Step 2: Wire A7105 to ESP8266

As ESP8266 and A7105 operate with the same 3.3 volts, we don't need to use any converters, just connect them directly.

BTW, that's one of the reasons why I selected to use ESP8266.
Another one is obvious: it provides WiFi connectivity :)

You might have to solder few wires or use a breadboard to achieve a firm connection.

Step 3: Configure Blynk Project

  1. Create a new project and select that it is an ESP8266
  2. Push the button to send the Auth Token to your email
  3. Add a Button widget
    Name it "Bind" and attach to Virtual pin 1.
    Set mode to "Switch"
  4. Add another Button widget
    Name it "Lights" and attach to Virtual pin 6.
    Set mode to "Switch"

  5. Add 2 Joystick widgets and configure as shown on the pictures
    Hint: You can control sensitivity/shifting by changing those value ranges...

Step 4: Write Code & Upload Firmware

I will save you some time: here is the sketch you can program to your device :)

Actually I spent a few hours porting and fixing the original coptermanager to ESP8266 and scratching my head every time it failed to work or crashed ^_^

But once I had my ESP8266 working with Hubsan X4, it was really easy to interface it with the Blynk App.
Less than 15 minutes!
Everything I needed was to map commands of the coptermanager to the Blynk Virtual Pins:

V1 - COPTER_BIND      Binds and returns the copter ID
V2 - COPTER_THROTTLE  (range 0x00 - 0xFF)  throttle (top/down)
V3 - COPTER_RUDDER    (range 0x34 - 0xCC)  rudder (rotate left/right)
V4 - COPTER_AILERON   (range 0x45 - 0xC3)  aileron (drift left/right)
V5 - COPTER_ELEVATOR  (range 0x3E - 0xBC)  elevator (forward/backward)
v6 - COPTER_LED       (1 or 0)  enable/disable LEDs

So:

  1. Open the provided sketch in the Arduino IDE
  2. Update Blynk Auth Token (the one from email) and WiFI credentials in the coptermanager.ino file
  3. Upload it to your ESP8266!

Step 5: Fly!

Believe me or not... that's it :)

  1. Power-up your ESP8266 and see it connects to the Blynk server.
  2. Power-up your Hubsan X4.
  3. Tap "Run" button in the App
    [triangle in upper right corner]
  4. Tap on the "BIND" button widget.
    Quadcopter should stop blinking. Great!
  5. Try to switch lights on and off with the second button. Wow!
  6. Now... carefully... put your fingers on those two joysticks...

Comments

author
mekhaailaftir (author)2017-08-15

my dear Dmitry I hope that Explain Mine Image Do this project Works by Wi-Fi IP.......internet access M-WiFi is a limited range

author
mekhaailaftir (author)2017-08-14

I have a suggestion.Please explain What I made in video format It is posted on YouTube Greetings

author
mekhaailaftir (author)2017-08-14

Hello.I want to ask a question, please Do this program. It has a fixed-range Wi-Fi Any non-Internet connection Mother . He needs your technics To be controlled by Wi-Fi internet

author
柏誠邱 (author)2017-06-18

Give me code .come on.thanks
ok0985626998@gmail.com

author
GabrieleC26 (author)2017-02-15

Can I use any hardware of a another quadcopter instead of HUBSAN X4 's hardware?

please, write me

fr.stasy@hotmail.com

Thanks ahead of time, Gabriel

author
KwebsK (author)2017-01-10

can i use other quadcopter?

author
Vishal956 (author)2016-07-06

can we use anything else other than Hubsan X4 quadcopter.

author
RomanD6 (author)2015-10-07

Hello!) great thing!!

I'm going to make all what you did, but i have a question.

Do i need the computer to control the copter? / Do you know how to connect the copter with your smartphone via some small thing, that don't need any connection with computer or some additional things?

The best examples:

- Parrot Ar drone

- Walkera QR W100S

Or if somebody know how to connect the drone with smartphone as Parrot and Walkera did (with camera view and control system..), please, write me or call:

duba_007@hotmail.com

9172007668

Sincerely,

Roman Dubchak

author
wjuntti (author)RomanD62016-05-18

I'm looking into making something like what your describing myself and I'm having some trouble finding good methods of controlling directly from my phone. I'm really quite new to this kind of thing and any help is really appreciated. If you found any good way of accomplishing this please tell me. My mail is william.juntti@gmail.com

Thanks ahead of time

author
mridulzzzzz (author)2016-01-24

can we include fpv camera to it

author
TheRandom_ king (author)2016-01-06

does the drone need wifi to fly or only the blink app ESP8266 need wifi?

author
DIYBudda (author)TheRandom_ king2016-01-14

I believe the flow of data is as such: Phone -> Blynk server -> ESP8266 -> transceiver -> drone

author
RebeccaW13 (author)2016-01-13

Will this work with the syma xc1?

author
zikolach (author)2015-08-24

hi! Thanks a lot for great instructable!!! I am trying to use coptermanager code to implement some http api to the quadcopter. But I got in stuck with some troubles related to copter binding. From time to time it binds successfully and works properly (switching leds on and off, throttle etc), but most of time it binds improperly: leds on quad are not blinking (looks exactly like it is bound), but copterSession->bindTime is 0 and quad doesn't respond on any commands.

Could you please share some thoughts about "spent a few hours porting and fixing the original coptermanager"?

I saw some diagnostic functions in the code archive but not sure how to use them. I assume that I have troubles because not proper timings, because when I switch DEBUG on I always get the same error "No signal, restart binding procedure"

author
vshymanskyy (author)zikolach2015-08-31

I didn't run into such problems. I was making it to run on ESP8266, so I had to tweak a bit SPI usage and fix few RAM allocation problems in the original coptermanager.

author
tomatoskins (author)2015-07-24

This is really cool! Have you noticed any lag in the controls?

author
vshymanskyy (author)tomatoskins2015-07-25

It was nearly 50-100 ms with remote server (on a different continent!!!).

Anyway I was able to control the quadcopter :)

BTW, we're now working on adding direct connections through BLE and later WiFi, it will eliminate the server link (specially for such cases).

author
tomatoskins (author)vshymanskyy2015-07-25

Hahaha that is so cool!