Alien Power Systems ESC Control with Arduino


I am trying to control an ESC connected to a brushless motor with the help of Arduino.
The purpose of my program is just to familiarize myself with controlling the speed of the motor.
My esc is connected to a pwm pin and the program sends different output values using ESC.write(value); (from the Servo library);

From what I understood, the write() function can have 0-179 as an argument, 0 being full reverse throttle, 90 being stop, 179 being full FW throttle. Now when I tell the ESC to run at certain values, it does not respond at all sometimes, and it works some other times. It has a very unpredictable behavior and I am not sure which values work (yet alone if I’m doing the right thing with write() ).

Here is my code:

#include <Servo.h>

Servo esc;

void setup() {

void loop() {
int throttle;

for(throttle = 90; throttle < 179; throttle++)

The ESC and motor is here:


Try this test sketch, type a number from 0 to 180 into the serial monitor and hit [ENTER], start at 90, the motor should stand still or run very slow, type 80, the motor should run slowly, type 100, motor should run slowly in opposite direction, play with different numbers to see how system responds.

#include <Servo.h>
Servo servo;

int pos = 0;

void setup() {
  // initialize serial:
  Serial.begin(9600); //set serial monitor baud rate to match

void loop() {
  // if there's any serial available, read it:
  while (Serial.available() > 0) {

    // look for the next valid integer in the incoming serial stream:
    int pos = Serial.parseInt();
    pos = constrain(pos, 0, 180);