Making a connection with Android device through USB

I'm trying to find a way to make a connection between a custom MCU-based device (accessory) and an Android device (smartphone or tablet). The goal is to exchange some data as with the old and good asyncronous serial (RS232/UART/RS485).

My goal is to let the user configure the device through its smartphone, without power up a laptop or using local HMI (that will be surely worse than Android HMI). Considering only the core functionalities of the device, I could use a simple AVR or the smallest among Cortex-M devices. I hope to produce at least 1000pcs, so the price is important.

I found some ways, maybe you can suggest other.

*Accessory is USB Host, Android is USB Device* This is the most compatible way. Indeed, old Android devices have USB device only port, so the only solution to make a connection is to develop a USB host on the accessory. At the same time, I think this is the most complex way (at least for me, that never developed embedded USB connections in the past).

Android released two reference designs that use this method: ADK2011 and ADK2012.

ADK2011 uses the simple ATmega1280 MCU with the MAX3421 USB Host controller (they are connected through SPI). MAX3421 is very specialized device and its price is very high. Maybe it is more convenient to make a custom cable with MAX3421 to avoid mounting it on every board, but the user couldn't use a standard USB cable for configuration.

ADK2012 uses a single MCU (ATSAM3X8E from Atmel, that is a Cortex-M3 MCU) with USB Host integrated peripheral. Of course, the source code is very complex and the MCU is much bigger than I need for normal use. I know SAMD21 (Cortex-M0+ from Atmel) has a USB Host peripheral: will be simple to port ADK2012 source code for ATSAM3X8E to SAMD21?

*Accessory is USB Device, Android is USB Host* This should be simpler for accessory development, but I will lost the compatibility with many Android devices that don't support USB OTG, hw or sw (my 1-year old smartphone from Samsung doesn't have USB OTG).

There are many low-end MCU with USB Device peripheral. Do you know some reference design that shows how to communicate with Android USB OTG port?

Any other suggestions?

Reply to
Loading thread data ...

Use an FTDI chip, and get a terminal program for the Android that's compatible. I use "FTDI UART Terminal" (guess what market they were aiming at!)

This means you can only use USB OTG phones, but it also means you can use any old microprocessor, and you don't have to mess with USB beyond licking the back of the chip and sticking it to the board.

Tim Wescott 
Wescott Design Services 
 Click to see the full signature
Reply to
Tim Wescott

FT311D is a USB host controller that simplify Android connection. However I think its price is higher than a simple USB-RS232 converter.

Reply to


Bluetooth support is pretty common on smartphones/tablets - how about using an HC-05 module on the MCU side?

--------------------------------------- Posted through

formatting link

Reply to

Il 17/05/2016 13:38, srl100 ha scritto:

Yes, it is a possible solution.

Two drawbacks are.

Price: HC-05 modules costs about 6USD, a simple MCU with USB Host could be lower than 1USD (Atmel SAM D11, for example). However with USB I need a 5V power rail (at least 500mA, because USB host should give power to the phone) that I don't need for other uses (I only have 12V and 3.3V). With Bluetooth I could save some money for the additional 5V power rail.

Usage: the user should enable Bluetooth on his smartphone and should pair his phone with the Bluetooth module on my device. I think he should write a PIN to allow the Bluetooth pairing. I know, it is very simple, but I know the non-technical user will forget the PIN and will find some other difficulties. What happens after pairing the first time? Should the user search again my Bluetooth device, or is it discovered automatically as soon as the Bluetooth is activated on smartphone? With USB I think the user should only connect the cable: the associated app on Adroid is automatically opened... no more.

Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.