Pages: [1]   Go Down
Author Topic: Arduino on Android  (Read 2716 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 11, 2012, 07:22:51 am by fulminator » Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

You are welcome.

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: http://www.hobbytronics.co.uk/magician-android-bluebots.

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

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.

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.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 158
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 158
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: