Controlling devices connected to arduino uno+bluetooth through android.

I am working on a college project. It involves controlling devices(switching them on and off) wirelessly through bluetooth from an android phone.
I ordered an arduino uno board along with a bluetooth HC-06 module.
I need the android source code to control the pins on the arduino uno board through bluetooth.
And probably a little help with the basics.

Please help me out asap as my project is due in a week.

I'm trying to do the same thing with a bluesmirf silver. If you're not worried about the app itself, try the arduino commander app, it's designed for bluetooth control of arduino boards. I'm not very advanced with this, so I've also looked into some programs I've found online that use MIT app inventor for the phone and have an arduino sketch to go with it. Finally, I've also downloaded the amarino app (it's not on Google play). The amarino site has arduino sketches on the website as well to get you started as well.

So far, I only the Amarino app has actually connected, but maybe you'll have better luck or figure it out where I failed. It's at least a place to start. I've gone through three different bluetooth modules and two phones since I've started the project, so I'm not sure what I'm doing wrong. Sorry I can't be of more help, but hopefully this helps some. Good luck!

Devenom:
I need the android source code to control the pins on the arduino uno board through bluetooth.
And probably a little help with the basics.

With a bit of luck, you don't need any Android source code, you just need an app that suits your real needs, rather than imagined needs, and I'm sure there are plenty of those on the Google site. The Android source wouldn't control Arduino's pins anyway. That is actually done with an Arduino programme that responds to data received via bluetooth.

Here is some background on the communications

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT2way.ino

Maruktika1:
I'm trying to do the same thing with a bluesmirf silver. If you're not worried about the app itself, try the arduino commander app, it's designed for bluetooth control of arduino boards. I'm not very advanced with this, so I've also looked into some programs I've found online that use MIT app inventor for the phone and have an arduino sketch to go with it. Finally, I've also downloaded the amarino app (it's not on Google play). The amarino site has arduino sketches on the website as well to get you started as well.

So far, I only the Amarino app has actually connected, but maybe you'll have better luck or figure it out where I failed. It's at least a place to start. I've gone through three different bluetooth modules and two phones since I've started the project, so I'm not sure what I'm doing wrong. Sorry I can't be of more help, but hopefully this helps some. Good luck!

Hi Maruktikal, Thanks for the reply. But I actually need the code since my project involves making my own app by modifying existing apps. I searched a lot but i can't find it online. The electronic part is not part of my project but my sir will help me with it. My part only involves programming. If you could help me find the code it will really help me a lot. Thanks again. :slight_smile:

Nick_Pyner:

Devenom:
I need the android source code to control the pins on the arduino uno board through bluetooth.
And probably a little help with the basics.

With a bit of luck, you don't need any Android source code, you just need an app that suits your real needs, rather than imagined needs, and I'm sure there are plenty of those on the Google site. The Android source wouldn't control Arduino's pins anyway. That is actually done with an Arduino programme that responds to data received via bluetooth.

Here is some background on the communications

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT2way.ino

Hi Nick Pyner, Thanks for the reply. But I actually need the code since my project involves making my own app by modifying existing apps. I searched a lot but i can't find it online. The electronic part is not part of my project but my sir will help me with it. My part only involves programming. If you could help me find the code it will really help me a lot. Thanks again. :slight_smile:

Devenom:
But I actually need the code since my project involves making my own app by modifying existing apps.

OK I misunderstood the real story - Android problem, not Arduino. I have had a bit of a look at this, and breaking into somebody else's app to modify it is not that straightforward. There could be legal issues as well as technical. Just because a programme is free, it doesn't necessarily mean the code is in the public domain.

Having said that, if you just want to turn switches on and off, I imagine some basic tutorials will either have examples ready to go, or impart sufficient knowledge to enable you to do it yourself from scratch.

One place to start is here

http://appinventor.mit.edu/explore/

Nick_Pyner:

Devenom:
But I actually need the code since my project involves making my own app by modifying existing apps.

OK I misunderstood the real story - Android problem, not Arduino. I have had a bit of a look at this, and breaking into somebody else's app to modify it is not that straightforward. There could be legal issues as well as technical. Just because a programme is free, it doesn't necessarily mean the code is in the public domain.

Having said that, if you just want to turn switches on and off, I imagine some basic tutorials will either have examples ready to go, or impart sufficient knowledge to enable you to do it yourself from scratch.

One place to start is here

Redirecting…

Thanks Nick Pyner, I kinda worded it wrong. I mean I have to make my app better than existing apps. I created half the code which for now has no functionality at all. Ya I basically just need the code to turn on and turn off switches. I'll start by looking into Redirecting… . Thanks a lot for your help. If there is any other code you know to control light switches let me know.
I have attached my half done app in a .rar file. You can check it out. Thanks again :slight_smile:

BTLIGHTS.rar (1.89 MB)

Nick Pyner, I went through the appinventor site but the source code provided there isn't for eclipse, is it? Can I get it to work on eclipse? I need to explain the code to the teachers too that's why its important. Thanks

Bluetooth on android works via an intent, it's not newbie friendly. .

cjdelphi:
Bluetooth on android works via an intent, it's not newbie friendly. .

蓝牙概览  |  Connectivity  |  Android Developers

I know Intent. Bluetooth is not my problem. But do you know how to control switches through Bluetooth? If yes then please help.

Well yes, once you establish a connection to your arduino via a bt module, you use uart via a hard/soft serial port, then it's a case of parsing the data..

Simplicity send 'A' from android

GetData .. serial.read. .
If (byte=='A')
digitalWrite (pin, HIGH);

Etc

cjdelphi:
Well yes, once you establish a connection to your arduino via a bt module, you use uart via a hard/soft serial port, then it's a case of parsing the data..

Simplicity send 'A' from android

GetData .. serial.read. .
If (byte=='A')
digitalWrite (pin, HIGH);

Etc

Thanks Bro. Do you have the rest of the code? Really Appreciate your help. Or do you know any site offering the code? I can't get the proper code.