Arduino - Control DC Motor via Bluetooth

 by RuiSantos
Featured
6bluethumb.JPG
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

IMG_0244.JPG
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
swadib silla says: Jun 14, 2013. 5:20 AM
how much did the arduino cost??
camvo says: Jun 6, 2013. 9:32 AM
I used the Bluetooth Mate - Silver RN-42 bluetooth module.
See my post of 12th MAy

I reached 20m

us241098 says: Jun 4, 2013. 7:54 AM
Can u plzz tell me what is its range ..... I want to make a car using your idea any suggestions plzz
RuiSantos (author) in reply to us241098Jun 6, 2013. 3:17 AM
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 :)
jhebron says: May 31, 2013. 7:36 AM
What served as the power supply of arduino?
RuiSantos (author) in reply to jhebronJun 6, 2013. 3:15 AM
sorry for the long delay to answer... As a power supply for the arduino (and also the DC motor) I was using the USB cable connected to my computer
camvo says: May 12, 2013. 3:02 PM
I used the Bluetooth Mate - Silver RN-42 bluetooth module.
I had to change the baud rate to 115200.

Then it worked.

Thanks Rui.
Great tutorial.
RuiSantos (author) in reply to camvoJun 6, 2013. 3:15 AM
Thanks!
I'm glad It worked fine
Mahmoud Basho says: May 7, 2013. 11:09 PM
Can I put 2 motors instead of one?
RuiSantos (author) in reply to Mahmoud BashoMay 8, 2013. 3:04 AM
sure I might a tutorial abou that :)
the IC can control 2 motors
theassassinpig says: May 3, 2013. 12:12 AM
What's the app on the phone? Is there an equivalent on iPhone or iPad
RuiSantos (author) in reply to theassassinpigMay 5, 2013. 4:07 PM
The android app is called: BlueTerm
you can find for free on the google play store...
Mahmoud Basho in reply to RuiSantosMay 7, 2013. 11:10 PM
thanks
RuiSantos (author) in reply to theassassinpigMay 5, 2013. 4:06 PM
Unfortunately..I couldn't find any free app to run on my ipad :S
theassassinpig says: May 5, 2013. 8:49 PM
I'm trying to build an arduino quad copter and need to know if this would control speed, or should I use radio and whatnot, I want to control speed with the Bluetooth, and want to know if I can do that
ssekharan says: Apr 2, 2013. 8:21 AM
Sir i have made my circuit as per ur guide n tested the motor via pc not via Bluetooth because i am confused as in the link which i saw earlier http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/?ALLSTEPS the same Bluetooth module is used but then voltage divider is used why so n why you did not use it.
sarju7 says: Mar 30, 2013. 4:31 AM
Thanks
sarju7 says: Mar 29, 2013. 8:25 AM
Can it work 4 or 6 motors instead of just one? and also I love it probably gonna use it for my next bot I build
RuiSantos (author) in reply to sarju7Mar 29, 2013. 2:06 PM
with this Integrated circuit (L293D) you can control 2 motors at once, so basically you would need more 2 IC's so you could control 6 motors
but yes it's possible!
dtotti says: Mar 4, 2013. 4:28 AM
This is sooo cool. I really want to try something like this for fun. I am deployed in Jeddah right now and there is not much to do on my time off. Can you use a iphone or u need a android only?
RuiSantos (author) in reply to dtottiMar 4, 2013. 6:16 AM
Thanks :) I'm glad you enjoyed it!
You can do with your iphone but actually i didn't found any free app for the iphone to do this, that's why I used my android :S
clockwork-atrocity says: Mar 2, 2013. 6:39 AM
Where did you acquire your bluetooth module? Also, is there a way (Program) To neaten up the interface so that the screen will display basically "On/Off" buttons? Also, how far will this unit transmit?
RuiSantos (author) in reply to clockwork-atrocityMar 2, 2013. 7:38 AM
I've bought this module on ebay for 8$ (just type 'bluetooth module HC-05') it's probably the cheapest you can find so I would say that the signal is a bit weak if you want to have some stable connection with some distance.. I think you need to buy a better one.
I've just tested and for 5/6 meters It works just fine sending the commands after that becomes a bit slow and with more than 10 meters it becomes unable to connect.
to have a better interface you need to find another application, has someone already mention in the comments I think this app can be usefull, I've never used it before but it seems to me that can do the job
http://www.splatco.com/simplehmi_p1.htm
SPLatManOz says: Feb 27, 2013. 5:09 PM
There's a more sophisticated Arduino interface app called SimpleHMI 

