1
votes

I'm a newbie and have no prior experience with arduino or microcontroller programming. For one of my course project, i need to send data/message/event from the arduino to my mobile phone (say android) via bluetooth as in the arduino board will have an external button/switch which when pressed should send an event to my application on android phone.

I did some googling and found Arduino BT and amarino as the right option for my project. And then there is BTShield v1.1 which is a cheap alternative (but i'm not sure about the interfacing). having said that, can anyone plz give me some pointers on the bluetooth programming part & some example codes on how to do this. Also, is it possible to embed a button/switch like stuff on the arduino board and as & when pressed, would it be possible for my android application to detect that press event?

Any help will be appreciated.

Thank you.

1
"Give me some pointers" and "Is this project possible" are not good questions. Start by reading up on the various protocols of Bluetooth and read thoroughly the datasheets of the modules you're considering. Then design your button circuit, and get that to turn on an LED on the Arduino. Then, add the Bluetooth shield to your Arduino, and add "send event over Bluetooth" to the button event. If you get stuck in this process, then come ask a question about your problem. However, you don't have a problem yet - you've not even started.Kevin Vermeer

1 Answers

2
votes

I recommend you to read these tutorials:

http://www.amarino-toolkit.net/index.php/tutorials.html

You don't have to learn Bluetooth programming first. Amarino already done many things for you.

If you wanna receive something from Arduino.

In android part you just

registerReceiver(arduinoReceiver, new IntentFilter(AmarinoIntent.ACTION_RECEIVED));
Amarino.connect(this, DEVICE_ADDRESS); 

Make a receiver and tell your android intent, Connect to your bluetooth module, override the onReceive method in ArduinoReceiver class...

Arduino part you put

meetAndroid.receive(); // put in loop()
meetAndroid.send("data you want to send");    

To receive events from Android and send to Android...

I highly recommend you go through these tutorials.