Arduino on Android

Hello there. I was wondering if I can connect my Arduino Leonardo on my phone, it's a Galaxy mini 2. I did a little research on the internet and I found out that actually I need an USB host port, and phone usually do not have such.

Then, I tought of an Android Tablet, there are very cheap ones on the market, around 100$. They have USB host ports, because they work with wi-fi USB sticks. I want to buy one, but I want to be sure, IT WILL WORK?

Are there any drivers on Android? I read the main site and it doesnt says anything about android. If Android wouldnt recognize my Leonardo, can I upload the program from my PC, and then only power the Leonardo from the tablet? Will program run?

edit: ty for moving this topic. I am new to the forum and I didnt know where to put it.

There are many different ways to connect an Android phone/tablet to Arduino. It depends on what you want to do, whether you are going to do custom programming on the Android system and/or program the Arduino from the phone. At present, I haven't done this myself, but I'm starting to look at my options (I have a Galaxy S-II). Some of the ways to communicate include:

  • USB -- you can get a USB adapter that plugs into the mini-USB charging port that provides a full USB host connection on the phone (but you won't be able to power your Arduino with it, so you would need to use the 2.1mm power jack). I just bought this adapter on ebay, and I'm awaiting delivery (http://www.ebay.com/itm/330776357336?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649). It probably depends on whether the Arduino can be programmed to act like a particular USB device. I pay for tethering on my phone, and I hope to use the cable to allow my phone and my Raspberry Pi to do full USB networking, but that is probably too complex for the Arduino
  • Wifi -- you would need a wireless shield to connect to the phone via wifi. However, unless you pay for the mobile hot-spot mode, I'm not sure whether wifi would work in an area that doesn't have a wifi infrastructure setup
  • Bluetooth -- you would need a bluetooth adapter on your Arduino. I suspect this is may be the simplest approach.
  • Headphone jack -- The phone has a 3.5mm headphone jack for music, and some programs use that to talk to a device. I have an app called triggertrap, and evidently they needed to engineer a special dongle so they could use 3.5mm jack.

Ty for your reply. Sincerely this was the most specific and clear answer in my 1 week ardui o career. Ty.

I am trying to control a dc motor from old cd rom with an arduino leonardo from my phone. I will be using a simple html page with a javascript script which i will copy on my phone. I have a galaxy mini 2 with android 2.3.

The reason I was thinking about using a tablet it is because on arduino mirc channel people told me i need a usb host to connect the arduino, but never crossed my mind wireless connection.

My question is: what do you think of this? Is it feasible? Which is thw simplest aproach, bluetooth? What is the optimal choice, wifi?.

fulminator:
Ty for your reply. Sincerely this was the most specific and clear answer in my 1 week ardui o career. Ty.

You are welcome.

fulminator:
I am trying to control a dc motor from old cd rom with an arduino leonardo from my phone. I will be using a simple html page with a javascript script which i will copy on my phone. I have a galaxy mini 2 with android 2.3.

Bear in mind, as I said before, I haven't actually done anything in this regard. I just had been looking it up recently.

I tend to think that is over-kill having to setup html pages, etc. Given bluetooth, you should be able to load a bluetooth control app on the phone, talk directly to the arduino without having to create an html page and then parse the output. It looks like the bluebots app might be what you want.

Here is the page for the bluebots app: https://play.google.com/store/apps/details?id=blue.bots.free.matt&hl=en

Here is a tutorial from hobbyelectronics.co.uk which is evidently selling an Arduino workalike called the magician, and it uses bluebots to control things: Bluebots, Bluetooth, Android and a Magician.

You can get bluetooth adapters for about $15 on ebay.

fulminator:
The reason I was thinking about using a tablet it is because on arduino mirc channel people told me i need a usb host to connect the arduino, but never crossed my mind wireless connection.

My original android phone (LG Optimus T) did not have the capability for creating USB host devices. My new phone (Galaxay S-II Hercules T-mobile) just requires a $10 cable. As I said previously, I've ordered the cable, and I'm awaiting delivery. This is another option, but I don't know the details yet.

fulminator:
My question is: what do you think of this? Is it feasible? Which is thw simplest aproach, bluetooth? What is the optimal choice, wifi?.

The answer is it always depends. If the android and arduino are going to be close by and you don't need to send megabytes of data through the bluetooth connection, I would think bluetooth. The downside is the range you can communicate is not as great as wifi.

If you go wifi, due to the larger range of the radio signals, you will drain the batteries faster on both the phone and arduino (if the arduino is not plugged into the wall). As I said, if you go the wifi route, you likely have to have software to mimic a web server. However, with wifi, you could easily talk to the device via a laptop. You could talk to the device with bluetooth on the laptop, but you would likely have to have some sort of communication program.

The other solutions I mentioned involve wires, which of course are problematical if you can be physically adjacent to the arduino.

I should mention for completeness I've thought of three other ways to get the Android phone/tablet to communicate with the Arduino. None of them is what I would choose to use, and I present them more for amusement value.

  • You could program the Android to flash the screen different colors and have a color sensor on the Arduino to respond to a particular sequence;
  • Likewise, you could program the Android to emit a particular sound, and have some sound sensor waiting for a particular tone, such as the DTMF tones used for dialing on wired phones;
  • And silliest of all, put a motion sensor on the Arduino and attach it to the phone, then have the phone go into vibration mode to tell the Arduino to do its thing.

fulminator:
Hello there. I was wondering if I can connect my Arduino Leonardo on my phone, it's a Galaxy mini 2. I did a little research on the internet and I found out that actually I need an USB host port, and phone usually do not have such.

Then, I tought of an Android Tablet, there are very cheap ones on the market, around 100$. They have USB host ports, because they work with wi-fi USB sticks. I want to buy one, but I want to be sure, IT WILL WORK?

Are there any drivers on Android? I read the main site and it doesnt says anything about android. If Android wouldnt recognize my Leonardo, can I upload the program from my PC, and then only power the Leonardo from the tablet? Will program run?

edit: ty for moving this topic. I am new to the forum and I didnt know where to put it.

Take a look at ArduinoCommander android app:
https://play.google.com/store/apps/details?id=name.antonsmirnov.android.arduinocommander

It support connection over USB, Bluetooth or Ethernet, no additional drivers are needed. Most features are free, some have evaluation limitation and costs couple of bucks.

Also you can use ArduinoDroid - Arduino IDE on Android:
https://play.google.com/store/apps/details?id=name.antonsmirnov.android.arduinodroid