Connecting using USB


From the main screen, click on Connect and then on USB to enter the USB connection screen.

USB OTG

To connect to an external device you will need an On The Go (OTG) cable to plug into the USB port of your Android device. At the other end of the OTG cable will be one (or more) full size USB sockets in which USB cables can be plugged in linking directly to your project.

usb OTG cables
Example of using an OTG cable to connect to a device (in this case a micro:bit).


USB to Serial Chip

To communicate over the serial usb connection, your project will need a chip capable of usb to serial conversion. Most development boards have USB to serial built in, for example the Arduino UNO has a ATmega16u2 USB to serial chip included on the board.

If not built in or extra USB to serial connections are required, USB to serial breakout boards can be used. These breakout boards all have RX, TX, GND and Voltage connections, and possible extra connections for a second voltage or flow control. The connection arrangement will vary between these boards. The USB to Serial chips also have different protocols of how the USB is configured to allow for serial communication. Therefore, whilst most USB to Serial devices used in hobby electronics (e.g. those in image below) will work with this app, there may be some USB-serial devices that wont work.

USB to Serial breakout boards
Mega16u2, FTDI, CH340, CP2102 and PL2303 USB to Serial Breakout boards.


Discover

On the USB connection screen, with your USB device plugged in, tap Discover. The app will discover any attached USB devices and list them on the left of the screen. Select the device you want to connect to and continue.

Results

After the Android device has performed a scan and discovered any attached USB devices, tapping Results will open up a detailed list of the properties of the discovered devices. This information is only there for those interested/curious, and can be copied to the clipboard ready for pasting in another application if required.

Connection Settings

Interface - Within each usb device, there are multiple interfaces, some of which have bulk transfer in and out end points that are used in serial communication. Only these interfaces can be selected for connecting to. The app will automatically select the most appropriate interface with suitable endpoints for serial communication.

Chip / Method - Manufacturers implement serial communication through USB a little differently. Serial communication without flow control has been implemented for a range of usb to serial chips. The app will automatically suggest the appropriate chip/method to use based on the vendor of the chipset determined from the USB scan.

The following settings may not be available to all chip/methods:

Baud Rate - The baud rate can be set at a range of speeds from 300 up to 921600 bps. Make sure it matches that set in your project. Suggest starting always at 9600 baud, 8 Data Bits, No Parity and 1 stop bits, and then go on from there.

Data Bits - Set the number of data bits to use as 5, 6, 7 or 8.

Parity - Set Parity to None, Odd, Even, Mark or Space.

Stop Bits - Set Stop bits to 1, 1.5 or 2.

Connect

Once a usb device is selected with suitable characteristics, and any settings changed as necessary, we can click connect. The top status bar will show that we are now connected.

Once connected, click back, or done to return to the main screen where the Run button should now be enabled and you can test out your project.

To disconnect, just connect to another device, pull the usb cable out or close the app.

Once connected, click back, or done to return to the main screen where the Run button should now be enabled and you can test out your project.