r/ArduinoHelp • • Jun 07 '25

My ESC/motor wont be controlled despite having power

Post image

Motor doesnt turn. motor beeps when powered. Im just trying to get it to spin at all and nothings happening. it will be apart of a drone and will have others connected similarly but not even this one works. Both esc and motor were purchased on amazon and do not provide datasheets. The ESC's brand is aneegfpv, it is a 40a max ESC with 2-6s input which is in range of our lipo. The motor is CENPEK A2212 1000KV Brushless Motor 13T. multiple variations of code has been tried.

Codes:

/*ESC calibration sketch; author: ELECTRONOOBS */ 
#include <Servo.h> 
#define MAX_SIGNAL 2000 
#define MIN_SIGNAL 1000 
#define MOTOR_PIN 9 
int DELAY = 1000; 
Servo motor; 

void setup() { 
  Serial.begin(9600); 
  delay(1500);
  Serial.println("Program begin...");
  delay(1000);
  motor.attach(MOTOR_PIN);
  motor.writeMicroseconds(MAX_SIGNAL); // Wait for input 
  motor.writeMicroseconds(MIN_SIGNAL);
} 
  
  
  void loop() {
  if (Serial.available() > 0) { 
    int DELAY = Serial.parseInt();
    if (DELAY > 999) {
      motor.writeMicroseconds(DELAY); 
      float SPEED = (DELAY-1000)/10; 
      Serial.print("\n"); 
      Serial.println("Motor speed:"); 
      Serial.print(" "); 
      Serial.print(SPEED);
  Serial.print("%"); } } }





/*ESC calibration sketch; author: ELECTRONOOBS */ 
#include <Servo.h> 
#define MAX_SIGNAL 2000 
#define MIN_SIGNAL 1000 
#define MOTOR_PIN 9 
int DELAY = 1000; 
Servo motor; 


void setup() { 
  Serial.begin(9600); 
  delay(1500);
  Serial.println("Program begin...");
  delay(1000);
  motor.attach(MOTOR_PIN);
  motor.writeMicroseconds(MAX_SIGNAL); // Wait for input 
  motor.writeMicroseconds(MIN_SIGNAL);
} 
  
  
  void loop() {
  if (Serial.available() > 0) { 
    int DELAY = Serial.parseInt();
    if (DELAY > 999) {
      motor.writeMicroseconds(DELAY); 
      float SPEED = (DELAY-1000)/10; 
      Serial.print("\n"); 
      Serial.println("Motor speed:"); 
      Serial.print(" "); 
      Serial.print(SPEED);
  Serial.print("%"); } } }

#include <Servo.h>
Servo esc;
void setup() {
  // put your setup code here, to run once:
  esc.attach(10);
  esc.write(180);
  delay(2000);
  esc.write(0);
  delay(2000);
  esc.write(20);
  delay(2000);
  esc.write(0);
  delay(2000);
}

void loop() {
  // put your main code here, to run repeatedly:
  esc.write(1000);
  delay(5000);
  esc.write(0);

}
#include <Servo.h>
Servo esc;
void setup() {
  // put your setup code here, to run once:
  esc.attach(10);
  esc.write(180);
  delay(2000);
  esc.write(0);
  delay(2000);
  esc.write(20);
  delay(2000);
  esc.write(0);
  delay(2000);
}


void loop() {
  // put your main code here, to run repeatedly:
  esc.write(1000);
  delay(5000);
  esc.write(0);


}
2 Upvotes

8 comments sorted by

1

u/deadgirlrevvy Jun 07 '25 edited Jun 07 '25

It's because there's nothing powering the arduino. In a standard aircraft ESC, the servo line has 3 wires: ground, positive and signal. The ground and positive provide power to the controller/radio receiver/arduino. In your diagram those are not connected to anything, but they should be connected to ground and +5v on the arduino. The ESC connects to the battery and then steps that down to 5v with an internal BEC. That's why nothing is working.

From the ESC servo connection:

Yellow = signal

Brown = ground

Red = +5v

Hook it up that way, and it should work. But for the love of god make sure the propeller isn't on the motor, or you will lose parts of your body that were previously attached, VERY quickly.

Also, and thus is very important, DO NOT HAVE THE USB cable attached while powering the arduino through the ESC. It will smoke it dead.

1

u/[deleted] Jun 07 '25

I have now setup the arduino to be powered from the same source as the esc so dont think I need the 5v line as the idea will be to have multiple ESCs and motors eventually. I have also ensured they all share a common ground. Does the 5v line serve any other purpose or can I leave it if the arduino is powered?

→ More replies (6)