loading

Hi,

in this Instructable I want to show you, how you can program your Arduino with your Android device. It is very simple and cheap. Also it allows us to program our Arduino where ever we want, this is usefull for permanently installed Arduino boards, like in light controllers...

So lets get started! :)

Step 1: Materials and Tools

Materials:

A USB-A to USB-B cable ( http://www.amazon.de/AmazonBasics-USB-2-0-Kabel-A-... )

A USB-Host cable (OTG cable) ( http://www.amazon.de/USB-OTG-Adapterkabel-Adapter-... )

An Arduino( http://de.farnell.com/ )

1 LED (for testing)

A Android device with Android 4.0.0+ (or with host aviability)

Software:

ArduinoDroid or

ArduinoCommander from the Google Play store

Step 2: The USB-Host Cable

Such a USB-Host cable is basicaly just a USB cable, but just with a few changed resistors in the mikro USB plug. The internal resistors let the Android device activate the USB-Host mode, in this mode you can also use USB-Sticks or other usb applications on the device. That is very useful, now you could plug a usb-printer in.

The problem is now, that every USB device which you plug in, will now run on the energy of your device, what realy can bring the akku down.

Step 3: Connections

This step is very simple and doesn´t require much text. Just plug the USB-A to USB-B cable into the female USB of the Host cable. Then plug the USB-B plug into the Arduino and the Mikro USB into the Android device.

Step 4: Arduino Power Up

Now it should look like the connections on the picture. Also your Arduino should now power up and load the last code you uploaded. On my Arduino was the Blink sketch. If it doesn´t power up, check connections.

Step 5: The Apps

Now your Arduino is ready to get coded, but your Android device isnt...

Lets change that!

Currently there are 2 apps which allow us to work with our Arduino via the Host mode.

To get them we have to go to the Play Store, then type into the search bar "Arduino". Now tap on "Apps", now there should be only apps. We want the apps "ArduinoDroid" and "ArduinoCommander". Install them and launch "ArduinoDroid", it has to update the IDE, that will need some time. "ArduinoCommander" should be ready promptly.

Note: We dont need both apps, i just want to show you both! :)

Step 6: ArduinoCommander by Anton Smirnov

Okay, the first app I want to show you is "ArduinoCommander". It is by Anton Smirnov and is for Andorid 2.2 or higher.

https://play.google.com/store/apps/details?id=name...

This app is for working with the Arduino on an Android device, you can change pins easy (directly set pins hight or low), upload sketches or read analog pins with a oscilloscope mode.

The app is easy to understand, even if the controlls are unusual. It finds the Arduino automatical and doesnt crash.

But sadly some of the functions didnt work when i tried to use them, hopefully that get fixed. Uploading a sketch worked very good!

So I would give this app 4.0 out of 5 stars :)

I want to show you short how you can connect to the Arduino:

Step 7: Step 1

First we have to start the app, now a blue window wih 4 options should appear. As we want to connect via USB we tap on "USB-Device" (on the picture in german :) ).

Other options are:

Ethernet

Bluetooth

USB-extras

Step 8: Step 2

Now tap on "Autodetect", the Android device will now scann for Arduino(s) nad show them on the screen. We will pic our Arduino ( just tap on it ).

Step 9: Step 3

After we did that the app will now show us our Arduino as a drawn animation. Normally it is colored and you can tap the pins, to change their mode. This didnt work for me, sadly i couldnt fix it for me, maybe it works for you. when you tap in the down right corner you get to the menu, where you can upload sketches from your SD-card, what works very well.

Step 10: ArduinoDroid

Now the seccond app, which allows us to upload sketches to our Arduino. This app is called "ArduinoDroid" and is for Android 4.2.2 or higher. It is also by Anton Smirnov!

https://play.google.com/store/apps/details?id=name...

This app is an IDE, a compiler and an uploader for Arduino, it also uses the host mode to upload sketches, which you can write directly in the app.

After you wrote a code, you can compile it with the "Lightning-Button", that needs some time, but works good.

when its compiled you can press the upload button (the to the right).

The upload should take only secconds.

After that my Arduino started the new code --> It worked very good!

For testing I used the "Blink" sketch.

Why am i talking?! here is a short video of the app compiling and uploading a sketch:

Step 11: Finishing!

As you just saw, it is very easy to write, compile and upload a sketch to an Arduino with an Android device.

And here a big THANK YOU to Anton Smirnov who created the apps for Android!

https://play.google.com/store/apps/developer?id=An...

Thank you for reading!

Feel free to comment and to visit my other websites!

Your Jan Henrik

www.janhenrik.org

www.facebook.com/janhenrikhemsingfotografie

