I have recently bought two brushless motors (Brushless-300w-6-5-Wheel-Tyre-Motor-Hoverboard-Swegway-Board-Replacement-Part) along with two ESC (https://hobbyking.com/en_us/hobbyking-40a-esc-4a-ubec.html).

I have connected the hardware accordingly (photo attached, the potentiometer throttle included is not included in the photo).

And I try run the following code:

#include <Servo.h> //Using servo library to control ESC

Servo esc; //Creating a servo class with name as esc

void setup()


esc.attach(10); //Specify the esc signal pin,Here as D10

esc.writeMicroseconds(2000); //initialize the signal to 1000


esc.writeMicroseconds(1000); //initialize the signal to 1000




void loop()


int val; //Creating a variable val

val= analogRead(A0); //Read input from analog pin a0 and store in val

val= map(val, 0, 1023,1000,2000); //mapping val to minimum and maximum(Change if needed) 
esc.writeMicroseconds(val); //using val as the signal to esc

The motors seem to vibrate and turn only when the potentiometer is at a specific point, and are then inert for all the subsequent positions.

Does anyone have any advice on how to overcome this issue?

Thanks!![Hardware Setup]1

  • I don't know how to control an ESC via the arduino, but I did just find this link which seems to have a fair amount of information, such as calibrating the ESC. dronesandrovs.wordpress.com/2012/11/24/… – Bja Feb 12 '19 at 16:02
  • It may or may not help if you read the troubleshooting part of the ESC manual: cdn-global-hk.hobbyking.com/media/file/378561453X16958X28.pdf – Bja Feb 12 '19 at 16:17
  • 1
    If the photo and code attached are correct, you connected the ESC to physical pin 53 (I believe, photo is blurry), but when calling esc.attach() you are using pin 10. If this is the case and a mistake has been made, please either connect the esc to pin 10 or change the code to say esc.attach(53). – Bja Feb 12 '19 at 16:24
  • 1
    Your code immediately sets the ESC to high upon startup. Most ESCs have protection, and if the initial signal is high, they lockout until you go all the way back to low. You may not have low calibrated though, so it might not ever let you control it. Calibrate by (remove initial high-low code first) setting the pot to high (with the ESC disconnected from power), then powerup the ESC. You should hear a bunch of beeps, and when it stops, slowly turn the knob all the way to low, and you should be met with some more beeps. Disconnect power, reconnect, and try control (starting with a LOW signal) – HavocRC Feb 12 '19 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.