Arduino Programming With a Transformer Prime Tablet

The Arduino is a popular micro-controller platform that do-it-yourselfers use in all kinds of portable, embedded projects. I’ve used them for a few years and have always sought ways to make them more versatile and easier to use. Sadly, it’s a pain to lug around a notebook to program the darned things.

Life may have just become more pleasant.

Arduino connected to Transformer PrimeArduinoDroid lets you program the Arduino using a Transformer Prime tablet. The program has been out a couple of months, so I thought it might be interesting to give it a whirl. In this article we’ll cover how to get the application running and discuss how you can use the setup to program your projects. Even better, you don’t need a PC or notebook to get everything working.

Gather All the Parts

Before proceeding, you’ll need to collect a few things.

I used an Asus Transformer Prime model TF201 with Android 4.1.1. Connecting the Prime to any Arduino board requires an Asus USB adapter. An authentic Asus adapter goes for about $14 on Amazon. A USB to wired TTL serial cable, to connect the Asus adapter to the Arduino Pro series board was needed, too. I bought a TTL-232R-5.0V cable (to match my 5.0 volt Arduino Pro) from Adafruit for about $ 20. If you’re using 3.3 volt Arduinos, get the 3.3 volt version of the cable. I was able to program an Arduino Duemilanove exactly once. After that, I received only an “uploading error: unknown error” message. I haven’t yet resolved the problem as of this writing. If you choose to try ArduinoDroid with an Arduino Duemilanove, Uno or any of the USB connector-based boards, you’ll need a standard A-B USB cable.

For today’s discussion, I’ll stick with the Arduino Pro and TTL cable.

Make sure the Transformer is fully charged, then plug the Asus adapter into the connector at the bottom of the tablet. Plug the USB cable into the adapter and connect the other end to the Arduino board. For me, the adapter/USB cable combination is a little clunky and not the best solution. An in-line adapter and more flexible cable would work wonders, so maybe a bit of cable hacking is in order.

Next, go to Google Play and download/install the ArduinoDroid app on the Transformer Prime.

Put the Program To Use

After everything is connected and able to get to the Web, start the ArduinoDroid app on the tablet. The program will immediately download and extract the SDK containing AVR Dude, applicable libraries and other support software. There should be 100 megabytes or so of available space for those files.

The ArduinoDroid editor starts as an empty file with line number 1 appearing in the upper left part of the screen. You can start entering an Arduino sketch, from scratch if you’d like. The program also includes quite a few sample sketches, so take a look there if you’d like to jump start your programming efforts.

Next, touch the little vertical-box icon in the upper right corner of the screen to bring up the options menu. You’ll find selections for Files, Edits, Sketch Commands, Settings and Help.

If you have existing sketches, either in the old .pde or current .ino formats, load them from the ~/ArduinoDroid/sketchbook directory. Sample Arduino sketches are found through the File menu and under both Examples and Libraries Examples selections. Load your chosen sketch using the File menu.

Editing with the Transformer takes a little getting used to. At first, it’s a little frustrating, but keep at it and you’ll get better. I like to move the cursor around the editing screen and use the backspace keys to remove characters, and then type in my modifications. Fortunately, most Arduino sketches start with existing or sample code and you just have to tweak it to your needs. The banner ad can be eliminated by buying the app.

When editing is completed go to the Sketch menu and hit Verify/Compile. The process steps of editing, compiling, and uploading to the Arduino are exactly the same as on a notebook.

If the code compiles, it must be right. Right? It compiled, therefore it is. (Old joke… sorry… couldn’t help it.)  Any coding errors will show up at the bottom of the edit screen with line numbers indicating their locations.

To upload the code, navigate to the Sketch menu and hit Upload. A “Choose Board Type” screen may appear. Since I was using an Arduino Pro with the ATMEGA328 chip, I selected the Arduino Duemilanove w/ ATmega328 board.

The program is pretty straightforward in its operation. A couple of cool additional features include color text highlighting and support for multiple Arduino boards. If you’ve used the Arduino interactive development environment on a notebook, using the ArduinoDroid program will be similar in operation.

A Few Challenges

The application solves a major portability problem when working with Arduino projects. It’s not without its challenges, though.

You’ll need a separate serial monitor if you want to interact with your Arduino through the Transformer Prime keyboard and screen. I used Android USB Serial Monitor Lite. Until external monitor apps are integrated into ArduinoDroid, you’ll have to multitask a serial monitor with the program. That leads to another adverse situation.

I noticed that the Transformer doesn’t always close the USB port when switching between the monitor and ArduinoDroid app. As a consequence, uploading to the Arduino occasionally fails. The only solution I found was to unplug the cable and reboot the Transformer. Uploading would then, once again, work properly.

It’s also prudent to keep an eye on battery life on the Transformer, since the Arduino draws power over the USB port. I could run a 16 MHz Arduino Pro with a couple of nano-sized servos for a couple of hours without problems.

Lastly, using the Asus USB adapter also prevents charging up the tablet using the regular Asus USB cable. Programming Arduinos using the Transformer definitely lends itself to short-term, mobile/portable operations, at this point.

Gazing Into the Future

I couldn’t verify that the ArduinoDroid app works on other Android platforms, since I don’t have an on-the-go cable for my Galaxy S3 super phone. However, my prediction is that we’ll see more applications like ArduinoDroid appear as the Arduino and Android communities mature. Tablets and super phones are clearly the future of mobile computing, certainly for programming-embedded devices, and I’m happy to see this trend advancing as well.

Feel free to share your own experiences with ArduinoDroid in the comments below.

One Response to “Arduino Programming With a Transformer Prime Tablet”

  1. Justin F

    I found Arduinodroid a week ago and quickly installed it on my tft300 with docking keyboard. Its a very slick setup because there is a physical keyboard and massive battery. Another feature it has is a full size usb port. It makes my tablet pretty decent replacement for laptop, which I gave up on, because it was massive, heavy, and had terrilble batterylife.