<p>i have a few old android devices kicking around, i plan to connect one and see what happens. you have a touch screen, accelerometer, GPS, compass, many built in sensors on just your average smart phone. could be a powerful combination. thanks for posting and fueling the fires of imagination :-)</p>
<p>That Idea is awesome, I guess i have to try it too! I think compiling apps with Processing and combine that would also be great!</p>
<p>there is a processing app in the google playstore. (why they ever changed it from the Android Market, i have no idea ;-) )</p><p>an update, i did connect my android device successfully to an UNO, a Micro, and a 3.3 volt ProMini thru an FTDI cable. they all worked flawlessly.</p><p>i can't stand going thru TSA security, so i leave as much stuff home as possible, especially my laptop. i bring a RPi and a few other gadgets to keep busy, and now, thanks in part to your instructable, i have one more toy to play with and still leave my laptop behind!</p>
<p>Youre welcome :p</p><p>I didnt know, that there is a Processing app, sounds awesome.</p><p>I meant the Android Compiler in the newest version of Processing, I already compiled a few apps for my mobile phone, they all work great!</p>
<p>To not drain power from phone, get one of these:</p><p><a href="http://routerboard.com/5VUSB" rel="nofollow">http://routerboard.com/5VUSB</a></p><p>plus 5V 2A supply.</p>
<p>Awesome, Thank you!! :)</p>
<p>Works great, awesome! This helps a lot in changing values during competitions.</p>
<p>Nice! :)</p>
<p>Can we unplug the usb and add an alternative power supply after uploading the code</p>
<p>Does clone audino uno works with Android?</p>
<p>Hello, this is my first arduino project: sending a file (jpeg, pdf, txt)<br> from an arduino sd card module to android phone using arduino uno and <br>bluetooth module HC-05<br><br>have you any suggestion about the android app to receive the file ?<br>thank you</p>
I working with samsung galaxy j7 with lollipop but the arduino commander doesn't recognise the arduino uno board. Pll help me
I love the Instructable! I have tried a couple of Android programs a few years ago, maybe even one of these, but I tend to write Arduino code that requires external libraries and span multiple files and it never worked out. This is an excellent solution for smaller, simpler sketches. For those who are a little tech savvy but can't get their phone to talk to your Arduino, try this along with a 9v battery and a plug adapter: http://makezine.com/projects/diy-arduino-bluetooth-programming-shield/<br><br>You should be able to upload via Bluetooth, though i haven't tried it myself yet.<br><br>This is outside the scope of this Instructable, but I just picked up a cheap ($65 on sale at Fry's) Windows 10 tablet and installed the Arduino IDE directly onto it. It's shortfall, being so cheap, is no USB except for charging, so I'm going to make that Bluetooth shield to program it with, but it'll be just as portable as the solution presented here.
<p>i used OTG many many times with keyboad and the mouse so i know it works fine , but the Arduino i'm having a problem , when i connect the Board with my android phone via OTG , the Arduino lights up and but in the phone i can't find it , when click on ''discover devices &quot; , it tells me no devices however the arduino is lighting and working ..<br>So how do i fix this ? how i make the phone detect the arduino board in the Arduinocommander App ?? <br>thank you </p>
Same problem here. OTG Cable plus LG G3 plus Mega 2560 ch340g but no fucking connection. I also tried with external power supply but no communication possible.
sir i am using an marshmallow version of lava pixel v1 and when i connect arduino uno board to my mobile the arduino lights was on but arduinodroid and arduino commander do'nt find the board .<br>i am ising mouse and keyboard with my mobile they work fine ....
<p>i'm having the same problem , did you find any solution ?</p>
<p>arduino uno original? It serves a device ch340?</p>
I tried but it doesn't work because my phone doesn't have otg support, is there any other way to use. I'm using micromax yuphoria
did the arduinodroid and arduino commander support android marshmallo version
<p>error: return code is not zero or something like this, what can i do? thanks</p>
<p>Hi, does your phone have OTG?</p>
<p>yes, I am using keyboard and flash disks</p>
<p>okay, meh</p>
<p>can i use it with Arduino Due? if so, can i make the phone get the readings of a sensors and manipulate it as i want??</p>
<p>Not by now, but it is planned</p>
can I do it on<br>Android laptop?
<p>I think so</p>
OK<br>thanks<br>jan
Thanks for your instructables. It was good and very helpful for me.Thank you.
<p>You're welcome :)</p>
<p>Ok I have a bit of a problem with my arduino because its a clone with CH340G chip.</p><p>I need a suitable driver for android, do you know about any? Thanks for replies</p>
Hi, have you solved your problem? I'm in the same situation with my dcduino, i cannot upload to board...
Hi, I still haven't solved my problem :(
<p>Damn!!!</p><p>I'm trying android driver for ch340 that i've found <a href="http://www.wch.cn/download/CH341SER_ANDROID_ZIP.html" rel="nofollow">here</a> but at the moment I haven't solved too...</p>
Are you using a nano so I am using a uno which I should buy ch340 or 16u2 plese answer
<p>ch340 should work, 16u2 I dont know.</p>
<p>No, sorry, I dont know any drivers for android, doesnt it work with Arduino Droid?</p>
I am using a arduino R3 at mega 382p and ch 340 G is their diffrences between 340 G and 340 please answer<br>
<p>I don't know, but the IDE supports the 340G chip</p>
Are you sure that it will work because sometimes it crashes<br>
<p>as you just said, it works.</p>
Which is the correct ch 340 or 16uc
<p>Hi, very cool instructable, but one question. What if the Arduino board draws too much current or if I accidentally short circuit something? I don't want to damage my phone!</p>
<p>Well, that's a good question, the USB-port should shut down automaticaly, but I am not 100% sure, if you mobile phone will do that. </p>
Does it work with any otg cable? I everything up with the otg cable and the USB a to b. I hooked it up to a moto e running on kitkat 4.4.4. I didn't download the app yet. But the arduino didn't turn on(the built in LEDs didn't turn on). Is it a problem w my otg cable? Or do I need the app first?
<p>Which device do you have, sometimes, they dont have an OTG mode or they dont turn it on... There is only 1 type of OTG kable, so that should work...</p>
I have the moto e. it isn't a tablet but it should work with a phone right?
Only moto e second generation 4g LTE phone SUPPORT OTG.
<p>Yea, most new phones have OTG, but sadly the Moto E doesnt support otg :/</p>

About This Instructable

397,760views

1,197favorites

License:

More by Jan_Henrik:How to 3D-Print multicolored obejcts Photography How to make a diffusor for your LED Matrix 
Add instructable to: