Written by: techguru


I want to show you in this "Instructable" how to control a brushless motor with Arduino.

Step 1: Parts required

arduino esc motor 3.jpg

1.- Arduino UNO

2.- Battery and Compact Charger

3.- ESC

4.- BrushLess Motor

5.- Battery and Motor/ESC connectors

5.- Breadboard

6.- Wire

7.- PC with Arduino IDE

I bought some components by Internet:

1.- BrushLess Motor/ESC/Propeller/connectors set:

2.- Battery

3.- Compact Charger

Step 2: Battery charge

We need to charge de battery, then connect the charger to the power and 3 green LED lights will illuminate. Then connect the battery to the charger and 3 red LED lights will illuminate. When the 3 battery cells are 100% the 3 green LED lights will illuminate.

Step 3: Soldering connectors

Picture of Soldering connectorsarduino esc motor 5.jpg

We need to solder some components:

1.- BrushLess Motor

2.- ESC

Step 4: Upload Arduino program control

We need to load the program that controls the ESC/Motor

- Code:

/*Coded by Marjan OleschSketch from Open source - do what you want with this code!*/ #include <servo.h>int value = 0; // set values you need to zeroServo firstESC, secondESC; //Create as much as Servoobject you want. //You can controll 2 or more Servos at the same timevoid setup() {  firstESC.attach(9);    // attached to pin 9 I just do this with 1 Servo  Serial.begin(9600);    // start serial at 9600 baud}void loop() {//First connect your ESC WITHOUT Arming. Then Open Serial and follo Instructions   firstESC.writeMicroseconds(value);   if(Serial.available())     value = Serial.parseInt();    // Parse an Integer from Serial}


Step 5: Create Sketch

Picture of Create Sketcharduino esc motor 6.jpg

Once uploaded to the Arduino sketch by the USB wire then we connect motor brushless with the ESC. And we connect the ESC to the Arduino like:

- ESC Green wire -> GND Arduino

- ESC Red wire -> Null (dont connect because its possible that the usb port PC will crash)

- ESC Yelow wire -> PIN 9 Arduino

Open the monitor serial at Arduino IDE and write 700 ( it's the minimum value for the motor)

Connect the battery to the ESC

And it will sound some melody from the ESC.

You can write at serial monitor diferent values like ( 750,800,900,..., maximum value is 1900 for this motor)