24
$\begingroup$

Smart phones these days typically come with a gyroscope, accelerometer, compass, camera, and GPS sensor all on board. They also usually have a connection to the internet with Wifi and mobile data networks. I've seen many cases of using a phone as a remote control for a robot, but to me, it seems like the phone itself is a perfect lightweight computing and sensing platform for an autonomous robot.

The main obstacle I see is interfacing with actuators. Being able to control motors to steer even a table-top robot, or control servos, for example. Connecting and communicating to a microcontroller could be an obstacle as well.

As a robot hobbyist, I'd like to know how I can overcome these and other obstacles to be able to harness the power of my smart phone with my robotics projects.

$\endgroup$
19
$\begingroup$

The Android Accessory Development Kit (ADK) should do everything you need.

ADK

It's an Arduino board that is specifically designed to interact with Android. You can connect the two over Bluetooth or USB (or WiFi/Ethernet, I think).

Since the whole architecture is open, you can use each part for what it's best at. You write the Android code to get data from the phone's built-in sensors and control the display. And you write the Arduino code to control actuators, servo's and other sensors that phone's don't come. The code to communicate between the two is provided open source via Google.

From the Arduino Blog:

The Android Open Accessory Development Kit (ADK) provides an implementation of an Android USB accessory that is based on the Arduino open source electronics prototyping platform, the accessory’s hardware design files, code that implements the accessory’s firmware, and the Android application that interacts with the accessory. The hardware design files and code are contained in the ADK package download.

Most of the examples are designed around using the phone as a graphical interface for some sort of hardware accessory like a clock. But there's no reason you couldn't access the phone's sensors as well and pass data back and forth.

Adafruit even mentions using it to make robots on their store's page for the ADK:

Fast track your Android phone hardware development or just design cell-phone robots with the Arduino ADK! The Arduino ADK is a microcontroller board based on the powerful ATmega2560 (datasheet). It has a USB host interface to connect with Android based phones, and a power supply boost converter to charge up the phone from DC power while its plugged into the ADK

(emphasis mine)

$\endgroup$
11
$\begingroup$

Another option is the IOIO-OTG board:

IOIO-OTG board

The Sparkfun product description describes its functionality:

It features a PIC microcontroller which acts like a bridge that connects an app on your PC or Android device to low-level peripherals like GPIO, PWM, ADC, I2C, SPI, and UART. An app-level library helps you write control code for these low level peripherals in the same way you'd write any other Java app!

This board should do everything you wish and it even has a nice tutorial to help you get started.

$\endgroup$
4
$\begingroup$

Many recent Android devices, such as the Nexus 7, support USB On The Go (OTG) which is a fancy way of saying that 'USB Host Mode' is supported. In these cases, with the right cable which can be had for less than $1, any compatible USB device can be used. You don't need a specialty version of the Arduino that has hardware for USB Host mode.

I've experimented with this enough to know that a 'normal' Arduino such as the Leonardo or Teensy 2 appears to an Android phone as a TTY (e.g. serial port) device when connected with an OTG cable.

This article goes into depth on how to use the Android USB Host API to communicate to the Arduino from an Android app. It requires Android 3.1+ and does not require you to root the device.

$\endgroup$
5
$\begingroup$

Yes, the lack of GPIO pins on smartphones is a shame. If you already have ROS running on the robot you could use this app on an Android phone to get access to the sensor suite on the phone.

$\endgroup$
6
$\begingroup$

The main problem as I see it isn't really interfacing with actuators-- if you have a good way to wirelessly transfer digital (even better would be analog, or a channel good enough to do PWM) signals, you can just interface that with a motor driver chip (e.g. L293D) and be good to go. For servos, you need good response time so that you can handle the pulses. If you have a PWM-capable channel, this shouldn't be hard as the channel has a high baud already. If you have a slow channel, servos may not be possible since you require accurate pulse timing.

The first option I see (though it's rather bulky) is to take a Raspberry Pi, connect it via ethernet to a wireless router, and connect the phone to the same wirelessly. Now just write a basic app for your phone that sends requests to the Pi based on input, and write another server like app for the Pi that handles these. Might be bulky and somewhat hard, but it's quite extensible, IMO. You can also put the router offboard and stick this into the Pi (or use hotspot and eliminate the router entirely).

Another option is to use a bluetooth controller like the one shown here. I've not used this before, but it looks like you'll still need a microcontroller to handle this. I guess you can connect its RX/TX pins directly to the TX/RX on an arduino, though I'm not too sure of this.

If you've used XBee/ZigBee before, you may want to try out the bluetooth bee.

A final option is to use the phone USB port with a conventional wireless control setup (XBee/whatever)--but this will require one to write drivers and all.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.