IOIO-BOT documentation

Page 1

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

Pin number 1 to 48 are input/output pin of IOIO-Q for interfacing with external devices I/O-pin19

+3.3V 500mA output Vin (+6.5 to +9V 500mA)

I/O-pin20 I/O-pin21 ICSP port for firmware programming by external programmer such as PICkit3

A-type USB connector for Android device connection via ADB or wieless over Bluetooth

I/O-pin30 I/O-pin31 I/O-pin32

I/O-pin41 I/O-pin42

IOIO-firmware PIC24FJ128DAxx or PIC24FJ256DAxx

Status LED [I/O-pin0]

+5V 500mA output Ground pin Power LED

Figure 1-2 : IOIO-Q board layout 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.


AUX PGC PGD GND VDD Vpp

IOIO-BOT : Android Robotics 7

+3.3V

ICSP MCLR/Vpp +3.3V

19 57 AVDD ENVREG

R1 10k K1 USB

7 MCLR

MCLR GND +V DD+

USBDM 36 RG3/USBDM USBDP 37

+5V

IC1 PIC24FJ128DA PIC24FJ256DA

RG2/USBDP

R2 4.7

10 26 38 VDD1 VDD2 VDD3

34

PGC2 PGD2

+3.3V

VBUS/RF7

35 VUSB

+3.3V

R3 330 LED1 STATUS (0)

26 25 24 23 22 21 20 19

6 5 4 3 16 15 14 13 12 11 10 7

33 RP16/RF3 3 2 1 64 63 62 61 60 45 44 43 42 55 54 53 52 51 50 49 46

GND

30 29 28 27 24 23 22 21 18 17 11 12 13 14 15 16

46 45 44 43 42 41 40 39 38 37 31 32 33 34 35 36

40 RC15 48 RC14 47 RC13 39 RC12 8 RG9 6 RG8 5 RG7 4 RG6 32 SCL2/RF5 31 SDA2/RF4 59 RF1 58 RF0

SDA3/RE7 SCL3/RE6 RE5 RE4 RE3 RE2 RE1 RE0 RD11 SCL1/RD10 SDA1/RD9 RD8 RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0

2 9 8 1 30 29 28 27 48 47 18 17

VCAP 56

C1 10F

VSS3 41 VSS2 25 VSS1

9

AVSS 20

+5V

+5V

Vin

RB15 RB14 RB13 RB12 RB11 RB10 RB9 RB8 RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0

+3.3V IC2 LM11175.0V C2 0.1F 50V

IC3 LM11173.3V R4 510

C3 47F 50V C4 0.1F 50V

Figure 1-3 : IOIO-Q schematic diagram

LED2 PWR

+3.3V C7 0.1F 50V


8IOIO-BOT : Android Robotics

IOIO-Q pin

Input Output

                        

                        

Analog inout

Firmware

I2C bus Peripheral Peripheral +5V Compare programoutput input pin support input 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

Firmware

I2C bus Peripheral Peripheral +5V Compare programoutput input pin support input 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

Chapter 2

Android development tools installation 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.


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.


IOIO-BOT : Android Robotics 21

(3) Double-click at file to extract.

(4) Enter to the ADT folder. Run the Eclipse executre file.


22IOIO-BOT : Android Robotics

(5) Run the program. Eclipse logo will be appeared shortly following 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.

(6) ADT program will be open with the Welcome window. It is installation completely.


IOIO-BOT : Android Robotics 23

Chapter 3

IOIO-RAB : IOIO Robotic Activity Board introduction One of important component of IOIO-BOT is IOIO-RAB (IOIO Robotic Activity Board). It includes the socket for installtion IOIO or IOIO-Q board, power supply circuit, DC motor driver mini-board and Servo motor connector. This chapter describes about technical details of IOIO-RAB before go to building the IOIO-BOT in next chapter.

Figure 3-1 : The IOIO Robotic Activity Board (IOIO—RAB); the activity board of robotics application for original IOIO and IOIO-Q board


24IOIO-BOT : Android Robotics

3.1 IOIO-RAB technical features  Socket for installation both IOIO and IOIO-Q. The IOIO-Q is recommended for

