Introduction: Android Arduino Bluetooth PC Game Controller

This instructable is show You How to make Android Arduino PC Game Controller . Android Arduino PC Game Controller is One Kind of Android Application Based Embedded System. An Android Application which is developed by Me Name "Armduino" can Interacts with This System. The Armduino Send value to the HC-05 Bluetooth Module and Arduino Leonardo Process This Value as Keyboard Instructions because Armduino Leonardo Have Keyboard,Mouse Emulation.

Step 1: Materials


> An Arduino Leonardo

> A HC-05 Bluetooth Module

> Some Jumper Wire


> Android Studio

> Arduino IDE (Integrated Development Environment)

Step 2: Schematic and Assembly

> Connect HC-05 Bluetooth Module +5v to the Arduino Leonardo +5v

> Connect HC-05 Bluetooth Module GND to the Arduino Leonardo GND

> Connect HC-05 Bluetooth Module TX to the Arduino Leonardo RX

> Connect HC-05 Bluetooth Module RX to the Arduino Leonardo TX

HC-05 ------------------------------------------- Arduino Leonardo

+5v -------------------------------------------------- +5v

GND ------------------------------------------------ GND

TX ------------------------------------------------- RX

RX ------------------------------------------------- TX

Step 3: Upload Code to Arduino

Now Download Arduino IDE from and Install it then Download My Arduino Keyboard Emulation Code From given Link then Upload it to your Arduino Leonardo.

Step 4: Android Code Explanation

> First of All You will create a New Project from File in Android Studio give Project Name BluetoothDeviceList and create ListView and Button . ListView Show Device List Data When Your Android is Connected To the Bluetooth and Button is Pressed

Button btnPaired;<br>ListView devicelist;
private BluetoothAdapter myBluetooth = null;
private Set pairedDevices;
public static String EXTRA_ADDRESS = "device_address";
protected void onCreate(Bundle savedInstanceState) {
    Toolbar toolbar = (Toolbar) findViewById(;
    btnPaired = (Button)findViewById(;
    devicelist = (ListView)findViewById(;
    myBluetooth = BluetoothAdapter.getDefaultAdapter();
    if(myBluetooth == null)
        //Show a mensag. that the device has no bluetooth adapter
        Toast.makeText(getApplicationContext(), "Bluetooth Device Not Available", Toast.LENGTH_LONG).show();
        //finish apk
    else if(!myBluetooth.isEnabled())
        //Ask to the user turn the bluetooth on
        Intent turnBTon = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
    btnPaired.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v)

>> Create a Function and Give Name pairedDevicesList() . this function is responsible to get Bluetooth Paired Device name and Device Address and we take ArrayList and Set ArrayAdapter to Containe all Paired Device List data and call the pairedDevicesList() function in show devices button onclickListener(); the paired Device is only work when we press the Show Devices Button

private void pairedDevicesList()<br>{
    pairedDevices = myBluetooth.getBondedDevices();
    ArrayList list = new ArrayList();
    if (pairedDevices.size()>0)
        for(BluetoothDevice bt : pairedDevices)
            list.add(bt.getName() + "\n" + bt.getAddress()); //Get the device's name and the address
        Toast.makeText(getApplicationContext(), "No Paired Bluetooth Devices Found.", Toast.LENGTH_LONG).show();
    final ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, list);

>> Now Add onItemClickListener to the Paired Device List. this is usefull when we press any device Like HC-05 Module from ListView List and then given function can take the MAC Address from Pressed Item/Device from List

<pre>private AdapterView.OnItemClickListener myListClickListener = new AdapterView.OnItemClickListener()<br>{
    public void onItemClick (AdapterView<!--?> av, View v, int arg2, long arg3)
        // Get the device MAC address, the last 17 chars in the View
        String info = ((TextView) v).getText().toString();
        String address = info.substring(info.length() - 17);
        // Make an intent to start next activity.
        Intent i = new Intent(getApplicationContext(), GameControllerActivity.class);
        //Change the activity.
        i.putExtra(EXTRA_ADDRESS, address);

Step 5: Android Application Link

This is My "ArmDuino" Android Application You can Also Download and Install My Application From Google Playstore to Control Your PC Via Bluetooth and Arduino

Link Of My "ArmDuino" Android Application :

Step 6: Arduino Source Code

Step 7: Android Application Source Code

This is My Android Application Code You Can Modify My Code and Create Your Own Application