Instructables

ArduDroid: A Simple 2-Way Bluetooth-based Android Controller for Arduino

Contest Winner
Picture of ArduDroid: A Simple 2-Way Bluetooth-based Android Controller for Arduino
HC-05 to arduino with divider.jpg
UPDATES: REQUIREMENTS
  • Breadboard wiring and electronics skills.
  • Arduno Uno.
  • HC-05 Bluetooth serial module.

INTRODUCTION 

ArduDroid (formerly Andruino) is a simple tool to help you control your Arduino (or clone) from your Android phone. It's both an Android app and an Arduino program. ArduDroid has a simple Android user interface to 1) control Arduino's digital and PWM pins 2)  send text commands to Arduino 3) and receive data from  Arduino over Bluetooth serial using the ever popular and really cheap (less than $10 from ebay) HC-05 Bluetooth over serial module.  This app has been tested and designed for the HC-05 Serial Bluetooth module. Other Bluetooth modules may or may not work. Please see comments section for users who tried other Bluetooth modules with this app.

INSTALL FROM GOOGLE PLAY
https://play.google.com/store/apps/details?id=com.techbitar.android.Andruino

ArduDroid should work with other Bluetooth modules with some tweaking but I have only tested it with the HC-05. This is an alpha version that's running fine on my Samsung Galaxy S2 Plus.  Please share your experience running ArduDroid on your phone. Also, while I used Arduino Uno in this prototype, feel free to experiment with other models of Arduino. Please share your experience to help me improve this  app. 

I have published a guide before on building and programming a circuit with the HC-05 Bluetooth module and Arduino but I will briefly describe again in this guide how to wire the circuit using a breadboard and jumper wires.

ArduDroid is an app that evolved during one of my development projects. Special thanks to engineer Jafar Quttaineh for testing the app and for his invaluable input.

PLEASE RATE ON GOOGLE PLAY

This is a free app and only through your ratings can I determine if it's worth supporting or discontinuing.
 
Remove these adsRemove these ads by Signing Up
mahf123015 days ago

Great instructables, and thanks for the source code and app, you ´re great.

I used the hc-06 and it work great.

thanks man

hello,

I modifies the sheck and now it works to arduino leonardo this is the code:

https://drive.google.com/file/d/0B_bdvgeAhBOJM2psR...

works to IDE 1.05....

gfreire5721 days ago

He only works with the HC-05 Bluetooth serial module?

*Does it only works with the HC-05 bluetooth serial module?

ehmedat22 days ago

If allowed possible code transmitter via Bluetooth

bstott made it!1 month ago

Thank you very much for creating your lessons - bluetooth instructables. They were very helpful. Your tools were good for learning, connecting and verifying the bluetooth modules. My two devices: HC-05 & HC-06 to pair & connect. I did have a problem with phone pair sequence but, found it. They work!

Feature Request on your Android App:

Please provide selections for different data rates - 9600 (default), 38400, 57600, 115200 - ???.

Thank you again!

ArduDroid-testing.jpg

hello,

I used the code on several Arduino boards 1 and it works perfectly; now I wanted to use this board bought on ebay:

http://www.ebay.it/itm/181307172444?ssPageName=STR...

with micro ATMEGA32U4 (should be compatible with Arduino Leonardo).

but it does not work, someone can help me, is it necessary to modify something in Sheck??

pls help me

thanks

accio1 month ago