IOIO-BOT

Left orientation photo

 8 of Analog input connector in 3-pin of JST 2.00mm. type. The AN0 to AN5 input

support 0 to +3.3V input. AN6 and AN7 is used for analog sensor that requires +5V supply but give only 0 to +3.3V output voltage maximum. For example, the distance sensor GP2D120/ GP2Y0A41 or GP2Y0A21.  18 of Digital input output port (I/O-pin31 to 48) in IDC 2.54mm. male and female

connector type. Support AWG#22 wires and/or also IDC1MF wires

Left orientation photo

 I2C bus connector with +3.3V supply voltage  Piezo speaker is connected with I/O-pin27 of IOIO-Q


IOIO-BOT : Android Robotics 25

 +5V output connector and +3.3V used from IOIO-Q board  4 of Servo motor connectors with +6V servo motor regulator circuit. They are

connected with I/O-pin45 to 48 of IOIO-Q

 6 of DC motor output by using 3 of mini-TB6612 boards with motor indicators.

Support DC motor 4.5 to 9V 1A each.

Right orientation photo

 Low battery monitor circuit with indicator  Supply voltage +6.5 to +12V. On-board +6V regulator circuit for IOIO-Q board and

Servo motors  There are 2 types of battery connector.

1. Terminal block : suitable for connecting with battery holder wire 2. DEAN connector : suitable for Litium Polymer (Li-PO) battery. 2 cells of Li-PO (+7.4V) 1000mA or higher current is recommended.

 Dimension 3 x 4 Inches


26IOIO-BOT : Android Robotics

3.2 IOIO-RAB schematic diagram and how it work Figure 3-2 illustrates the IOIO-Robotic Activity Board (IOIO-RAB) schematic diagram. It is quite simple circuit. There are 2 of +6V voltage regulator by using IC2 and IC3; KIA278R06. One is supply voltage for servo motor. It is connected to +V of K7 to K10 Servo motor connectors. Another one is supply voltage for IOIO-Q board. Capacitor C2 to C4 are connected for improving the servo motor driving with IOIO-Q. +Vm IC2 KIA278R06 R3 330

K1 DC INPUT +7.4V

C1 0.1F/50

SW1

LED2 LOW BAT C5 47F

IC1 KIA7035

R1 1k

C2-C4 470F 16V

R2 1.5k

Vin 3.3V

K2 Li-PO +7.4V

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

20

K3 IOIO-Q port1

+5V GND GND GND 48 47 46 45 44 43 42 41 40 39 PGD/38 PGC/37 36 35 MCLR 34

IOIO-Q

2021 22

+5V +Vs K7-K10 SERVO x 4

+5Vout +5Vout

33

23 24 25 26 27 28

1 2 DC motor 3 driver board 4 #1 (CH1-2) 5 6 7/INT0/RP11 8 9 10 11 DC motor 12 driver board 13 14 #2 (CH3-4) 15 #3 (CH5-6) 16 17 18 19

C6 0.1F

K6 +5V

USB HOST

C2 0.1F +3.3V 50V

IC3 KIA278R05

32

+Vs

SERVO4 SERVO3

GND GND 48 47 46 45 44/AN13 43/AN12 42/AN11 41/AN10 40/AN9 39/AN8 38/AN7 37/AN6 36/AN0 35/AN1 34/AN2 33/AN3 32/AN4 31/AN5

SERVO2 SERVO1

+3.3V

AN7 +3.3V

AN6 +3.3V

AN0 +3.3V

AN1 +3.3V

AN2 +3.3V

AN3 +3.3V

29 30 31

AN4

K5 IOIO-Q port3

GND GND

+3.3V

AN5

K4 IOIO-Q port2

+3.3V 30/COMP2C/RP27 29/COMP2D/RP19 28/COMP1C/RP26 27/RP21 26/SDA2 25/SCL2 24 23 22 21

R4

MOD1 TB6612 (TURN 180o)

R5

K19 SCL2

R4,R5 4.7kx2

K20 SDA2

IOIO-Q port for MOTOR-2

