Introduction: DC Motor Control With Bluetooth

Picture of DC Motor Control With Bluetooth

The purpose of this proyect consist on control a DC motor with a Smartphone. The speedo of the DC motor will change. The communication between the DC motor and the Smartphone will be done using a Bluetooth module attached to an Arduino UNO module

Step 1: The Design of the Circuit

Picture of The Design of the Circuit

First, according to specifications (what we want to do) a sketch of the circuit will be developed. This first drawing of the circuit, can be also done using a circuit design programm. For this proyect, the circuit will be designed with a free to use design online software called 123D circuits. The needed materials are:

- Arduino UNO development board

- Bluetooth HC-05 module

- NPN Transistor, TIP 31C

- DC motor (5 Volts)

- Two source powers (4 AA battery case)

- fan blade

- Cables and connector for battery case

Step 2: Circuit Simulation

Picture of Circuit Simulation

After the design of the circuit, a test will be performed in order to know if the designed circuit will properly work. In the past, was necesary to build the circuit in order to test it. Now it its possible to simulate a circuit in order to know with more precision, how will it works. The online free tool 123D circuits will be used for the simulation. The component in red is the Bluetooth module

Step 3: Bluetooth Module (HC-05)

Picture of Bluetooth Module (HC-05)

A commonly used Bluetooth module is the HC-05. Since the communication between the PC and the Arduino UNO is serial, the wireless communication is achieved using a device (HC-05) that emulates the serial communication. Two pins from the Arduino are needed, by default are the pins 0 and 1 (RX ==> receive, TX ==> transmit). Also there is a library that can emulate the function of these 2 pins using other different pins. The HC-05 has 6 pins, for this proyect only four will be used, the pins STATE and EN will be disconected.

Step 4: ​Assembly of the Circuit

Picture of ​Assembly of the Circuit

The picture shows all the needed componets. Two power sources will be needed, one for the Arduino UNO board and other for the componets outside the Arduino UNO board (Bluetooth module, transistor, DC motor), this two power sources must have a common earth (the two 0 Volts wires must be connected each other).

The control of the DC motor will be defined using number in the programm:

0 ==> off

1 ==> speed 1 (12.5%)

2 ==> speed 2 (25%)

3 ==> speed 3 (37.5%)

4 ==> speed 4 (50%)

5 ==> speed 5 (62.5%)

6 ==> speed 6 (75%)

7 ==> speed 7 (87.5%)

8 ==> speed 8 (100%)

Step 5: Smartphone Connection and Programm

In this step, will be posted the programm. The connection in the smartphone will be done using an app for Bluetooth connection with an Arduion board. Many apps are in Google Play. After installing the app, the connection between the HC-05 and the smartphone must be established. First the smartphone must search, find and connect with the HC-05. Then the installed app should be oppened and in this app, the connection with the HC-05 must be again established.

Here is the used programm with comments.

// The program is designed to perform the next tasks:

// 1. A Bluetooth module (HC-05) will be configured

// and attachet to an Arduino UNO module

// 2. A DC motor will be attached to one output of the Arduino board

// 3. The DC motor will be remotely controlled using a smartphone

// 4. Different speeds will be programmed

// Written by Alberto Morales San Juan

#include // serial communication library

SoftwareSerial ConfigurePorts (8, 9); // Port_8 ==> RX, Port_9 ==> TX

int ReceiveInfo; // for the received information

int MotorPort=11; // Port 13 for the dc motor

void setup()


ConfigurePorts.begin(9600); // Baud rate

ConfigurePorts.println("0=off, 1=speed 1, 2=speed 2 ...");

pinMode(MotorPort, OUTPUT);


void loop()




switch (ReceiveInfo)


case '0': // off




case '1': // speed 1




case '2': // speed 2




case '3': // speed 3




case '4': // speed 4




case '5': // speed 5




case '6': // speed 6




case '7': // speed 7




case '8': // speed 8







Step 6: Test

The proyect will be tested using the smartphone.


brydeery31 (author)2017-06-01

I am trying to upload this arduino program onto the board, I am using the Arduino1.8.2 to do it, but the sketch won't verify for some reason. How were you able to upload this sketch as a software to the board?

ayshaa made it! (author)2016-07-17

we do it as our mini project...we changed the program a little to get the output...anyway thank you very much

maryalav (author)ayshaa2017-02-05

Which app you have installed to control speed of DC motor

ayshaa (author)maryalav2017-02-05

we changed the program (Arduino IDE) a little

cartonerdd (author)ayshaa2016-08-01

Great, good that the proyect worked well. Your welcome

maryalav (author)2017-02-05

what programm should we use to configure arduino

Rhino169 (author)2017-01-25

what would you need to do to make the motor go forward or reverse?

MatheusM49 (author)2016-05-05

Where can I find Android program code?

cartonerdd (author)MatheusM492016-05-05

The program code in in the tutorial, on step 5.

95basilk (author)2016-03-26

hii sir... i made the connections as per the instructions...and also programmed the arduino uno...i can connect the bluetooth to my android ...but i can't control the speed...
when i connect the circuit the motor starts working ... if i give instruction in mobile like 0 it gives result as off... but no change in speed of motor . help me to fix it..

RoryB5 (author)2016-03-16

is the code downloaded to the phone ? it didn't look like you were connected to a computer.

cartonerdd (author)RoryB52016-03-16

the code is not downloaded to the phone. There is a communication between the phone and the Arduino. The phone sends the instructions to the Arduino

SampsonJ (author)2016-03-08

Why don't you use the RX and TX on the arduino board??

cartonerdd (author)SampsonJ2016-03-16

Hello, the RX and TX pins can be used also. A second posibility is to use the software serial command to work with other pins

GyroHeat (author)2016-02-13

Why didnt you use a diode?

cartonerdd (author)GyroHeat2016-02-14

I used two independent Voltage source. One source for the electronics and the second one for the dc motor

amey007 (author)2016-02-09

which app did u use from playstore?

cartonerdd (author)amey0072016-02-10


I used the "Bluetooth Terminal" and the "ArduinoRC" apps. Theoretically all apps that are included in the search term "android bluetooth" should work.

Also remember to pair first your smartphone with the HC-05 module.


About This Instructable




More by cartonerdd:Ultrasonic SensorOmnidirectional RobotInsect Robot !!
Add instructable to: