In-Ex IOIO-BOT User manual

IOIO-BOT : Android Robotics 1
IOIO-BOT
Android Robotics

2
IOIO-BOT : Android Robotics

IOIO-BOT : Android Robotics 3
Contents
Chapter 1
IOIO-Q : Android I/O board introduction.....5
Chapter 2
Android development tools installation.....13
Chapter 3
IOIO-RAB : IOIO Robotic Activity Board
introduction...........................................23
Chapter 4
Buiding IOIO-BOT...................................29
Chapter 5
IOIO-BOT interface testing with
Android device.......................................39
Chapter 6
IOIO-Bot app for IOIO-BOT.......................47

4
IOIO-BOT : Android Robotics

IOIO-BOT : Android Robotics 5
Chapter 1
IOIO-Q : Android I/O board
introduction
The heart of IOIO-BOT is IOIO-Q Android input output board. IOIO-Q is compatible
with IOIO (pronounced “yo-yo”) original board (or IOIO V1) that designed by Ytai; Israel
computer engineer.The IOIO-Q is re-designed and produced by Innovative Experiment
Co.,Ltd (INEX- www.inex.co.th / www.inexglobal.com). The IOIO-Q is a board specially
designed to work with Android 1.5 and later device. The board provides robust connectivity
to an Android device via a USB or Bluetooth connection and is fully controllable from
within an Android application using a simple and intuitive Java API. No embedded
programming or external programmer will ever be needed!
The IOIO-Q board contains a single MCU that acts as a USB host and interprets
commands from an Android app. In addition, the IOIO-Q can interact with peripheral devices
in the same way as most MCUs. Digital Input/Output, PWM, Analog Input, I2C, SPI, and
UART control can all be used with the IOIO-Q. Code to control these interfaces is written
in the same way as you write an Android app with the help of a simple to use app-level
library. In other words, you can combine the awesome computing power, Internet/Bluetooth
connectivity, touch screen, and a variety of sensors from your Android device with the
ability to easily add peripheral devices to interact with the outside world. Also, using the
IOIO-Q does not require any hardware or software modifications to your Android device,
thus preserving the warranty as well as making the functionality available to non-hackers.
The IOIO-Q acts as a USB host and connects to most Android devices that have USB
slave (device) capability.
Figure 1-1 : Photo of the original IOIO board by YTAI and Sparkfun (left white
board) and IOIO-Q board (right blue board) by Innovative Experiment or
INEX (www.inexglobal.com)

6
IOIO-BOT : Android Robotics
INEX is now shipping the IOIO board loaded with the V3.11 bootloader so that it’s
ready to go with the latest application update, which adds Open-Accessory support. Open
Accessory will provide improved latency, throughput and jitter. If ADB is enabled on the
Android, ADB will take precedence over Open Accessory. Disable ADB to have IOIO
working over Open Accessory.
IOIO-Q also can communicate with Android device over Bluetooth connection. This
is achieved simply by attaching a standard USB Bluetooth dongle to the board. Not every
possible dongle has been tested, and some are known not to work. However, most simple
ones do work. The bundled Bluetooth dongle in IOIO-BOT kit is tested and work well.
An existing application code written to work over USB does not need to change to
add Bluetooth support, if it is using the IOIOLib Application Framework. However, it will
need to be re-built against the Bluetooth libraries.
Note that Bluetooth is only supported on Android API level 7 ("2.1-update1") and
higher.
A-type USB connector for Android device
connection via ADB or wieless over
Bluetooth
Vin (+6.5 to +9V 500mA)
+3.3V 500mA output
Pin number
1 to 48
are input/output pin of
IOIO-Q for interfacing with external devices
ICSP port for firmware
programming by external
programmer such as
PICkit3
+5V 500mA output
Ground pin
Power LED
Status LED
[I/O-pin0]
IOIO-firmware
PIC24FJ128DAxx or
PIC24FJ256DAxx
I/O-pin30
I/O-pin31
I/O-pin32
I/O-pin21
I/O-pin20
I/O-pin19
I/O-pin41
I/O-pin42
Figure 1-2 : IOIO-Q board layout

IOIO-BOT : Android Robotics 7
MCLR
7
+3.3V
R1
10k
AVDD VDD1 VDD2 VDD3
19 10 26 38
K1
USB
GND
+V
D-
D+
USBDM
USBDP
RG3/USBDM
RG2/USBDP
36
37
34 VBUS/RF7
RB15 30
RB14 29
RB13 28
RB12 27
RB11 24
RB10 23
RB9 22
RB8 21
RB7 18
RB6 17
RB5 11
RB4 12
RB3 13
RB2 14
RB1 15
RB0 16
46
45
44
43
42
41
40
39
38
37
31
32
33
34
35
36
IC1
PIC24FJ128DA
PIC24FJ256DA
+5V
VUSB
35
+3.3V
R3
330
RP16/RF3
33
LED1
STATUS
(0)
ENVREG
+3.3V
57
SDA3/RE7
SCL3/RE6
RE5
RE4
3
2
1
64
RE3
63
RE2
62
RE1
61
RE0
60
26
25
24
23
22
21
20
19
RC15 40
RC14 48
RC13 47
RC12 39
2
9
8
1
RG9 8
RG8 6
RG7 5
RG6 4
30
29
28
27
SCL2/RF5 32
SDA2/RF4 31
RF1 59
RF0 58
48
47
18
17
RD11
SCL1/RD10
SDA1/RD9
RD8
45
44
43
42
RD7
55
RD6
54
RD5
53
RD4
52
6
5
4
3
16
15
14
13
RD3
RD2
RD1
RD0
51
50
49
46
12
11
10
7
VCAP 56
C1
10
F
VSS3 41
VSS2 25
VSS1 9
AVSS 20
LED2
PWR
+5V
IC2
LM1117-
5.0V
IC3
LM1117-
3.3V
C2
0.1
F
50V
C3
47
F
50V
C4
0.1
F
50V
R4
510
C7
0.1
F
50V
+3.3V
MCLR
R2
4.7
Vin
GND
+5V
+3.3V
PGC2
PGD2
+3.3V
MCLR/Vpp
Vpp
VDD
GND
PGD
PGC
AUX
ICSP
Figure 1-3 : IOIO-Q schematic diagram

8
IOIO-BOT : Android Robotics
IOIO-Q
pin
Input
Output
Analog
inout
I
2
C bus
pin
Peripheral
output
Peripheral
input
+5V
support
Compare
input
Firmware
program-
med pin
Peripheral input pin :
Recived serial data pin of UART module, SPI port pin and
Input Capture
Peripheral output pin :
Transmit serial data pin of UART module, SPI port pin,
Ouput Compare and PWM output
Table 1-1 : Pin assignment and functional of IOIO-Q board (continue)

IOIO-BOT : Android Robotics 9
IOIO-Q
pin
Input
Output
Analog
Input
I
2
C bus
pin
Peripheral
output
Peripheral
input
+5V
support
Compare
input
Firmware
program-
med pin
Peripheral input pin :
Recived serial data pin of UART module, SPI port pin and
Input Capture
Peripheral output pin :
Transmit serial data pin of UART module, SPI port pin,
Ouput Compare and PWM output
Table 1-1 : Pin assignment and functional of IOIO-Q board (final)

10
IOIO-BOT : Android Robotics
1.1 IOIO-Q technical features
IOIO-Q I/O board is compatible with the original IOIO V1.0 board. The mainly features
also similar the original IOIO board. Except the supply voltage rating and some special
pin layout for supporting the firmware programming with external programmer such as
PICkit3 easier.Figure 1-1 shows the hardware layout of the IOIO-Q board.
Summary of IOIO-Q board is as follows :
Firmware microcontroller PIC24FJ128DA or PIC24FJ256DA
48 of Digital input output pins
16 of Analog inputs. Range is 0 to +3.3V. Operated with 10-bit Analog to Digital
Converter module within the main microcontroller.
9 of PWM outputs with 10-bit resolution
4 of UART ports for serial communication
3 of I2C bus ports
A-type of USB host for connection with USB Bluetooth dongle and Android device
by ADB connection
Built-in Status LED and POWER LED
Re-design the In-Circuit Serial Programming (ICSP) port compatible with PICkit3
port for easier firmware programming by the PICkit3 programmer.
Supply voltage +6 to +9V at least 500mA. On-board +3.3V and +5V 500mA up to 1A
regulator circuit
Connect with Android device over Android Debug Bridge (ADB) or Bluetooth
Operate with Android OS V1.5 and higher

IOIO-BOT : Android Robotics 11
1.2 IOIO-Q schematic diagram
Figrue 1-2 illustrates fully IOIO-Q schematic diagram. The heart of IOIO-Q is IC1 a
preprogrammed IOIO firmware microcontroller; PIC24FJ128DA. The main different from
the original IOIO board is power supply section. In IOIO-Q board use linear regulator
circuit. LM1117-5.0 is +5V regulator IC. It regularted the supply voltage range +6 to 9V to
fixed +5V for supply the Android device and Bluetooth dongle that connected to USB
connector. About +3.3V regulated supply is from IC3; LM1117-3.3. The +3.3V supply voltage
is for all devices on the IOIO-Q board include the main microcontroller IC1.
LED1 is power supply indicator. The yellow one; LED2 is connected with RD4 pin
of IC1 (assigned as I/O-pin 0 of IOIO-Q). It is actived by logic “0”. IOIO-Q use this LED as
Status LED .
IOIO-Q provides total 48-I/O pin. Include 16 of analog input pins, 9 of PWM outputs,
4 of UART serial communication ports and 3 of I2C bus ports.
The original IOIO board information and datasheet is provided at
https://github.com/ytai/ioio/wiki
1.3 IOIO-Q pin assignment
Refer the IOIO-Q schematic in figure 1-2, IOIO-Q provides 48 of input output pins.
Android application developers have to understand about IOIO-Q pin assignment before
develop the application. Table 1-1 is summary about IOIO-Q pin assignemnt and function.
Some pin has more than one function. In application delopment must choose the correct
pin and understand about limitation. For example, the analog input can get the DC voltage
only 0 to +3.3V. While some digital input pin can accept +5V or TTL logic level but some
digital input pin cannot. Understanding about port pin operation is very important for
IOIO-Q with Android application development.

12
IOIO-BOT : Android Robotics

IOIO-BOT : Android Robotics 13
To develop applications for Android device, developers are required to download
software tools from internet to be installed on computer. Then start developing application
to Android devices. The key software is as follows :
1. Android Development Tools (ADT)
2. Java Runtime Environment (JRE)
2.1 Application development software
2.1.1 Android Development Tools (ADT)
ADT is a software for developing applications for Android devices that are popular.
This software uses Eclipse; one of Java application development tool combined with the
Android SDK; software development kit for Android applications by Google. The result
is applications for Android devices in particular.
2.1.2 Java Runtime Environment (JRE)
It is a set of instructions to develop applications in Java language. JRE includes
nescessory tools of the Java programming language. It is essential for developing apps
with Android.
2.2 Development tools installation
2.2.1 How to installation on Windows
For installing software on Windows, the explanation refer to the 64-bit Windows
8.1. For the other versions of the Windows may be a little different.
Chapter 2
Android development tools
installation

14
IOIO-BOT : Android Robotics
2.2.1.1 Java Runtime Environment (JRE) installation
(1) If the computer is installed Java Runtime Environment (JRE) or Java Development
Kit (JDK) already but it is an old version. Must uninstall it then restart the computer after
the uninstall is complete. Before you start to install the Java Runtime Environment (JRE)
version, checking the latest version of JRE from http://www.oracle.com/technetwork/java/
javase/downloads/index.html
(2) Download the Java Runtime Environment (JRE) from http://www.oracle.com/
technetwork/java/javase/downloads/index.html In this example, it is Version 8 Update
5. If there is a newer version, use latest version instead.

IOIO-BOT : Android Robotics 15
(3) Download the operating system used. In this example is Windows 8.1 in 64-bit.
Choose to download a Windows x64.
(4) Run the installation file and click on Install button to start.

16
IOIO-BOT : Android Robotics
(5) Wait until instalaltion is completed. Click on the Close button to finish.
2.2.1.2 Android Development Tools (ADT) installation
(1) Download the Android Development Tools (ADT) from http://developer. android.
com/sdk/index.html. Click on the Download the SDK ADT Bundle for Windows button.
It will choose the computer operation system automatically.

IOIO-BOT : Android Robotics 17
(2) Click the checkmark in the box I have read and agree with the above terms
and conditions. Then choose the version of the operating system 32 or 64 bits. Next, click
on the Download the SDK ADT Bundle for Windows button to start downloading.
(3) Extract the downloaded file to softwarte folder.

18
IOIO-BOT : Android Robotics
(4) Enter the ADT software folder to open the file ; Eclipse.exe
(5) Run the program. Eclipse logo will be appeared shortly. Next, the main window;
Workspace Launcher is appeared. It is window that determines the development of Java
applications folder to store the created files. In this example is C:\User\user\workspace.
(Recommend assigning a drive other than C:\, as defined as the D:\ drive).
This window shows up asking for every time that start the program. If do not want
to ask, click and check at Use this as the default and do not ask again will not be asked
again.

IOIO-BOT : Android Robotics 19
(6) ADT program will be open with the Welcome window. It is installation completely.

20
IOIO-BOT : Android Robotics
2.2.2 How to installation on Mac OS
To install on Mac OSX Mavericks 10.9 will not install the Java Runtime Environment
(JRE) because the Mac OS operating system is installed successfully.
2.2.2.1 Android Development Tools (ADT) installation
(1) Download the Android Development Tools (ADT) from http://developer.android.
com/sdk/index.html. Click on the Download the SDK ADT Bundle for Mac button.
(2) Click to checkmark at box I have read and agree with the above terms and
conditions . Click on the Download the SDK ADT Bundle for Mac button to start downloading.
Table of contents
Other In-Ex Robotics manuals