Interfacing Brushless DC Motor (BLDC) With Arduino

77,984

202

82

Introduction: Interfacing Brushless DC Motor (BLDC) With Arduino

About: A grad student at Boston University, I graduated with Computer Engineering degree and my area of interest is Robotics. I also have a heavy inclination towards the DIY philosophy. Previously I was a Research As…

This is a tutorial about how to interface and run a Brushless DC motor using Arduino. If you have any questions or comments please reply in comments or mail to rautmithil[at]gmail[dot]com. You can also get in touch with me @mithilraut on twitter.

To know more about me: www.mithilraut.com

Step 1: List of Components

  1. Arduino UNO
  2. BLDC outrunner motor (Any other outrunner motor will work fine)
  3. Electronic Speed Controller (Choose according to the current rating of the motor)
  4. LiPo Battery (to power the motor)
  5. Male-Male Jumper cable * 3
  6. USB 2.0 cable type A/B (To upload the program and power the Arduino).

Note: Make sure you check the connectors of battery, ESC and Motors. In this case we have 3.5mm male bullet connectors on the Motor. So I soldered 3.5mm female bullet connectors on the output of ESC. The Battery had a 4.0mm Male Female connector. Hence I soldered appropriate female male connectors on the input side of ESC.

Step 2: Connections

Connect the motor to the output of ESC. Here, the polarity doesn't matter. If you switch any 2 of the 3 wires, the motor will rotate in opposite direction.

Connect the '+' & '-' of battery to the Red(+) and Black(-) wires of ESC respectively.

From the 3pin servo cable coming out of the ESC, connect the Brown cable to the 'GND' pin on Arduino. Connect the Yellow cable to any digital pin. In our case its digital pin 12.

Step 3: Programming Arduino UNO

If you are new to Arduino then you can download, install and setup the Arduino from here.

Connect the Arduino to the PC. Open Arduino IDE and write this code. Under 'Tools' select

Board: Arduino/Genuino UNO

Port: COM15 (Select appropriate COM port. To find out the COM port open device manager and look for Arduino UNO under 'Ports')

Click Upload button on the upper left corner.

#include <Servo.h>
Servo esc_signal;

void setup()
{
  esc_signal.attach(12);  //Specify here the pin number on which the signal pin of ESC is connected.
  esc_signal.write(30);   //ESC arm command. ESCs won't start unless input speed is less during initialization.
  delay(3000);            //ESC initialization delay.
}

void loop()
{
esc_signal.write(55);	  //Vary this between 40-130 to change the speed of motor. Higher value, higher speed.
delay(15);
}

Step 4: Note

The correct way to run the motors is to

1. Connect the battery to the ESC to power up the ESC.

2. Power the Arduino.

If you do the other way round, the Arduino will run the arm sequence and the ESC will miss those commands since it isn't powered up. In this case press the reset button on the Arduino.

1 Person Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

82 Discussions

0
ragavendran954
ragavendran954

11 months ago

How i reverse the bldc using arduino coding?? (without alternate two esc wires)

0
MithilR
MithilR

Reply 11 months ago

There are special ESCs which offer that functionality through software control.

0
mubashirazmat1992
mubashirazmat1992

Reply 2 months ago

Is there any possibility that we would reverse the direction of Brushless DC Motors with ESC using Arduino programming ?

0
MithilR
MithilR

Reply 2 months ago

For traditional ESCs you cannot reverse the direction using software. You need special ESCs which can do that.

0
mubashirazmat1992
mubashirazmat1992

Reply 2 months ago

thank you for your response. I have special ESCs as well but for that I'm trying to search the Arduino code about the direction of ESC but I could not be able to find it yet .. Will you please help me as I'm using the same code as you applied .. I want to move it in a clockwise and anti clockwise directions …

0
Baptiste Hoorelbeke
Baptiste Hoorelbeke

Question 1 year ago on Step 1

Dear Sir,
For a small project at school I saw your website about the brushless DC motor. My idea was to make the motor myself like on this website: https://www.thingiverse.com/thing:2375081
My question is: Would that be possible with a homemade engine? (Everything can be bought)
Thank you in advance!

0
MithilR
MithilR

Answer 11 months ago

I am not sure. You will still need an ESC which is compatible with the motor.

0
SoumyaB14
SoumyaB14

1 year ago

from esc to aurdinuo 14 pin why it is connected

0
MithilR
MithilR

Reply 11 months ago

That's the ground cable.

0
otemubrinsley12
otemubrinsley12

Question 1 year ago on Step 1

Can I connect the ESC with the BLDC motor without an Arduino?

0
MithilR
MithilR

Answer 11 months ago

Yes, but you won't be able to control them.

0
ShriRamPathade
ShriRamPathade

1 year ago

Hi, How to run sensored bldc motor of rating 5kw using aurdino controller

0
MithilR
MithilR

Reply 1 year ago

I think the one with sensors either have a local feedback loop to control the speed or bring out the pins which can be connected to the system to feedback.

0
rajamanickam1
rajamanickam1

Question 1 year ago on Introduction

How can I reverse the direction of the BLDC motor? What is the ESC controller required to reverse the direction of the BLDC motor 1105?

0
MithilR
MithilR

Reply 1 year ago

Reversing the direction is done by switching 2 cables going from the ESC to the motor. This is a manual method. You may have to check for ESCs out there which offer to switch direction as well.

0
عمارق
عمارق

2 years ago

Hallo, how can I control the brushless motor and esc via my iPhone Bluetooth ?
I have already Hm-10 bluetooth, but I need 1- the sketch of this project
2- and IOS App
Can anyone please help me ?

0
MithilR
MithilR

Reply 1 year ago

Yes, you can exchange data between the phone and the Arduino using the Bluetooth module. Use that data to write the speed.

0
PuneethS12
PuneethS12

Question 1 year ago

Why can't we nterface bldc motor using MOSFET circuit ?

0
MithilR
MithilR

Answer 1 year ago

I think some ESC's may have MOSFETs in it although I am not sure. I know they are used for DC motors.

0
Karthik118
Karthik118

Question 1 year ago

is it possible to reverse the speed and tell me how?