For my project, I used Bluetooth as a connection between android and arduino. It's because bluetooth technology is inexpensive and low interference and also easy to install and control. Bluetooth doesn't required to think about setting up a connection or to push any buttons. When 2 or more device enter a range (up to 30 feet) of one another, they automatically begin to communicate without having to do anything.
schematic symbol with pin diagram |
To make the communication between Android and Arduino easy, I must follow this step:
step 1: make a app to Android which could communicate with other devices by bluetooth.
step 2: android application connect to arduino by bluetooth bee.
this application is a simple bluetooth connection with android. I just used smart phone, arduino main board, and bluetooth bee module to demo. I used adnroid application to create the program.
This is a basic classes that I need to know and create into Bluetooth program:
- BluetoothAdapter: Represents the local Bluetooth adapter (Bluetooth radio)
- BluetoothDevice: Represents a remote Bluetooth device, query information such as its name, address, class, and bonding state.
- BluetoothSocket: Represents the interface for a Bluetooth socket (similar to a TCP Socket).
- BluetoothServerSocket: Represents an open server socket that listens for incoming requests (similar to a TCP ServerSocket).
- BluetoothClass: Describes the general characteristics and capabilities of a Bluetooth device.
·