6 5 4

+5V SP1 PIEZO SPEAKER

IOIO-Q port for MOTOR-1

C7 10F

1 2 3

GND GND PWMB +Vm BIN2

BO1

BIN1 STBY

AO2

AIN1

AO1

AIN2

Vcc

R7 1k +Vm

IOIO-Q port for MOTOR-4

12 15 11

+5V IOIO-Q port for MOTOR-3

8 9 10

GND GND PWMB +Vm BIN2

BO1

PWMA GND

BIN1 STBY

AO2

AIN1

AO1

AIN2

Vcc

LED5 MOTOR-4 K24 MOTOR-4

BO2

PWMA GND

MOD2 TB6612 (TURN 180o)

IOIO-Q port for MOTOR-6

14 19 18

+5V +5V R8 1k

K23 MOTOR-3 LED4 MOTOR-3

IOIO-Q port for MOTOR-5

16 17 13

K18 K11 K12 K13 K14 K15 K16

LED3 MOTOR-2 K22 MOTOR-2

BO2

+5V R6 1k

6-ch. MOTOR DRIVER SECTION R9 1k +Vm

K17

GND GND PWMB +Vm BIN2

BO1

BIN1 STBY

AO2

AIN1

AO1

AIN2

Vcc

R11 1k +Vm

K21 MOTOR-1 LED2 MOTOR-1 LED7 MOTOR-2 K26 MOTOR-6

BO2

PWMA GND

MOD3 TB6612 (TURN 180o)

Figure 3-2 : IOIO-Robotic Activity Board schematic diagram

+5V R10 1k

K25 MOTOR-5 LED6 MOTOR-1


IOIO-BOT : Android Robotics ď Źď€ 27

Figure 3-3 : The mini-TB6612 DC motor driver mini-board that used in IOIO-RAB for driving the DC motor. Totally are 6 channels. Low battery monitor circuit is very important in case using the Li-PO battery. If the supply voltage is below +3.5V, IC1 the battery monitor IC; KIA7035 will active and drive LED1 is on as a notification. IOIO-Q I/O pin 31 to 38 or AN5 to AN0, AN6 and AN7 are connected to K11 to K18 (sorted based on the circuit) for connect with the external analog sensors. The AN0 to AN5 connectors provide +3.3V supply voltage. For AN6 and AN7, supply is +5V. In using have to careful about the supply voltage of both type of analog sensor ports. For DC motor driver circuit, IOIO-RAB uses 3 of mini-TB6612 boards. IOIO-Q I/Opin1 to 6 for first 2 DC motor driver channels and pin8 to 19 for 4 channels. See the Table 3-1 for details of connections. Each mini-TB6612 board drives 2 of DC motors. LED2 to LED7 are indicators of motor operation. The DC motor driver supply voltage gets from main supply voltage through the main power switch SW1.

Motor output channel

IOIO-Q pin for direction control

IOIO-Q pin for PWM or speed control

#1 #2

1 and 2 4 and 5

3 6

#3 #4

8 and 9

10

11 and 15 16 and 17

12 13

18 and 19

14

#5 #6

Table 3-1 : IOIO-Q pin assignment for DC motor driver circuit 6 channels


28IOIO-BOT : Android Robotics

At IOIO-Q I/O-pin 25 and 26, they are assigned for I2C bus port for interfacing with 2wire communication devices. IOIO-RAB provides one of piezo speaker. It is connected with IOIO-Q I/O-pin27 via C7 capacitor In normal operation and in IOIO-BOT, user must plug the IOIO-Q board on top of IOIO-RAB. Plug the Bluetooth dongle at IOIO-Q’s USB connector. Apply the supply voltage to suitable battery connector. The operation from now is following the Android application that connected.

Figure 3-4 : IOIO-Q and IOIO-RAB connection. It is Android robotic activity board for IOIO-BOT


IOIO-BOT : Android Robotics 29

Chapter 4

Buiding IOIO-BOT

