Arduino Controlled Motor ESC

4 Years ago I made my own drone for a cost of $300 back when the first commercial drone was about $1500. The Arducopter controller controlled the motor ESC, I used the DJI DIY frame, and bought a 720MHZ remote control. Here is a modified KIT of what I built 4 years ago. KIT

Now that I have bit more experience in electronics aerospace engineering, I want to build my own arducopter controller to control the drone. I will be using Arduino for my platform. For today, I will demonstrate that we can control an ESC with and arduino nano.

Materials: Get Most Materials Here
Battery that will run the motor
Solder Iron
Arduino Nano
Bread Board
Jumper Wire
USB Cable
Arduino IDE

Step 1: Solder your Motor to the ESC controller.
Step 2: Attach your Arduino Nano to a bread board.
Step 3: Attach your Battery – to the ESC Black Wire.IMG_20180605_005410
Step 4: Attach your ESC Black to the Arduino GND Pin.
Step 5: Attach your ESC White wire to Arduino D9 Pin.IMG_20180605_005423

Step 6: Attach Arduino Nano to PC with USB Cable.
Step 7: Program Arduino Nano with this Code in Arduino IDE.
#include ;
Servo esc;
int Pin = 0;
int x = 0;
void setup()
void loop()
int throttle = analogRead(Pin);
throttle = map(throttle, 0, 1023, 0, 179);
for(x = 0; x < 175; x++){
delay (250);
Step 8: Attach your ESC Red wire to Battery +.
Step 9: Enjoy your Arduino Nano commanding the ESC with PWM commands.

Radar and the DJI Farming Drone

Drones are become widely used outside of the consumer industry. One of the branches of drone use is in farming. How are drones used? Well, they can be used for crop degradation detection, water dispersion observation, and crop dusting just to name a few. DJI AGRS MG-1 drone performs crop dusting. To see DJI’s farming page click here.


Why use drones vs other means of crop dusting? A couple of answers:

  1. Drones are generally quick and easy to set up vs a tractor, or a plane.
  2. Drones are cheaper than a tractor and plane in the long run.
  3. One does not need a hard and expensive flying lesson to fly a drone unlike a plane.
  4. Drones can perform more even dusting of fertilizer and chemicals
  5. Drones will help improve land utilization since a drone may fly over vs a tractor driving through a field.


So how is a drone more efficient at spraying chemicals than a plane or someone manually? Sensors….But not just any sensors, it has radar and most likely a liquid management software system.

How does radar work?

Radar more or less is pretty simple to understand but slightly harder to implement. Radar frequency signal, like sound but typically not audible to the human ear, is produced by an antenna or speaker. This signal will travel until it hits an object in which the signal will then bounce off and return to the antenna or receiver speaker. The time from when the signal was produced to when the signal is received is calculated. That calculation is then used to determine the distance the object is from the radar sensor and in DJI’s case, it’s drone.

Credit: Georg Wiora (Dr. Schorsch) – Self drawn with Inkscape 

DJI uses microwave radar and gets centimeter precision which means the frequency that is used to produce the signal is in the range of 3-30GHz or 1-10cm. Kind of a broad range but that is better than the 100Mhz to 100 Ghz that Microwave frequency is quantified as.

Having a drone with radar, getting centimeter precision, the ability to fly at the optimum height to evenly spread chemicals to crops, and perform the task quicker than manual workers is a win win for farmers trying to bring their crop yields up and costs down.

As stated, this is only one subset of what drones are used outside of the consumer world to better the world. If you have an idea or have created an idea that will better the world through drones or some other invention and you may be featured here on the site. Please send me an email @   with your idea or invention.

Disclaimer: This blog is solely Tinee9’s opinions through electrical engineering experience and does not have exact knowledge of the inner workings of DJI products that would compromise IP, or patent infringement. DJI is not a sponsor of Tinee9 but Tinee9 is apart of DJI affiliate program to help earn revenue to keep the website going.

DJI Mavic Pro vs Platinum Flight Times What Caused the Increase?

I have followed the technology advances like farm drones observing water drainage to crop decay, construction degradation monitoring, and potentially drones placing building frames instead of people. But the other day, something caught my eye with DJI Mavic Pro and its sibling DJI Mavic Pro Platinum.  What was interesting, is that the flight time between the two drones, (27 minutes increased to 30 minutes) and how they drive their motors. See the below diagrams.

Sine Drive vs Trap Drive

According to the the above picture they say the propellers and the motor ESC drivers improve noise control and stability. It is true that if the motor commutation is done with Sine drive (right diagram) vs trap-drive/6 step drive (left diagram), the system will have improved stability. An improved shape and material can also improve noise reduction also. But what also happens is that the motor will perform more efficiently giving the motor more thrust for the same amount of current commanded.

What is the different between trap-drive and sine-drive?

Quick info:
In a brushless motor that is in most drones, there are 3 phase lines. Each will be controlled independently but in combinations.

-Commands the next phase combination to turn the motor when the motor state changes, usually by reading hall effect devices or x-y sensor data.
-Easy to implement in code quickly and effectively
-Does not need extra hardware to read voltage on the phase lines of the motor.
-Does not necessarily need hall effect devices or xy sensors to move the brushless motor.
-Does not command the motor at the right time. This won’t allow optimal torque out of the motor.
-Less efficient = More heat and Less flight time.
-Less consistent with torque output.

-Continually commands the phase lines of the motor to allow the current and Voltage to follow the back EMF curves (see right diagram from above) of the motor to provide optimal torque at all times.
-Makes the use of a motor very efficient by allowing the same amount of current to be used and achieve the best torque  the motor can provide.
-Better efficiency = less heat on board and more flight time possibly less weight.
-Near perfect consistency with torque output.
-Less current ripple on circuit board means less noise getting on radio lines which means farther flights.
-Harder to implement in code.
-Need more components because more information is needed to be able to commutate in sine-drive.
-Motors can be sensitive if not coded correctly.

It is cool to see commercial companies start putting in software and hardware architecture to improve flight times, reduce weight, and increase flight distances.

Even though the Mavic Air just came out which has some pretty cool features, I am probably going to get the Mavic Pro Platinum with the FPV Goggles because of the farther flights and longer flight time. Hope I can get a hold of one and get flying again soon.

Credit: All pictures are from website and not of my own making.
Disclaimer: This blog is solely Tinee9’s opinions through electrical engineering experience and does not have exact knowledge of the inner workings of DJI products that would compromise IP, or patent infringement. DJI is not a sponsor of Tinee9 but Tinee9 is apart of DJI affiliate program to help earn revenue to keep the website going.