Arduino - Control DC Motor Via Bluetooth

291,214

675

132

Published

Introduction: Arduino - Control DC Motor Via Bluetooth

About: Author, Blogger, Electronics Enthusiast and Entrepreneur. For complete Electronics Projects and Tutorials go to: http://randomnerdtutorials.com/start-here
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:

3 People Made This Project!

Recommendations

  • Water Contest

    Water Contest
  • Creative Misuse Contest

    Creative Misuse Contest
  • Oil Contest

    Oil Contest

132 Discussions

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

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

0
user
NaniB5

8 months ago

can you help me to control the speed of dc motor

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

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

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.

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

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.

hi this was a very good project

Clap clap

And I have a question can we make this voice controlled

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...

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

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.

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

i cant connect to bluetooth !!why ?

its pair with the smart phone but no match !!

0
user
JomA2

2 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

What is the power source for the motor...??? I mean don't we need a battery or something to power up the circuit???

Im doing a school project and I want to do this with a third motor, and relays and lights. I am using the relays to give it 9.6v instead of 5v how would I change the code to help me set it up using the blueterm app

hello sir.... how can i control spees without using an arudino uno r3??
can i use anything other which çan be manufactured by ourselves insted of this arduino?