This is the first Android-controlled robotics kit. With IOIO-Q that the interface board for Android mobile device and IOIO-Robotic Activity Board (IOIO-RAB) and some mechanical parts; you can build and control the IOIO-BOT over Bluetooth or USB. The kits provides all parts and building instructions for everybody who interest to use Android mobile devices in Robotics ! The control application is free downloaded from Google Play Store. The Battery is not included.

4.1 IOIO-BOT key features  Control the robot movement by Android devices through a USB port (ADB) or wirelessly over Bluetooth. (Bluetooth control is recommended).  Powered by IOIO-Q board and IOIO-Robotic Activity Board (IOIORAB)  Moving by using 4 of 48:1 DC motor gearboxes and Spike wheels. All motor are controlled independent.  4 of Servo motor outputs. RC servo motor 4.8V to 6V is recommended.  +3.3V Analog sensor port 6 channels and +5V Analog sensor port 2 channels with 10-bit ADC resolution  Battery connector 2 types (Terminal block and DEAN connector for Li-PO battery). Battery voltage +7.4V 1000mAH or higher. Li-PO battery is recommended  Low battery indicator  Robot chasis is made from Aluminum anodize sheet


30IOIO-BOT : Android Robotics

4.2 IOIO-BOT part list

IOIO-Q x 1 ATX chasis x 1 Battery holder 5AA with wires x 1

IOIO-RAB x 1

Tamiya hub x 4 Spike wheels and tires x 4

BO1-48 DC motor gearbox x 4 Metal angle bracket 2x2 x4

Metal angle bracket 2x3N x4

Metal angle bracket 2x5 x4

Metal angle bracket 2x1 x4

3mm. nut x 30

3mm. Locknut x 2 3x32mm. metal Standoff x 2

2mm. tappinng screw x 4 3x6mm. screw x 9 3x10mm. screw x 12 3x25mm. screw x 8 3x20mm. thumbscrew x 2

Plastic nut driver x 1


IOIO-BOT : Android Robotics ď Źď€ 31

4.3 IOIO-BOT buidling (4.3.1) Spike wheel assembly : Insert spike tire to wheel. Do all 4 sets

Insert tire to wheel

Spike wheel and tire set

Insert 3x10mm. screw to hub

(4.3.2) Fix the hub to wheel by using 3 sets of 3x10mm. screws and 3mm. nuts. at the less depth side. Do the same for all four wheels. To tighten all screws and nuts recommended plastic nut driver can be more convenient.

Less depth side of spike wheel

More depth side of spike wheel

The spike wheel assemblied


32IOIO-BOT : Android Robotics

(4.3.3) Attach the metal angle bracket 2x3N with ATX chasis by using 8 sets of 3x6mm. screws and 3mm. nuts at the position following the picture below. The bracket is placed under the chasis and insert screw from top side through the hole of ATX chasis

(4.3.4) Mount the DC motoe gearbox at each bracket. The motor shaft is located to outside. Tighten by 3x25mm. screw and 3mm. nut only bottom hole first. Moust all 4 DC motor gearboxes.

Tighten the nut only bottom hole


IOIO-BOT : Android Robotics ď Źď€ 33

(4.3.5) Attach 2 pieces of the metal angle bracket 2x5 by using 3x6mm. screws and 3mm. nuts following the picture below. Do the same for 2 sets

back 3mm. nuts Front

3x6mm. screws

(4.3.6) Mount the assemblied bracket from step (4.3.5) with the DC motor gearboxes. by insert at the end of 3x25mm. screw at the top of gearbox. For stronger mounting, tighten 3mm. nuts both side; front and back.

(4.3.7) Flip over the chasis. Mount the battery holder by using 3x10mm. screws and 3mm. nuts

Flip over the chasis

Mount the battery holder at the center position


34IOIO-BOT : Android Robotics

(4.3.8) Insert the spike wheel with DC motor gearbox shaft. Tighten with 2mm. tapping screw. Do all 4 wheels.

(4.3.9) Insert the motor cables through the large hole beside the battery holder to the top of chasis. Fix the 3x32mm. standoff at the center groove following the picture below by using 3x6 mm screws. No need to tighten the screws because may move it later.

