Showing posts with label bluetoothchat. Show all posts
Showing posts with label bluetoothchat. Show all posts

Sunday, August 28, 2016

Android BluetoothChat connect to Arduino Uno HC 05

Android BluetoothChat connect to Arduino Uno HC 05


Last example show "Android BluetoothChat example link with HC-05 Bluetooth", to connect to PC via FTDI adapter. Here is another example - Arduino UNO + HC-05 to echo received data back to the sender.

For my on-hand HC-05 sample, it set as slave role and 9600, 0, 0, PIN="1234" by default. So it can be used in this example without any extra setting.


Connection between UNO and HC-05
HC-05 Rx - Uno Tx (1)
HC-05 Tx - Uno Rx (0)
HC-05 GND - Uno GND
HC-05 VCC - Uno 5V
(My HC-05 marked "Power: 3.6V-6V", refer here, make sure your HC-05 can work on 5V.)

Uno_Serial_echo.ino
/*
Arduino Uno + HC-05 (Bluetooth) - echo bluetooth data

Serial (Tx/Rx) communicate to HC-05
HC-05 Rx - Uno Tx (1)
HC-05 Tx - Uno Rx (0)
HC-05 GND - Uno GND
HC-05 VCC - Uno 5V

*/

void setup()
{
delay(1000);
Serial.begin(9600);
}

void loop()
{
while(Serial.available())
{
char data = Serial.read();
Serial.write(data);
}
}

This video show how Android BluetoothChat example link with Arduino UNO + HC-05. For the Android BluetoothChat example, refer last post.


Related:
- Connect Arduino Due with HC-06 (Bluetooth Module)





Get

Read more »

Monday, August 1, 2016

Android BluetoothChat example link with HC 05 Bluetooth

Android BluetoothChat example link with HC 05 Bluetooth


This example show to import and modify Android BluetoothChat example, to link with low-cost Bluetooth HC-05.

reference:
- First test HC-05 Bluetooth Module
- AT Command mode of HC-05

We need a FTDI USB-to-Serial adapter to connect PC/USB and HC-05 Bluetooth, and use Arduino IDEs Serial Monitor as terminal, to talk with Android running modified BluetoothChat example.


This video show how to import BluetoothChat example in Android Studio, and edit BluetoothChatService.java to change MY_UUID_SECURE to UUID.fromString("00001101-0000-1000-8000-00805F9B34FB").

~ reference http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html, If you are connecting to a Bluetooth serial board then try using the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB.


This video show how it run on Android device, and talk to PC running Arduino IDEs Serial Monitor, via FTDI + HC-05.

In my on-hand HC-05 sample, it set as slave role and 9600, 0, 0, PIN="1234" by default, I have not change any setting.


Cross-post with Android-er

Next:
- Android BluetoothChat connect to Arduino Uno + HC-05

Get

Read more »