loading

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

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

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)

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

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()

{

if(ConfigurePorts.available()>0)

{

ReceiveInfo=ConfigurePorts.read();

switch (ReceiveInfo)

{

case '0': // off

analogWrite(MotorPort,0);

ConfigurePorts.println("off");

break;

case '1': // speed 1

analogWrite(MotorPort,40);

ConfigurePorts.println("1");

break;

case '2': // speed 2

analogWrite(MotorPort,60);

ConfigurePorts.println("2");

break;

case '3': // speed 3

analogWrite(MotorPort,80);

ConfigurePorts.println("3");

break;

case '4': // speed 4

analogWrite(MotorPort,100);

ConfigurePorts.println("4");

break;

case '5': // speed 5

analogWrite(MotorPort,120);

ConfigurePorts.println("5");

break;

case '6': // speed 6

analogWrite(MotorPort,160);

ConfigurePorts.println("6");

break;

case '7': // speed 7

analogWrite(MotorPort,200);

ConfigurePorts.println("7");

break;

case '8': // speed 8

analogWrite(MotorPort,240);

ConfigurePorts.println("8");

break;

}

}

}

Step 6: Test

The proyect will be tested using the smartphone.

<p>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?</p>
we do it as our mini project...we changed the program a little to get the output...anyway thank you very much
Which app you have installed to control speed of DC motor
we changed the program (Arduino IDE) a little
Great, good that the proyect worked well. Your welcome
what programm should we use to configure arduino
<p>what would you need to do to make the motor go forward or reverse?</p>
<p>Where can I find Android program code?</p>
The program code in in the tutorial, on step 5.
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...<br>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..
<p>is the code downloaded to the phone ? it didn't look like you were connected to a computer.</p>
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
<p>Why don't you use the RX and TX on the arduino board??</p>
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
<p>Why didnt you use a diode? </p>
<p>I used two independent Voltage source. One source for the electronics and the second one for the dc motor</p>
<p>which app did u use from playstore?</p>
Hello,<br><br>I used the &quot;Bluetooth Terminal&quot; and the &quot;ArduinoRC&quot; apps. Theoretically all apps that are included in the search term &quot;android bluetooth&quot; should work.<br><br>Also remember to pair first your smartphone with the HC-05 module.<br><br>BR

About This Instructable

9,142views

146favorites

License:

More by cartonerdd:Ultrasonic Sensor Omnidirectional Robot Insect Robot !! 
Add instructable to: