Instructables

Arduino - Control DC Motor via Bluetooth

Featured
Picture of Arduino - Control DC Motor via Bluetooth
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
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts required

Picture of Parts required
L293D.gif
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

Picture of 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

Picture of 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

Picture of 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:

1-40 of 73Next »
gsandhu21 month ago

I’m working on a project which is about making a rescue
robot . I have struggling with it for 4 months and now all the mechanical works
had been done . but I’m facing difficulty in make the robot to work with rf
module can u plzz help me…

I want make transmitter and receiver that can control the
motion…I mean that receiver should have control 8 dc gear motor and each dc
motor should have a forward and backward botton to control the motion ……can u
kindly help me with this project ….if u can make the circuit board diagram for
the PCB ….or any other suggestion plz reply……mail me at “sunny1995gagan@gmail.com”

Sheikh Zabi1 month ago

I have a project - Bluetooth data acquisition system using arduino , I will be receiving data on my android phone, so if I could know the android coding part it really would be helpful.

hustlervanz4 months ago

can i use L293NE IC than L293D IC?

The NE is just the package so there is a L293NE and a L293DNE, but the difference is that the L293DNE has flyback diodes built in while the L293NE does not and they need to be added externally as on page 2 of the datasheet:

http://www.ti.com/lit/ds/symlink/l293d.pdf

jacpac4 months ago

can i use 2 motors? and how?

jacpac4 months ago

can i use my nano to create this project

i need ur .aia file for android

ongara_015 months ago
can help me bot ths dc motor; minebea 17PM-J. m need the spect
famsinyi5 months ago

Hi, the hc 05 (slave module) I purchased cannot be detected by my android. I think the connection is straight forward, I suspect the module I bought doesn't work, can u point me to any store to buy one that you used?

Hi!

Thanks for the code and all the instructions! Good sharing.

I have a problem as the bluetooth module I am using is a different one, in my case it is LCBTCY6, but unfortunately it is not working. Do you have any clue about why might it be? Through the serial monitor works perfectly.

Thanks in advance!

RuiSantos (author)  áde marcos serrano6 months ago

Thanks Áde.

If it's working via serial monitor means your circuit is correct!

About your bluetooth module... I'm not sure how it works...as I've never used one. Try to take a look at both datasheets.

See If my bluetooth works like yours.. as I don't have the time do that myself.

Your module might need some kind of configuration before you use it. because I'm sure both modules can communicate via serial port with the Arduino.

namrataqwer7 months ago
hey after instaliing blueterm app. do we need to do anythng in that app.. means for setting commands n all.. plz reply fast...
RuiSantos (author)  namrataqwer6 months ago
You don't need to configure anything... I think, but you can change if you like... for a better display. take a look at all the setting and change the way you prefer.
Sorry for taking so long to answer I've only saw you question today.

cgoh18 months ago
Hi, we have used the given code above. However, the motor only seems to turn left but not turn right. do you know what is the problem occuring?
nileshs cgoh16 months ago
In which software this code i have to write please sir tell me.
RuiSantos (author)  nileshs6 months ago
The code is to be upload through the Arduino IDE into the Arduino board :)
prana39 months ago
Hey brother ...The Blue term app is not available on play store //....
So can anyone plz suggest any other app to control bluetooth
RuiSantos (author)  prana39 months ago
I didn't knew... Instead of using blueterm, please take a look at my new tutorial here:
http://randomnerdtutorials.com/arduino-control-2-dc-motors-via-bluetooth/

I've developed this app with Mit App inventor... so you can control your arduino via bluetooth. Take a look it's much better then blueterm and it looks nicer.

I hope this helps, leave a comment on my website if you have any questions.
All the best,
Rui Santos
Lindermann959 months ago
Hi!
i found an app for my iPhone 5, "nBlueTerm"
it will work? or i need an android phone?
Thanks! :D
nc0889 months ago
Why do you need to connect the bluetooth module after you connect with bluetooth. is there any way this can work without having to make the connection after you connet by bluetooth?
1234rcadj9 months ago
how could i download the android apps so that i can continue my study? please help
RuiSantos (author)  1234rcadj9 months ago
Id didn't developed this android app... Blueterm app is not mine... sorry,
But I have a android app that you can download at my website...

there's the link: http://randomnerdtutorials.com/arduino-control-2-dc-motors-via-bluetooth/
temotion10 months ago
whether I could ask for a tutorial to make this tool?
rlarios10 months ago
Hi there Rui,

I am currently working on an Arduino project and I noticed I can't get my code displayed the way you did on this project.

What software tools do you use to do this?

Thanks in advance, pal and keep up the good work!

rlarios
hey i just used bluetooh hc 05 and follwed the same schematics but it didnt work
RuiSantos (author)  shivamundisputed11 months ago
I'm sure my project is working 100%... because more than 50 people messaged me saying it was working...
Please make sure you check the most common mistakes...
see if you're TX is connect to RX and the RX is connected to the TX.
Check if you're IC is on the correct way.
If it's still not working.
before even connect the bluetooth module check if your circuit is working by sending those numbers '0' '1' and '2' through the serial monitor... if it's working like that it might be a problem with your bluetooth module

good luck!
thanks so much for trying my project let me know if you have more questions.
the best way to contact me is by leaving a comment on my website.
(http://randomnerdtutorials.com)
us2410981 year ago
Can u plzz tell me what is its range ..... I want to make a car using your idea any suggestions plzz
RuiSantos (author)  us2410981 year ago
The range is about 5-6 meters with these bluetooth module, I already reached 10 meters and It worked just fine, but sometimes with more than 6 meters you will get disconnected.
If you want more range, I recommend you to buy a better bluetooth module I guess
Good luck with your projec I look forward to hear more about that :)
vek11 RuiSantos11 months ago
What are your recommendations for a "better" bluetooth module?
makiemo1 year ago
hei there.. can i just connect the arduino with my smart phone without using the blue term?? thanks alot
RuiSantos (author)  makiemo1 year ago
yes you can connect but then you can't do anything... because the Bluetooth itself of your smartphone can't send any information for your arduino. you need an app for that. That's why I'm using blueterm
supsuppl881 year ago
hii
can u tell me the sketch required to set JY-mcu to pairable mode and after i connect it to my smart phone the arduino read what i send in blueterm
RuiSantos (author)  supsuppl881 year ago
Actually i don't know exactly how's the skecth, because mine didn't needed... :S
supsuppl881 year ago
when i plug the hc05 to uno and try to pair it with my mobile ,it doesnot appear on device availble so how i configure the bluetooth hco5
RuiSantos (author)  supsuppl881 year ago
that's really weird, If it doesn't appear you must be doing some connection wrong.
Try to check all the wires again.
If it keeps not appearing try with another smartphone...
how much did the arduino cost??
RuiSantos (author)  swadib silla1 year ago
But usually an original arduino it's a bit more expensive $30 for just an Arduino Uno,
But you can buy a cheap clone for $20 that works just the same :)
RuiSantos (author)  swadib silla1 year ago
http://randomnerdtutorials.com/reviews/
you can find a kit on amazon, for $25 it includes some parts and a breadboard .
Check my website for more information :)
camvo1 year ago
I used the Bluetooth Mate - Silver RN-42 bluetooth module.
See my post of 12th MAy

I reached 20m

RuiSantos (author)  camvo1 year ago
nice that's really good!
1-40 of 73Next »