Arduino - Control DC Motor Via Bluetooth

304,882

679

135

About: Author, Blogger, Electronics Enthusiast and Entrepreneur. For complete Electronics Projects and Tutorials go to: https://RandomNerdTutorials.com
Hi guys,
In this project we will control a DC motor with a smartphone via bluetooth. This project is great to learn more about:
-DC motor
-Interfacing Arduino with your smartphone
-Bluetooth module
-L293D

you can visit my website for more electronic projects, interesting news and tips.
Check this video to see it working

Step 1: Parts Required

1x Arduino Uno
1x Bluetooth Module (for example: HC-05)
1x Smartphone (any Android will work)
BlueTerm application
1x L293D IC
1x DC motor
1x Breadboard
Jumper Cables

Step 2: Schematics and Common Mistakes

Two common mistakes:
-You need to remove the RX and TX cables when you’re uploading the sketch to your Arduino.
-Sometimes people connect the TX from the bluetooth module to the TX of the Arduino… that’s wrong and it won’t work. Make sure you connect it properly, the TX into RX and the RX into the TX.

Note:
If the HC-05 Bluetooth Module asks for a password, It's '1234'.

Step 3: Arduino Code

For the android communication with our bluetooth module I’ve used the BlueTerm app, It’s completely free, so you just need to go to “Play store” and download it. Then you just need to connect your smarthphone with the bluetooth module. Remember to remove the TX and RX cables. (you can see in youtube video below how that’s done).

Step 4: Final Product

I’ve only set 3 commands to control the DC motor:

    ’0′ – Turns off the DC motor
    ’1′ – DC motor rotates to right
    ’2′ – DC motor rotates to left

Check this video to see the circuit in action!
you can visit my website for more electronic projects, interesting news and tips:

4 People Made This Project!

Recommendations

  • Tape Contest

    Tape Contest
  • Trash to Treasure

    Trash to Treasure
  • Arduino Contest 2019

    Arduino Contest 2019

135 Discussions

0
None
NaniB5

1 year ago

can you help me to control the speed of dc motor

1 reply
0
None
avioarte

Question 2 months ago

All I need is a microcontroller for dc motor speed control, powered by 3.7 volt rechargeable lipo battery, and that can be operated from my cell phone with a bluetooth application. Thank you.
Arthur.

0
None
HashirA7

10 months ago

HI GUYS I AM DOING THIS PROJECT FOR COLLEGE SOMEHOW THE MOTOR ARE NOT WORKING FOR ME I TRY TO BUILD 5 TO 10 TIMES EVERYTHING SEEMS TO WORK PERFECTLY FINE I AM JUST WONDERING IF I USE THE SAME IC INSTEAD OF L293D DOES IT MAKE ANY DIFFERENCE I AM USING SN754410NE PLS REPLY ASAP THANKS

0
None
BalaG20

Question 1 year ago on Step 3

In this given coding, first five lines contains your details .Which is also include in the program or not?

0
None
danielferns

1 year ago

Very helpful. Is there a way i can control the speed of the motor via bluethooth. Or serial com via pc? Thanks in andvance!

1 reply
0
None
TorinA1danielferns

Reply 1 year ago

you would need either a stepper or servo motor for accurate speed control

0
None
bcboy1956

1 year ago

I am new to the electronic build is there more information regarding the electronic parts, detailed instruction of the schematics? like how to attach the wires to the dc motor etc.

0
None
prakhar_42

1 year ago

Hey guys I am facing a problem in connecting my app with HC-05 its like there is no option for connect

0
None
grechy29

1 year ago

This circuit works amazing, however, i had to create a trick in the system so that i got my motor to run off 11.4v whilst the arduino worked off 11.4 through a 5v voltage regulator.

0
None
Hi I am mad

2 years ago

hi this was a very good project

Clap clap

And I have a question can we make this voice controlled

0
None
desertwalker

2 years ago

Hey Rui,

Thanks for a great tutorial, just wanted to point out a discrepancy with the code you kindly provided and the Fritzing diagram.

In the code

int motorPin1 = 3; // pin 2 on L293D IC
int motorPin2 = 4; // pin 7 on L293D IC

In the diagram

3 ---> pin 7 on L293D IC

4--> pin 2 on L293D IC

Regards,

desertwalker...

0
None
cyhalosrox

2 years ago

is there a more detailed instruction of the schematics? like how to attach the wires to the dc motor etc.

0
None
DishantS6Agent shah

Reply 2 years ago

dude, you can, if you use l293d then basically pins 3 and 6 of the l293d can control one motor and pin 14 and 12 can connect to another motor on l293d.

0
None
SebastianC54Agent shah

Reply 3 years ago

I did my project with out the transistors and it worked fine, you will want to just directly wire two pins per motor, with one on high and the other on low, i can get you a code ill put in the comments tomorrow

0
None
MohammedM95

3 years ago

i cant connect to bluetooth !!why ?

its pair with the smart phone but no match !!

0
None
JomA2

3 years ago

The code and circuit I have run perfectly when connected up to my laptop or any computer. But when connected to an external power supply its not working