It requires extra programming in the target controller, but the communication codes are all published.
RuiSantos (author) in reply to SPLatManOzFeb 28, 2013. 10:49 AM
Yeah thats a good App :)
thanks for sharing
ianmcrv says: Feb 27, 2013. 3:57 PM
If you use the Arduino's 'softserial' library then you can use other pins for the bluetooth module and therefore don't have to connect it every time you upload a new sketch.

See my website for details http://www.BTInterface.com
(sneaky plug there, did ya see?)
RuiSantos (author) in reply to ianmcrvFeb 27, 2013. 4:02 PM
Thanks for sharing :) I already knew that, I just didn’t used because I wanted the project as simple as possible without adding libraries :)
rlarios says: Feb 27, 2013. 10:05 AM
Hi Rui !
What app do you use on your iPhone to transmit your commands to your motor control?
RuiSantos (author) in reply to rlariosFeb 27, 2013. 12:26 PM
I'm not using an iphone ... I'm using a samsung galaxy ace an android smartphone. And the app that I'm using is called 'BlueTerm' its free you can download it on the 'play store'
rlarios in reply to RuiSantosFeb 27, 2013. 3:38 PM
Sorry, I was thinking of my iPhone when I typed this. Thanks anyway and good job ! Your instructable is very helpful.
RuiSantos (author) in reply to rlariosFeb 27, 2013. 3:53 PM
thanks :), but I think there's an app out there for the iphone that does the same job, actually I didn’t had the time to find and try it, but as soon as I test one, I'll update the instructable :)
diy_bloke says: Feb 26, 2013. 8:19 PM
are you telling that after you upload the sketch, you stiill have to have the Rx and Tx cables removed and thus the bluetooth module not connected, in order to connect your smartphone with the module?
That sounds mediaeval
RuiSantos (author) in reply to diy_blokeFeb 26, 2013. 11:40 PM
Yup im for sure that when you upload the sketch you can't have the tx an rx cable connected because those pins are the ones that transmits and receive the data from the computer to the arduino. But when were trying to connect our smartphone to the bluetooth module, im not sure if you need to disconnect the tx and rx cables. At least with my bluetooth module i wasnt being able to connect until i disconnected them. But maybe with another smartphone or bluetooth module you dont need to disconnect them. Actually I dont this makes much sense, but it was the only way for me ...
diy_bloke in reply to RuiSantosFeb 27, 2013. 12:32 AM
I agree on the first part. that is not in contest as you need the Rx and Tx pin to upload, but after that you should be able to connect the bluetooth module. to the Rx and Tx and keep it connected and then pair and connect your phone.
In fact you are the first and only one till now that says you have to disconnect the bluetooth module in order to establish bluetooth connection with a smartphone.
But if that is the only way it works for you, so be it.
Not critisizing, just amazed :-)
RuiSantos (author) in reply to diy_blokeFeb 27, 2013. 5:06 AM
I know that you weren't criticizing :)
thanks for your comment you were right I've tested right now and we don't need to disconnect the cables, As I said didn't make any sense, but the last time I wasn’t being able to connect my smartphone to the bluetooth module, No idea why, and when I disconnected It connected immediately... xD So i thought that I had to disconnect the TX and RX with this bluetooth module or something.

Thanks for question me about this eheh I'll edit my Instructable :)
diy_bloke in reply to RuiSantosFeb 27, 2013. 6:11 AM
I understand very well. I have had my share of problems connecting to Bluetooth :-)
RuiSantos (author) in reply to diy_blokeFeb 27, 2013. 7:03 AM
ahah I had some too!
Thanks again for your help!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!