Hoping this can solve some of the problems: the code for Arduino uses "Serial" command (http://arduino.cc/en/reference/serial). This means that it communicates with HC05 via pin 0 and 1. Those pins are the same used to connect Arduino to the computer. [Looking at the reference of "Serial", maybe you have to introduce some changes to use it on a Leonardo]

If Arduino is attached to the computer via USB the data are passed to the USB and not to the bluetooth module.

Great project!

markie3 months ago
Hello TechBitar,

first of all Nice Project!
At the moment i am experimanting with this hc-05 module.
There is one thing i do not understand.

// 2a) select the requested pin# for DigitalWrite action
void set_digitalwrite(int pin_num, int pin_value)
{
switch (pin_num) {
case 13:
pinMode(13, OUTPUT);
digitalWrite(13, pin_value);
// add your code here
break;

If i just want to make a LED go ON or OFF, what do i fill in here?
i have been trying to get this to work all night but no succes so far.
Hope you can help me.

Greetz from the Netherlands!
Mark.

I am a noob at this. But this is what my sir thought me. I don't think you need the integer pin-value. You could probably pass a string/char array. Either "HIGH" or "LOW". All in caps. HIGH is to switch the LED on. LOW is to switch the LED off.

digitalWrite(13,HIGH);\\Switched pin 13 LED on

digitalWrite(13,LOW);\\Switched pin 13 LED on

so you code shout be something like this

void set_digitalwrite(int pin_num, char pin_value[])
{
switch (pin_num) {
case 13:
pinMode(13, OUTPUT);
digitalWrite(13, pin_value);
break;

}

Let me know if it works.

mike_vasili2 months ago

hello... i have a an arduino mega 2560 a bluetooth module HC-05 and a galaxy s4. the problem is that, to watch the data received from the phone to the serial monitor of arduino i have to constantly press the reset button of the arduino. please help me...

can please someone help me? i am trying to do my final year project at the university

Me too. I need the code for my final year project!!!

gmosquera2 months ago
HI!! I LOVE YOUR TUTORIAL, it is amazing! Thank you so much!

I am working on my senior design project. Part of it is to receive and display data in an android device via bluetooth using arduino. Very similar to this instructable!

Since I'm an EE the arduino part is not too bad, the android part is where im facing difficulties.

Do you mind sending the android code to gabymosqueradiaz@gmail.com?

I would really appreciate it!

Thank you again!
Gaby
dbraganza2 months ago

Can you please send me the source code for this android app on my mail: braganza.denver@gmail.com

The whole eclipse android project preferably`

Raincity 633 months ago

Great ap! I've been having a lot of fun with it but I'm running into issues when using it to control a servo. I've attached the servo to the anologwrite for pin 9 and when I use the slider bar in Ardudroid the servo works for a moment and then I loose the bluetooth connection...any thoughts?

slabarre3 months ago
Hi TechBital, Great project. I impress a lot of people with my project but you deserve the credit! My project is now our project because a couple of guys from the marina where i am, like the idea being able to control the windlass for the anchor and view the lengt of chain with there phone. The product work pretty well, but the problem is that we need a cheat sheet to operate it. something like press 02 to activate the program type reset in case of protection safety on press 03 and 04 for manual override etc. So if you could share the code for the app. will gladly give you all the credit and be really thank full for making our life easier every day. or any other way to get it customise If its available on-line can anybody point me in the right direction? marinehandyman@gmail dot com
fdoped3 months ago
Hi techbitar,
Congratulations for your project.
I did all the steps connecting arduino Uno to computer. It worked.

Connecting to android, i receive the initial message in the "Get Data" textbox but none of the DigitalWrite Toggle Buttons works.

I am using a Galaxy S3 and made the connections using the resistors (1K and 2K). I am using the arduino connected to usb of the computer.
Please, could you help me?

Thanks!
jacek37433 months ago
I'm using a Galaxy S4 and it connects fine. I receive the initial message in the "Get Data" textbox but none of the DigitalWrite Toggle Buttons give an output... Please Help!
It solved the problem of the app not being able to send data after installing a level shifter!
I purchased a CD4050, once it comes in I'll test out what Peterjh stated because I receive data but do not transmitt any to the arduino.
yardiansyah3 months ago
this is nice project..

can you send the source code for andorid, i want learn more..

send please at my email enshev92@gmail.com
mrdragon3333 months ago
Thank you guru ji, It really helped me in my adventure with arduino.
jamithaawawn4 months ago
Hi Techbitar,

Great instructions and app.
My first test works without any problems.

Here is the combination of what I've tested it with:
• HC-05 on Arduino Pro Mini
• ArduDroid on HTC Desire

Thanks a lot for sharing your work.
Jami
sermad4 months ago
Thank you a lot

Please how can i modify the ArduDroid in andriod phone ?

Thanks again
anatolanatol4 months ago
hello Peterjh,
thank you for your answer; Yes I agree with you and I believe that the problem is the level voltage of RX and TX.. I connected the led to arduino by resistor in series ....
One last thing, where can I find a schematic diagram with CD4050?
...is correct these connections to CD4050:
CD4050
PIN 1 +5 VOLT
PIN 8 GND
PIN 2 RX ARDUINO
PIN 3 TX BTM-5 BLUETOOTH MODULE
PIN 4 RX BTM-5 BLUETOOTH MODULE
PIN 5 TX ARDUINO
anatolanatol4 months ago
hello...I have a problme with the APP , I do not know what the problem is;
-put ardudroid.ino in arduino board;
-switch on arduino and BTM-5 MODULE (connected +5 volt and ground module to power supply arduino);
-pairing the module with my phone (GALAXY NOTE3), the green led goes on;
-connect tx module to rx arduino directly;
-connect RX module (2K Ohms & 1K Ohms resistors as voltage dividers.) to TX arduino;
-and then?
-if I press on the toggles didn't happen nothing;
- I connected an LED between pins of arduino and ground but when I press the corresponding toggles the LED does not light..
can you help me..... thanks
Hello anatolanatol,

See my comment below regarding connecting the Bluetooth TX to Arduino RX directly.

Also, do not connect LED directly to I/O pin and then to ground. You need a current limit resistor!. Otherwise you will fry the I/O pin. I/O Pin 13 has a resistor on board and is an exception.
njhelloworld4 months ago
Hai techbitar..Thank you for this great instruction,it really help me a lot.I followed all you post about the basic in arduino,thanks a lot!

I encountered some problems after I followed this post,There were no connection happen ,between my HC-05 and my android phone,the ironic thing is it can be paired but not connected,my phone says "Paired but not connected".I am encountering this problem almost a month,I don't know what to do anymore.I will be waiting for your reply.More power!

by the way I'm using this Bluetooth module http://img3.banggood.com/thumb/view/upload/2012/jiangjunchao/SKU078642h.JPG
and Arduino Uno R3
techbitar (author)  njhelloworld4 months ago
Let's remove Android from the debugging equation. Try this simple project and see if you can establish communication between Arduino/HC-5 and your PC. Let me know how it goes.

http://www.instructables.com/id/Cheap-2-Way-Bluetooth-Connection-Between-Arduino-a/
Hai tech,I followed the link already ,then nothing appears to tera term..it just stayed long with empty type of console..I reviewed your codes and I think this is the reason:

While(!Serial.available());

--which will stay long when COM port is empty ...Do you know what is the reason of this??
Peterjh4 months ago
Hi techbitar,

Regarding Bluetooth serial communication.

Connecting the Bluetooth TX directly to the RX of the Arduino (Atmel) did not work for me.

With the Bluetooth disconnected from the Arduino, the Bluetooth TX sits at +3.3V and is pulled down to 0V during transmission,
The RX line on the Arduino sits at +5V and receives (RX) pulses that are pulled down to 0V. When I connect them together, Bluetooth /TX to Arduino /RX the line sits at +4V and is only pulled down to +2.5V. This is not enough of a pull down.

To test this, I connected a couple of +5V inverters together and connected the Bluetooth TX line to the input. This produced nice +5V to 0V pulses from the Bluetooth on the inverters output. It worked, so a level shifter is needed.

To program the Arduino through USB, the inverters output / RX on Arduino is disconnected.
techbitar (author)  Peterjh4 months ago
Good circuit analysis and yes your point is valid. It's always a trade off between too many components and wires that may throw off newbies vs minimum parts but still working circuit. In an ideal world everyone would have something like a CD4050 level-shifter in their goodies box and they can wire it with a minimum of temper-busting mistakes. Since this prototype is for fun and learning and involve cheap items for short term use, maybe we can get away with a nominally protected (eg voltage divider) but working circuit. But if I have to go commercial with this, the production circuit will bear little resemblance to this and it will not have a direct HC-05 TX to Arduino RX without level shifting as you have observed. Good point and thanks for sharing.
Doug Hart5 months ago
I just downloaded your ArduDroid and tested it with another sketch running on a Nano and it read output from my HC-06 just fine. I'm using a Galaxy Note 2. Thanks for sharing techbitar! Great job!
techbitar (author)  Doug Hart5 months ago
Nice pair. A small footprint Arduino Nano with the HC-05. Thanks for sharing.
n_galia5 months ago
Hai Techbitar,..I followed the link that you have given,thank you so much..When I tried to create a new connection,nothing display's on the tera term's console,is there something wrong in my hc-05??by the way I followed this arduino codefrom here : http://letsmakerobots.com/node/35489 ..
techbitar (author)  n_galia5 months ago
- Do you have the HC-05 or the HC-06?
- Are you using the HC-05 with the breakout board or the plain SMD HC-05?
- Do you see a change in blink speed for the HC-05 like in my videos when you connect the HC-05 to another Bluetooth?
n_galia techbitar5 months ago
-Hai Tech, I have the HC-05 and not the HC-06,I also Used the plain SMD HC-05.I also seen in the change in the blink when I paired it,.As I continue observing on what I did(followed what you did) based on this link, http://letsmakerobots.com/node/35489 . I just observed that,seems no data can be send to my hc-05.It can only be paired and no data can be send.I'm not that really sure on my observation but that's what I think..Thank you for any response that will be given.. more Power!
most15 months ago
Thank you very much for this instructible. Is it possible to publish the source code for the android app.
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!