6bluethumb

Arduino – Control DC Motor via Bluetooth

1.2K Flares 1.2K Flares ×

Hi guys,6bluethumb

In this project we will control a DC motor with a smartphone via bluetooth. This project is great to learn more about:

  • DC motors
  • Interfacing Arduino with your smartphone
  • Bluetooth
  • L293D IC

If you don’t have the L293 IC you can make the same circuit using the H bridge, anyway I really recommend you to read more about that and the IC datasheet. There’s plenty of tutorials about that. Also If you don’t have a bluetooth module yet you can see my review about this bluetooth module and where to buy one. So Let’s start…

Parts required:IMG_0244

  • 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

You just need to follow this schematics (I recommend you to wire the TX and RX only in the last step) :

schematics

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

Upload this sketch below!

Make sure you remove the wires from RX and TX otherwise the code won’t upload properly!

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

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!

Thanks for reading, you can contact me by leaving a comment. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

115 Comments

  • huss

    Reply Reply February 25, 2013

    Good stuff. Great Tutorial.
    How can I make my robot, be controlled through bluetooth?
    Here’s my robot, http://www.youtube.com/watch?v=LrypabTSKuc
    I want just 5 commands right, left , forward, back and stop

    • Rui Santos

      Reply Reply February 25, 2013

      Yes you can do that by using two L293D ICs…you just need to change the code a bit… And it will work just fine :) i will make a full tutorial about that soon… Im just waiting for a few parts that will arrive in one or two weeks… So make sure you subscribed to receive the updates about my robot. By the way nice robot you have! I’ve subscribed to you

      • huss

        Reply Reply February 25, 2013

        Just Subscribed!
        Yes, I’m using 2 SNY motor drivers equivalent to the l293D… The only thing I’m having trouble is choosing an affordable bluetooth Module, and writing the android App(never did before) but I guess I will download yours when you do the new one?

        Also, I’m trying to find a way to make my ping sensor ping wirelessly so I wont need wires like my video shows.

  • Rui Santos

    Reply Reply February 25, 2013

    This is probably the most affordable bluetooth module out there Hc-05 the one Im using. you can buy one for 8$ on ebay. You can use my code but you need to add a new motor to the code and define the forward and reverse button . I will post the robot in 1/2weeks Im waiting for one IC and some others parts i need. You just need to change my code a bit. For the android you will need the blueterm app or any app similar to do that , so you can connect your arduino to the bluetooth module.. I can write the code for you… Its pretty quick

  • huss

    Reply Reply February 25, 2013

    I just purchased the Hc-05 on ebay, takes 10 days delivery. I have all the code written for both of my motors already, all I need to do is some simple tweeks, I can do that pretty simply.

    But I never used the Blueterm app before(I have an iphone, but can get an android), I was wondering instead of sending “0″ “1″ “2″, there would be actual buttons (Arrows) for the directions.

  • Rui Santos

    Reply Reply February 25, 2013

    Nice :) btw usually the HC-05 requires a pass and its ’1234′.
    you can use an iphone you just need to find a similar app…
    If you’re familiar with the Arduino IDE, what the blueterm app actually does it connects your smartphone to your arduino via Bluetooth, and it does a serial communication between the devices. So you don’t need to type anything in the serial monitor with your computer, but instead you type on your smartphone
    there are some apps with the 4 buttons that do the exact same job but I’ve never used any… but usually someone made that app just for one particular robot, the easy way is to use an app as blueterm.
    http://www.dougwoods.co.uk/curation/idevices-controlling-robots-in-the-classroom/
    there are some examples in that website, lot’s of those apps work with an accelerometer which I thinks its really good
    My idea for my robot is to control a robot with 2 DC motors through bluetooth with my ipad (with the 4 buttons)
    But as I said before it will require some time as I don’t have the parts yet and I need to learn more about the control with the 4 buttons ….

    • huss

      Reply Reply February 25, 2013

      Me too i have an Ipad, I will also look into it. That even sounds like a better idea, thanks for all your help, I will be checking back constantly for updates!

      and when I get my bluetooth, and get it working with my robot, ill check back for help, if i need any, and I will let u know how it goes!

      Thank you

      • Rui Santos

        Reply Reply February 25, 2013

        No problem :) i have your email and i soon as i have this done I’ll send you an email , i wont forget :)

  • huss

    Reply Reply February 26, 2013

    Just last question.

    from the android bluetooth perspective.
    how do you:
    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

    Do you do it on the android phone in the app or how?

    • Rui Santos

      Reply Reply February 26, 2013

      The commands are set in the arduino code… In the arduino code its where you define the keys that will trigger the movement you want. If you read my code. In the if statements its where i define which keys i want to be pressed and read. You can define whatever key you want (numbers… Letters) the android app just sends the key.

      • Thomson

        Reply Reply March 2, 2013

        Hi, I’m Thomson

        i have a project to make a robot. maybe like huss project.
        but i use arduino leonardo. i use dual motor controller. but i wanna it run on my iPad. i don’t know how to make it work on my ipad. i need your help. and how to make ipad app to control the robot.
        may you give me best solution.
        which the best one, Arduino leonardo or arduino uno?
        thanks for your article it’s very useful for me
        send me by email.

        • Rui Santos

          Reply Reply March 2, 2013

          Hi Thomson!
          You can use the Arduino uno or the Arduino Leonardo they both are capable to do that project, you can read this post for more information and see the advantages between the 2 boards
          http://www.doctormonk.com/2012/10/arduino-leonardo-vs-arduino-uno.html
          But in conclusion for that project it doesn’t make much difference they’ll both work just fine :)

          I didn’t made the app I’m running on my smartphone… And I don’t know much about iOS programming, I was thinking in making one but actually I’ll only be able to do that If I’ve buy a Mac or something otherwise would be really hard to create one app. with just my ipad… or with my linux computer with a virtual machine…
          I didn’t found any similar app for my iphone/ipad that’s why I used my android…
          Actually I don’t know any free app that does the same as Blueterm..

  • Vladimir

    Reply Reply February 26, 2013

    Hi Rui !
    Great project. I am new to the Arduino community and I am getting started on a personnal porject in whitch I would like to control a :
    - a small speaker that display a sound
    - a small fan
    via bluetooth.
    I would like that device to be as small as possible and powerd by a battery.
    Witch hardware Arduino would you advise me ta base it on ?
    Thanks so much for your answers !
    Vlad

    • Rui Santos

      Reply Reply February 26, 2013

      Hi Vladimir! Thanks for your support, I’m really glad you enjoyed it!
      You can buy any Arduino to control the fan and the speaker, I would recommend you to buy the Arduino Uno or the Arduino Duemilanove. You can buy an original or a clone, It’s easy to find on ebay.
      I don’t know what you want to do when you said control a small speaker, I don’t know what’s your project about.
      But with the Bluetooth module, a smartphone and an Arduino You can control the fan and the speaker for sure!
      And the Arduino Can run with a 9V battery !
      If you have more questions just let me know or just talk about your project! :)

      • Vladimir

        Reply Reply February 27, 2013

        Thanks for those elements. It helps a lot.
        The idea it to have the sound go thru the running fan to study how disformed it souds like while the beat frequence is modified and the fan speed is as well. (listen to music thru a fan, you’ll understand what I am talking about).
        On the hardware configuration, I have been looking further, and there is still a challenge :
        1. The bluetooth needs to be able to transfer data and music which will be stored on the smartphone that commands it
        2. I need to make sure that the arduino is “smart” enough to understand a music signal AND data signals that controls teh fan speed. And it has to transfer the music part to the autoamplified speaker.
        So, still not sure what hardware configuation to use (especially, which bluetooth receiver between the large choice), but if you have any ideas, tey are more than welcomed ;) !!!
        Thanks !

        • Rui Santos

          Reply Reply February 27, 2013

          To be honest I don’t know exactly how you can do that, but If I understood the real goal of your project, I must tell you that probably the Arduino It’s not the best platform to do that.
          You can’t send music like a mp3 file or something to your Arduino trough bluetooth, I don’t know if there’s any shield that allows that… but with the Arduino itself you can’t.
          The most similar project I can think about It’s to create the song you want to analyse in the Arduino IDE using the Tone function and control the PC fan with that sound (Basically the voltage could be connected to a buzzer/speaker and you could hear the tones of the music, or simply connected to a Fan controlled by the voltage )

          I don’t think I’ve helped you much, I’m sorry…

  • Vladimir

    Reply Reply February 27, 2013

    Well, thanks, that’s a lot allready !

  • telmo

    Reply Reply March 16, 2013

    Onde posso comprar o modulo bluetooth?

    • Rui Santos

      Reply Reply March 16, 2013

      Eu comprei no ebay por cerca de 8 dolares.. já com portes incluidos e tudo.
      Por isso aconselho a comprar lá, porque fica mesmo barato

  • Cinder

    Reply Reply March 19, 2013

    I got to the last step but when I enter the values (0,1,2) nothing happens. All I see is a number on my phone. On the video the commands show up as “Motor:right” for 1. All I get is 1 on my phone.

    • Rui Santos

      Reply Reply March 19, 2013

      try to insert the numbers in the serial monitor with your computer, if nothing happens probably it’s a problem with your IC, motor or wiring…

      • Cinder

        Reply Reply March 20, 2013

        Hey that worked but I cannot control the motor with my phone. When I use the serial monitor I am able to control the motor and the inputs (the number 0,1,2) appear on the screen of my phone. It seems like the circuit is connected correctly and the bluetooth module is working as well, but when I try to control the motor with my phone nothing happens, I just get a number as I told you before.

        Thanks

  • Rui Santos

    Reply Reply March 20, 2013

    thats really weird… if it’s working with your computer should be working with your android, i don’t know what can be done then…
    but it says something like this: ‘connected to linvor’?

  • Cinder

    Reply Reply March 20, 2013

    No it says:

    “connected:HC-05″

    • Rui Santos

      Reply Reply March 20, 2013

      I don’t know what can be wrong because it seems that everything is correct… and a lot of people actually tried this and worked…
      and if it works with the arduino serial monitor the circuit is correct. it can be a problem with the bluetooth module I guess
      the last thing that it can be a mistake (the TX from the bluetooth module goes into the RX from your arduino and the RX from the bluetooth goes into the TX from the arduino).

    • Rui Santos

      Reply Reply March 22, 2013

      Actually I’m not sure if you can use that bluetooth module or you need to change my code/wiring a bit, I’ve never used that bluetooth module and I don’t have much time to search how it works… Sorry

      • Cinder

        Reply Reply March 23, 2013

        Hey man I got it to work. I actually had to connect rx to rx and tx to tx.

        Thanks dude!

        • Rui Santos

          Reply Reply March 23, 2013

          I’m glad you got it working :)
          I hope you enjoy my other projects!

  • Can we do programming Arduino over Bluetoooth??

    • Rui Santos

      Reply Reply March 24, 2013

      Yeah I think you can at least I think It’s possible, but probably will never be very good for debugging a new program for example

  • can you please provide schematic of ur circuit??

  • ertozan

    Reply Reply April 7, 2013

    What is your “compiler” for codes?

    • ruisantos16

      Reply Reply April 7, 2013

      what you mean by that?
      I’m using the Arduino IDE… to write, test and upload the program

  • ganesh shetty

    Reply Reply April 8, 2013

    Hi rui ganesh here i m doin mtechmrj named model based design of parellel park asssist system using simulink but now i m planned do hardware implementaion i want to use remote control car i hav to control both speed and steeering of motor i hav finished with simulink if you dont mind suggest me which arduino board i hav to use for my project since i heard that board support simulink please do suggest or email me please

  • John

    Reply Reply April 10, 2013

    Hi Rui,

    Im having trouble uploading the code to Arduino, when i verify it, i get an error message saying: expected constructor, destructor or type conversion before ‘void’. and its highlighting the ‘int state;’ line of coding which is the problem. Many thanks for you help.

    • ruisantos16

      Reply Reply April 10, 2013

      did you copy exactly all the code(all the “{ }”)? which Operative system you’re working on? you’re arduino IDE is updated? which arduino board you’re uploading too?
      I’m just asking that because it’s really weird because a lot of people already tried this project and it worked…

      • Almc Canuel

        Reply Reply September 4, 2013

        where i can find the code for arduino..? i cannot find it on your website..please help..

        • Rui Santos

          Reply Reply September 7, 2013

          Hi thanks for commenting.
          you can download all my code for free just click the (facebook/tweet/google+) one of thoses buttons and the code will unlock

  • Sein

    Reply Reply April 30, 2013

    It would be nnice if you show wich AT commands you used to configure the BT module.

    • ruisantos16

      Reply Reply May 1, 2013

      I’m sorry but I didn’t used any AT commands, my Bluetooth module was running by default!

  • My bluetooth Module HC-05 Receives Data from Arduino , and Forward it to PC/Mobile , but does not Transmit Data from PC/Mobile to Arduino ? Any Advice?

    • Rui Santos

      Reply Reply May 2, 2013

      what do you want to do exactly? can you try to explain a bit better your project?

  • Moataz

    Reply Reply May 3, 2013

    Thanks in advance your material is so helpful :)

    • Rui Santos

      Reply Reply May 3, 2013

      Thanks, I’m glad you found them useful! make sure you subscribe to any of my news sources like youtube or websites newsletter so you can be notified when I release new projects!

  • Mahmoud

    Reply Reply May 8, 2013

    Hi..Mr.Rui,
    just I want to know about how can I get the bluetooth application that you use it in the video for controlling on the Android mobile?

    Thanks

    • Rui Santos

      Reply Reply May 8, 2013

      Hi,
      you can find the app , in the google play store for free!
      just search: BlueTerm

  • tomas mendoza

    Reply Reply May 16, 2013

    Hi!
    Hey man i’ve got a problem with the bt module….the thing is if i write on the monitor serial, the led turns on (i modified your original code for just a led…you know, i’m trying to keep it simple just to test it) but the thing is, when i try to use my android phone (running the blueterm app and after connecting to the module (it says: conected: linvor) the led just won’t work :/ any ideas?

    • Rui Santos

      Reply Reply May 22, 2013

      Firstable sorry for the late delay replyng to your comment, I’ve missed it, just found it today.
      Please check the wire from your bluetooth module, the most common mistake is this:
      bluetooth module: TX pin -> RX pin from the arduino
      bluetooth module: RX pin -> TX pin from the arduino

      Then I also recommend to open your Arduino IDE and your serial monitor and send the commands for example “0″ and “1″. Whataver you defined and see if the circuit is working. If it working then try via bluetooth

      Good Luck!
      Rui Santos

  • Max Rosenblum

    Reply Reply September 8, 2013

    I’ve seen other versions where people use resistors to drop the voltage coming from the arduino. This isn’t necessary? I don’t want to ruin my HC-05. Thanks!

    • Rui

      Reply Reply September 19, 2013

      If you’re using a power supply you can use one resistor.
      but if you’re using the USB to power your arduino, don’t worry .
      the HC-05 can handles 3.6V to 6V

      Thanks for commenting!

  • Peter

    Reply Reply November 20, 2013

    Hi Rui Santos, thank you for your sharing how to do arduino project here firstly. I had tried to use of your arduino uno codes in virtual simulation of Proteus for controlling 2 DC motor using L293D and Atmega328p. However, the simulation program prompted me error message and I don’t understand why the error occurred since I had sorted out all possible problems before. Could I send you the proteus simulation file for your reference and then can you point out how I can slove the simulation problem please? I would like to complete the simulation firstly before launching the hardware circuit development processes. Many thanks.

    • Rui Santos

      Reply Reply November 21, 2013

      Hi Peter.
      Thanks for trying my projects!
      I’ve never used Proteus… my circuit is working with the Arduino IDE.
      I’m sorry I don’t have the time to do that.

      This next weeks I’ll be on exams and finishing some projects.
      Good luck with that,
      and I’m sorry not being much helpful.
      Rui Santos

  • Andi

    Reply Reply December 12, 2013

    Hai Rui,

    i have a problem with this arduino. My dc motor can run if i connect with my laptop (usb) but with 9v battery cannot run. Blueterm not response if i enter numbers with 9v battery, but with usb, the blueterm is completely response and my dc motor run (left, right, off). Why?

    • Rui Santos

      Reply Reply December 12, 2013

      Hi, thanks for trying my projects..
      The problem is simple.
      The 9V battery don’t have enough current for your circuit, you will need another type of battery that can handle more current.

      The bluetooth module and DC motors takes to much current from the 9V battery

  • KISHAN

    Reply Reply January 16, 2014

    Can you email me the code for running two motors using bluetooth?

  • kishan

    Reply Reply January 17, 2014

    TNX
    IF U HAVE MADE ANY MOR ROBOTICS PROJECTS PLEASE LET ME KNOW.

    • Rui Santos

      Reply Reply January 18, 2014

      Right now. I’m not planning in create any project related to robotics.
      I’m working towards home automation projects!

  • George

    Reply Reply January 25, 2014

    Greetings from Greece!
    I make arduino projects as a hobby for my own. I found interesting the BT communication. Is there any recommended tutorial about makind android apps with BT, developing using Eclipse?

    Thank you.

    • Rui Santos

      Reply Reply January 27, 2014

      Hi George.
      I don’t know any tutorial for that at the moment.
      I also never made any Android apps using Eclipse.

      Sorry, maybe on youtube you can find what you’re looking for.
      Thanks for stopping by,
      Rui

  • sank

    Reply Reply March 6, 2014

    Hii rui…
    first upon I m a diploma student …so I don’t have too much knowledge about electronics so I wanted to ask u that is the project compatible with atmega 328 chip…and which Bluetooth. Module should I use

    • Rui Santos

      Reply Reply March 7, 2014

      Hi Sank,
      yes this project is compatible with the atmega328 chip.
      That’s the one I’m using in my Arduino UNO board.
      The bluetooth module is describer in the part list. you can use the HC-05 or HC-06 bluetooth modules

      Thanks for asking,
      Rui

  • walid

    Reply Reply March 8, 2014

    hi rui
    can’i use Module Bluetooth 2.0 for this project -Arduino – Control DC Motor via Bluetooth

    • Rui Santos

      Reply Reply March 12, 2014

      I think so, which smartphone are you using? and bluetooth module?

      • walid

        Reply Reply March 13, 2014

        i use SAMSUN GALAXY S2 and bluetooth module 2.0

        • Rui Santos

          Reply Reply March 16, 2014

          That should work just fine.
          Can you give me more details of what’s the problem it’s happening?

          • walid

            March 16, 2014

            that this project is powered by an external power supply or through USB cable

          • Rui Santos

            March 19, 2014

            This project was powered with USB for demonstration purpose
            But you can add a battery for example

  • UMANG

    Reply Reply March 9, 2014

    HI,
    WHAT IS THE OPERATING VOLTAGE IF HC-05 BECAUSE IN SOME WEBSITES IT SAW THAT THE OPERATING VOLTAGE IS 3.3V.AT THE BACK OF MY BLUETOOTH MODULE JYU-MCU IS NOT PRINTED

    • Rui Santos

      Reply Reply March 12, 2014

      the operating voltage is from 3.3V to 6V but make sure you read the datasheet of your bluetooth module.
      Thanks for asking and please don’t use caps lock next time.
      Have a nice day,
      Rui

  • Najam

    Reply Reply March 16, 2014

    will Hc 06 work in place of hc 05? Thanks in anticipation

    • Rui Santos

      Reply Reply March 16, 2014

      yeah it will work just fine Najam!
      thanks for asking,
      Rui

      • sabri

        Reply Reply March 16, 2014

        hi Rui Santos,
        i’m new to Arduino..
        just want to ask you..
        1) if I’m using HC-06 bluetooth, do i need to change any code from the arduino?
        2) what is the voltage required to make the dc motor works?

        • Rui Santos

          Reply Reply March 19, 2014

          1) It will work with any bluetooth module that works with serial communication, so the HC-06 works just fine
          2) It depends on your DC motors those DC motor work great with 3.3V or 5V.

  • sank

    Reply Reply March 19, 2014

    Hi rui…could you provide the presentation report or project report on this project …which can include project’s application,construction ,working,cost…etc…
    you may also provide a ppt also…
    please do my work it is very essential…we have to submit a project report just in 7 dayd…
    please rui…
    please rui…
    please rui…

    • Rui Santos

      Reply Reply March 19, 2014

      Sorry sank,
      I can’t make the project for you…
      I’m already working on my own stuff.
      Good luck with your project,
      Rui

  • sank

    Reply Reply March 21, 2014

    Kkk.thanx rui

  • Deepak

    Reply Reply March 24, 2014

    Why I am new to Arduino. Why we need to remove TX and RX of BT module while Uploading code. What will happen if we don’t do tat.

    • Rui Santos

      Reply Reply March 25, 2014

      Hi Deepak,
      you need to remove the TX and RX because when you’re uploading a new code the arduino needs to receive the data from your computer.
      and if you have something connected to those pins the arduino can receive the information from your computer.
      I hope this helps.
      Rui

  • Xuyi Wu

    Reply Reply April 2, 2014

    Hi Rui,
    I am new to Arduino world and I am doing a project very similar with this one. But it says ‘programmer is not responding’ when I tried to upload the code. Do you know how to fix this?

    • Rui Santos

      Reply Reply April 5, 2014

      Hi Xuyi,
      Do you have the bluetooth device connected to the arduino during the uploading process?
      You need to disconnect the bluetooth (TX and RX cables) while you’re uploading

  • zul

    Reply Reply April 5, 2014

    hi Rui Santos.. im now doing for a project.we want to control the speed of the motor by using bluetooth apps.any suggestion from you?type of motor we need to use? Dc motor or fan from laptop cooler?can you help me to show the coding if you can.thank you

    • Rui Santos

      Reply Reply April 12, 2014

      Hi Zul,
      you can use the same setup of my project.
      The L293D works fine for controlling the speed.
      Then you can change the arduino code so it increases the speed of the Dc motor…

  • Tamojit

    Reply Reply April 9, 2014

    Hi Rui
    This project was great! I saw a video in youtube about controlling d speed of d motor using android application. I searched a lot for d code or way to do it bt could not find it. Can u hwlp me out in any way of how to do it???
    Plz reply asap.
    Thanks in advance! :-)

  • Alaa moselmani

    Reply Reply April 17, 2014

    Hi, please can you give me the code of your project.
    Thank you

  • rahul reddy

    Reply Reply April 24, 2014

    great work rui…im very much impressed by ur projects..guidelines ,videos u provide r really awesome…keep rocking buddy.

    • Rui Santos

      Reply Reply April 25, 2014

      Thanks so much for your feedback rahul!
      Have a nice day,
      Rui

  • Kallum

    Reply Reply April 28, 2014

    Hi Rui,

    Im working on a project and i was wondering what bluetooth module i would use with an 11.1V lipo battery powering my Mega2560 board

    Thanks.

    • Rui Santos

      Reply Reply May 3, 2014

      Hi Kallum,
      how many current does that lipo battery provides?
      That’s usually the problem, not enough current to power up the bluetooth module.
      But that’s easy just choose any bluetooth module that works with serial communication and works at a lower current than your lipo battery

      • Kallum

        Reply Reply May 4, 2014

        The lipo is 2.2A, so what bluetooth module would you suggest I use?

        • Kallum

          Reply Reply May 5, 2014

          1.3A, my mistake

  • Nihit

    Reply Reply May 13, 2014

    Hi Rui very cool project u got there but i was wondering if instead of a motor can we use a LED

    • Rui Santos

      Reply Reply May 17, 2014

      Hi Nihit,
      Yes you can control an LED.
      Basically after you establish a serial communication between your bluetooth module and android device, Send some characters that the arduino will receive and with a if statement, simply control an LED with a digitalWrite().

  • Ziad Kassam

    Reply Reply May 14, 2014

    Hello,
    Can you provide me simple source code how to connect android to micro-controller and to send a simple data like a byte.

    Thank you.

    • Rui Santos

      Reply Reply May 17, 2014

      Hi Ziad,
      This project already does exactly that…

    • Nihit

      Reply Reply May 31, 2014

      thank you rui but i have a problem
      i couldn’t find an HC-05 bluetooth module
      near my place but i have got an HC-06 module.
      Will it work??

      • Rui Santos

        Reply Reply June 8, 2014

        Hi Nihit,
        Don’t worry the HC-05/HC-06 are exactly the same… :)
        So it should work just fine!
        Thanks for asking

  • RolandoLewis

    Reply Reply May 22, 2014

    Hello Rui Santos,
    Your project is certainly fantastic. But I have question for you, how to control DC motor without any commands, just detect the bluetooth device and automatically the dc motor will turn ON.

    Hope to get your positive feedback ASAP! Thank you in advance:)

    • Rui Santos

      Reply Reply May 26, 2014

      You need to change the android app.
      In the block where it shows that the android is connected to the bluetooth module simply send a byte that the arduino will receive and turn on the DC motor

  • Sam

    Reply Reply May 31, 2014

    Hey Rui! These are some great tutorials. Do you know how I can send a command and have it run the motor for about 5 seconds and then stop? I’ve been trying out ways with no luck. Any help will be appreciated!

    • Rui Santos

      Reply Reply June 8, 2014

      Hi Sam,
      simply make a delay of 5 seconds – for example delay(5000); – inside the if statements. and then turn off the DC motor
      I hope this helps

  • kundalini

    Reply Reply June 11, 2014

    Hey! Someone in my Facebook group shared this site with us so I came to take a
    look. I’m definitely loving the information. I’m book-marking and will be tweeting this
    to my followers! Excellent blog and superb style and design.

    • Rui Santos

      Reply Reply July 4, 2014

      Hey!
      That’s great.
      Thank you for your feedback!

  • Eden

    Reply Reply June 22, 2014

    Hey Rui, can i know what if i wanted to do angle controlling dc motor? Like i press a button then the motor will rotate to a certain angle and stops. Btw can i where you do your simulations ?

    • Rui Santos

      Reply Reply June 24, 2014

      Hi Eden,
      I don’t like to use any software to simulate. And I don’t think there’s a good solution out there yet.
      The Arduino can control the angle of the dc motor, but you’ll need a shaft encoder that will allow the Arduino to know what position the motor shaft is in. If you use an encoder it will indicate the current position that gives pulses to let the Arduino know that the shaft has turned one step and in which direction.
      I hope this helps,
      Rui

  • philip

    Reply Reply July 1, 2014

    good day sir . .is it possible for a 12v DC motor ?????….

Leave A Response

* Denotes Required Field