How to connect my phone to Arduino in 10 stepsThis quick start guide assumes that you have installed Amarino on your phone and you have added the MeetAndroid library to your Arduino working environment and your Bluetooth module is set to 57600 or 115200 baud (depends on your Arduino board, oder boards are more likely to work with 57600 baud whereas newer ones only will work correctly with 115200 baud)! Note that Arduino BT boards will work with 115200 baud. If not please go to Installation first. Look at the documentation of your Bluetooth module to figure out how to set the baud rate to 57600 or 115200.
Discover Arduino Bluetooth device1. This is the first screen you will see when you start Amarino on your phone. Since Amarino is all about connecting your phone to an Arduino, the very first step you have to do is to search for your Arduino Bluetooth device you want to talk to (in geek lingo we say discover a BT device). To do that hit the "Add BT Device" button and wait until your Arduino Bluetooth module pops up. If it will not show up even if the discover process has already finished, you should check if your Arduino Bluetooth module is powered and discoverable.
Congratulations, the first important step is done. Hurray!
Ok then, let's do the pairing thing.3. Finally it is time to hit the connect button. Don't worry you will get a "Connection failed" message or a message telling you to pull down the status bar to enter the pin, but that is just fine. We tried to connect to an unpaired device, which is as I said not possible, and now you proved it!
But apart from that, it was necessary to get the pairing request notification in your notification bar (on the very top of your phone). Pull down the notification bar as shown in the screenshot and you will see the "Pairing request" notification.
Wow this was tuff. But now you have successfully authentictated your device, which is required before we can connect to it.
Connect5. Ready to give it another try? Hit the connect button once again. This time it should connect successfully indicated by a green light on your Bluetooth module and a green light right above the connect button. If not, repeat the pairing process.
Gratulations! Your phone is now ready to talk to Arduino. However Arduino is not ready yet, so let's start setting it up.
Arduino setup7. Open your Arduino working environment and select "File->Examples->MeetAndroid->Test".
8. Change the baud rate of your Bluetooth module to either 57600 or 115200 baud. Newer Arduino boards will only work with 115200 baud, older ones only with 57600 baud. Note that Arduino BT boards work with 115200 baud and you are not supposed to change the baud rate for the Arduino BT. If you do not use an Arduino BT board with built-in Bluetooth than refer to your Bluetooth module documentation about how to change the baud rate of your external Bluetooth module. Make sure the baud rate of your Bluetooth module matches the baud rate in your Arduino sketch. All examples uses 57600 baud ( Serial.begin(57600) ), so if you use a BT module with 115200 baud you have to change the 57600 to 115200 in your Serial.begin statement.
9. Upload the sketch to your Arduino. If your Arduino has no onboard LED connected to pin 13 you might put your own LED to pin 13 of your Arduino. You should already know how this works. Otherwise you should look it up on the Arduino website.
Your phone is now set up, your Arduino is loaded with a test programm. So far so good. Now comes the great moment. Let's see if they understand each other.
Communicate10. Power on your Arduino with your Bluetooth shield attached to it. Take your Android phone and go to the main screen. Hit the connect button next to your added BT device. It should start connecting. If your connection could be established the indicator changes to green.
If everything went right your led on pin 13 will blink every 5 seconds for 1 second.