(4.3.10) Attach the metal angle bracket 2x2 with bracket 2x1 by using 3x6mm. screw and 3mm. locknut. No need to tighten because need to sway back to back.

Attach both bracket with screw and locknut


IOIO-BOT : Android Robotics ď Źď€ 35

(4.3.11) Attach the parts from step (4.310) with the robot chasis following the picture below. The position is oppsite with standoff. Next, mount the IOIO-RAB with both brackets by using 3x10mm. screws and 3 mm. nuts

(4.3.12) Connect the battery holder wires to IOIO-RAB at battery terminal. Must check the connection carefully ; red wires for positive pole and black wires for negative pole.

Red is positive (+) and black is negative (-)


36IOIO-BOT : Android Robotics

(4.3.13) Put 5 of AA battery into the battery holder. Possible to use Alcaline or Rechargeable battery. However possible to use the Li-PO battery pack. If using Li-PO battery pack, connection the battery to DEAN connector is recommended. (4.3.14) Place the controller board down. Adjust the board position to all holes position are match with standoff holes. Then tighten the controller boardwith robot chasis by using thumbscrews

Controller board’s holes must corresponding with standoff holes


IOIO-BOT : Android Robotics ď Źď€ 37

(4.3.15) Connect the motor cables as follows : Back right motor connect with M1 output - Red pole is outside and black pole is inside. Front right motor connect with M2 output - Red pole is outside and black pole is inside. Back left motor connect with M5 output - Red pole is outside and black pole is inside. Front left motor connect with M6 output - Red pole is outside and black pole is inside. Finally, plug the IOIO-Q board on the IOIO-RAB. Now IOIO-BOT is finished and ready for working with Android device !

Left side motors

Right side motors


38IOIO-BOT : Android Robotics


IOIO-BOT : Android Robotics ď Źď€ 39

Chapter 5

IOIO-BOT interface testing with Android device There are 2 cases for testing the interfacing between IOIO-BOT with Android device; via USB port using the microUSB cable and wirelessly over Bluetooth

5.1 Android device preparation Whether the connection with the IOIO-BOT of Android device will be wired or wireless. The Android device will have to prepare for supporting the connection before. The interfacing of both devices operate on ADB or Android Debug Bridge. The preparation of the Android device is divided according to the version of Android degvice that follows.

5.1.1 Android 3.2 Honeycomb or lower Enter to menu Settings > Application > Development. Tab to check mark at USB Debugging following the figure 5-1

Figure 5-1 : Example of how to enable the USB Debugging of the Android device that installed OS version 3.2 or lower


40IOIO-BOT : Android Robotics

5.1.2 Android 4.0 Ice Cream Sandwich or higher Enter to menu Developer options Tab to check mark at USB Debugging following the figure 5-2

Figure 5-2 : Example of how to enable the USB Debugging of the Android device that installed OS version 4.0 or higher


IOIO-BOT : Android Robotics ď Źď€ 41

5.1.3 Android OS that higher version 4.2 and cannot find the menu in step 5.1.2 Since the menu is hidden. Need to activate it by selecting Settings> About phone or tablet. Then tap the Build number 7 times. A message pops up that says the user is then developer. Back to the Settings page, the menu Developer options is appeared. Tap to select and do following the step in 5.1.2 topic.

Figure 5-3 : How to enable the USB Debugging of the Android device that installed OS version 4.2 or higher that hidden the Developer options


42IOIO-BOT : Android Robotics

5.2 Interfacing Android device with IOIO-BOT by using microUSB cable (5.2.1) Apply the supply voltage to IOIO-BOT. (5.2.2) Plug the microUSB cable between IOIO-Q and Android device. The cable does not supply power to the boar d IOIO-Q. But the IOIO-Q apply the power to the Android device instead. During connecting the Notification of Android device will inform charging battery and USB Debugging start following the figure 5-4. If no any notification, must back to check about enabling USB Debugging option again.

5.3 Interfacing Android device with IOIO-BOT wirelessly over Bluetooth (5.3.1) Plug the USB Bluetooth dongle to USB connectot of IOIO-Q on the IOIO-BOT following the figure 5-5. The Status LED will blink shortly at once. (5.3.2) At the Android device, select to menu Setting > Wireless and Networks > Bluetooth Settings. Tab to checkmark at Bluetooth to enable this option. Wait a moment, Android device will found the Bluetooth dongle in name start with IOIO and ID Bluetooth dongle. Next, pair this Bluetooth dongle. (See the figure 5-6)

Bluetooth dongle

Figure 5-4 : Notification about USB Figure 5-5 : Shows the IOIO-BOT that plug the Debugging of Android device USB Bluetooth dongle already


IOIO-BOT : Android Robotics ď Źď€ 43

Figure 5-6 : Procedure about paring the Bluetooth connection between IOIOBOT and Android device (5.3.3) In paring the Bluetooth devices require the pairing code. It is 4545. Type this code in the box and tap OK button.


44IOIO-BOT : Android Robotics

(5.3.4) If the pairing is successfully, the message Paired is appeared. However some Android device will show another message such as Paired but not connected. It also same meaning. Now the devices pair already.

5.4 Troubleshooting about Android device cannot found the Bluettoh dongle There are steps to resolve the problem. (5.4.1) Unplug the Bluetooth dongle from IOIO-Q board of IOIO-BOT. (5.4.2) Connect this Bluetooth dongle with computer instead. Before connect, must disable or turn-off Bluetooth deivce within computer first. (5.4.3) Try to use Androd device to find Bluetooth dongle again. If all correct, Android device will found the dongle with computer name. In the case of Android device used to connect to a Bluetooth of this computer before. User must cancel the paring first. (5.4.4) On Android device found the Bluetooth dongle, do not pair at thid time. Remove the Bluetooth dongle from the computer then plug to the IOIO-Q board. All steps in this section must be carried out continuously and apply the supply voltage to IOIO-BOT all the time. (5.4.5) Try to pair devices again. During proceed to pairing, the name of Bluetooth dongle still is the computer name. Until the pairing is completed, it will change the name to IOIO name later. In the figure 5-7 shows all steps of troubleshooting about Android device cannot found the Bluetooth dongle.


IOIO-BOT : Android Robotics 45

Figure 5-7 : Summary of steps about Android device cannot found the Bluetooth dongle troubleshooting


46IOIO-BOT : Android Robotics


IOIO-BOT : Android Robotics 47

Chapter 6

IOIO-Bot app for IOIO-BOT

With the features of the IOIO-Q board, it add input and output for Android device to interface the external electronics devices in real world application. The good library of IOIO also supports the controlling and reading with external devices. The developer do not required to write a program for microcontroller. Just develop an application on Android devices only. When used the IOIO-Q board with some mechanical parts and motor driver circuits are ideal for learning about simple robotics that control with Android devices wirelessly via Bluetooth. That is the origin of the IOIO-BOT; the robot controlled by Android device. The recommended applications about IOIO-BOT controlling that Innovative Experiment or INEX developed and explained in this chapter is IOIO-Bot application.

6.1 IOIO-Bot application overview The IOIO-Bot app that works with IOIO-BOT is running on the Android operating system from version 2.2 or higher. Download this app with free of charge at Play store by using keywords IOIO-Bot to search this application. The control method of this app is using a relatively flexible. Typically, the remote control of robot uses some button to control the movement directly. The problem of this method are difficult to adjust the speed and turn or change direction during moving. This app changes method to new concept. Use two of controllers to control speed and direction of robot’s motor side separately following the figure 6-1

Figure 6-1 : Layout of IOIO-Bot application. It looks simply and friendly using


48IOIO-BOT : Android Robotics

Figure 6-2 : Illustrate the motor controller joystick (or slider) separate left and right side of IOIO-BOT’s motor on IOIO-Bot app

6.2 IOIO-BOT movement control by IOIO-Bot app For motor control using slider in IOIO-Bot app helps to adjust the motor’s speed easy. The center position was selected for the motor stop. The top and bottom of the chosen choose maximum speed with opposite direction. When move slider to top; the IOIO-BOT will move forward and move backward if move slider to bottom position.

Figure 6-3 : Illustrate the speed and direction movement of IOIO-BOT when move slider on the IOIO-Bot app


