Android Remote Control

Type:

Language:

Target :

Device:

Arduino Program

C++

Arduino 1.0.1

Arduino Mega 2560

Source Code:

Android_Remote_Control.ino

version 1.0

11-11-2012

Description :

This program allows the Arduino Mega board to be remotely controlled by an Android device (the Archos 28 table in ROFI's case). The Android device sends the Arduino Mega board a position for each servo, and the Arduino Mega board sends back the current range reading from the ultrasonic range sensor. This is program is required for several of ROFI's Android programs.

Setup :

The program uses the Microbridge Android Debug Bridge (ADB) implementation to communicate with the Android device through the USB host shield. You'll need to download their Arduino library (note that this is a special version for Arduino 1.0 and newer which isn't on their download page ... had to find it in the issues section). Copy the Adb folder into your Arduino IDE libraries folder :

Make sure to restart your Arduino IDE after you've copied the Adb folder into the libraries folder, otherwise it won't be recognized when you try and compile the source code.

Wired Setup Option:

  • Use a USB A to micro cable to connect the servo shield on the Arduino Mega to the Android device

  • Plug in a power adapter to ROFI to power the servos (no greater than 12v and at least 1.5 Amps)

  • Flip on the servo power switch on the side of ROFI (otherwise no power will go to the servos)

<TODO add diagram>

Autonomous Setup Option:

  • Use a USB A to micro cable to connect the servo shield on the Arduino Mega to the Android device

  • Use a volt meter to make sure the LIPO batter has at least 7 volts (never discharge the battery below 6.6 volts)

  • Plug in the LIPO battery connector to the Arduino Mega (don't forget to unplug once you're done!)

  • Flip on the servo power switch on the side of ROFI (otherwise no power will go to the servos)

<TODO add diagram>

Installation :

  1. Setup the Arduino development environment on your computer.

  2. Download the source file for this program.

  3. Open the Arduino development environment application on your computer.

  4. Open the source for this program ( from the main menu : File/Open...).

  5. Connect the computer to the Arduino Mega with a USB A to B connector (do not connect to the servo shield)

  6. Upload the program to the Arduino Mega (from the main menu : File/Upload)

  7. Disconnect the Arduino Mega from the the computer (unplug the USB A to B cable)

  8. Setup ROFI as detailed above.