IOIO-BOT : Android Robotics ď Źď€ 49

By controlling both motor operations separately, It causes many movement direction for IOIO-BOT. It also determines the speed during movement easy. See the summary of movement in figure 6-4

Figure 6-4 : IOIO-BOT movement direction control by IOIO-Bot app


50IOIO-BOT : Android Robotics

6.3 IOIO-Bot application - How it work ? About the operation of IOIO-Bot app should be explain as 2 parts. One is Android device operation and IOIO-Q operation. Refer the flowchart in figure 6-5 in explanation.

Figure 6-5 : IOIO-Bot app flowchart (continue)


IOIO-BOT : Android Robotics 51

Figure 6-5 : IOIO-Bot app flowchart (final)


52IOIO-BOT : Android Robotics

6.3.1 Android device operation The main function is displaying the slider of motor controller. The slider creation is not similar the commonly Button. Normally Button use Event Listener with OnClickListener type. It will be activated when users tap a button only. It does not response about sliding the button back to back. Then change to use Linear Layout instead. Normally using the Linear Layout is layout for placing the button or text. But in this app development use the Linear Layout to background area of the slider image. There are 2 images. One is background of the slider. Another is slider of motor controller image that move following the fingers touching. The slider image will be move within the Linear Layout only following the figure 6-6 For Event Listener that used with the Linear Layout is OnTouchListener. It activate when any touching screen is appeared such as user tap on the Linear Layout. It cause Listener active. Touching screen is called “Down”. In case user move the finger back to back after down, it is called “Move”. Finally, user lift the finger from screen. It is called “Up”. When Down and Move are happened, application will read Y position of touching and draw the slider or controller by using Canvas on the Linear Layout. Next, calculate the distance of touching point to center of Y axis of Linear Layout to speed value. The maximum speed is equal to 100. It is duty cycle of PWM signal of motor driver. For IOIO-Q, PWM determination is 0 to 1. Then divide the value by 100. If duty cycle is 50%, the PWM value for IOIO-Q is 0.5.

Figure 6-6 : Slider of motor controller image that used in the IOIO-Bot app


IOIO-BOT : Android Robotics ď Źď€ 53

In case Up condition, it is stop motor. It means IOIO-BOT have to stop. The duty cycle is clear to 0. The slider position is set to center of Linear Layout. The duty cycle value is stored to dutyLeft and dutyRight variable depend on touching side of controller. dutyLeft is for Left controller and dutyRight for Right controller.

6.3.2 IOIO-Q board operation For working with IOIO-Bot app, set the IOIO-Q I/O pins to interface with DC motor driver boards. For IOIO-BOT used only M1, M2, M5 and M6 output. The pin assignment is show below :

IOIO-Q pin

Variable in Code

Motor output

1 2

D1A D1B

1

3

PWM1

4 5

D2A D2B

6

PWM2

16 17

D5A D5B

13 18

PWM5 D6A

19

D6B

14

PWM6

2

5

6

To driving the motors, IOIOQ will check the value of dutyLeft and dutyRight variable. If more than 0, drive motors with forward direction. If less than 0 (or negative value), drive motors with backward direction. If equal to 0, stop motors in each side.


54IOIO-BOT : Android Robotics

6.4 Testing To test the functionality of the IOIO-Bot app and IOIO-BOT must connect via Bluetooth first. Then try to control the IOIO-BOT movement.

If the motors are not running, check the motor connection first. Make sure connection completed. Next, check the motor driver operation. On the IOIO-RAB has LEDs of motor direction status. Try to remove motor cable from IOIO-RAB and run again. If LED operate correct and do not work after plug the motor cable back to IOIO-BOT, It might be due to insufficient power. Check the battery or change if necessary. This is a collaboration of the IOIO-Q board, mini-TB6612 driver motor board and IOIO-Robotic Activity Board. It combines to the robot that controlled by Android devices via Bluetooth. It also supports the interfacing of many kinds of sensor. From now, the IOIO-BOT is ready for learning about Android application in Robotics, Electronic devices interfacing and so many.




Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.