Working Android with Arduino [closed]

2019-03-09 18:09发布

问题:

Has anyone tried to make Android and Arduino communicate with each other?

I found a couple of projects online:

  • Amarino
  • Android-Arduino

What do you guys suggest is the best way to make those two communicate?

回答1:

Either build a serial cable for your Android phone, like this one for the G1, http://www.instructables.com/id/Android-G1-Serial-To-Arduino/.

Or add a Bluetooth module to your Arduino,

or use an Ethernet-shield for your Arduino and connect via TCP/IP.

Which one to use depends on your project and your budget. I don't know if the serial cable option exists for phones other than the G1. The Bluetooth module has the advantage of beeing wireless for both, the Arduino and the phone, and using the Ethernet-shield you could make the Arduino worldwide accessible by using port-forwarding on your firewall.



回答2:

I've been working with Amarino since they started and I haven't had a problem since. However I have no experience with other projects since I have only worked with one.

These are my two favorite opensource devices though. Way to go with not joining the iPhone band wagon. It really pleases me when there is someone who takes the initiative to go far and beyond, because it shows that your thinking about the long run. Most people don't.



回答3:

A solution to this is to make the Arduino act as USB host and have it talk the Android Debug Bridge (ADB) protocol. This works with any stock, unrooted Android device. More information here:

code.google.com/p/microbridge



回答4:

Your options seem to boil down to connecting the two using a serial interface, or via Bluetooth (I'm guessing you'll either need a Bluetooth shield or something similar). There are many resources on the Internet dealing with setting up Arduinos with both of these.

You may also be able to set up some sort of basic server on the Arduino and be able to interface the phone to it via a console, or through a specially defined interface on the phone, or even a web based interface. There seem to be a fair few robot designs being controlled by Android/Arduino maybe have a look at these.

Without some more ideas about what you intend to do once they're linked it's difficult to be more specific, although if you root your Android phone you will be able to install a cut down version of Debian on it, and then you will be able to apt-get install various packages. With this in mind, there becomes little difference between connecting your Arduino to a computer and connecting it to your Android phone.

[EDIT]: If nothing else you could make an Arduino based one of these: Android Controlled Statue.



回答5:

I heard someone talking about this before and they were trying to do it via USB but they stated the problem with it was Android does not fully support USB Host. If that is the only issue it seems like it should be easy enough to port over the USB host drivers?!?! Maybe I am simplifying it to much.



回答6:

I liked Nikolaus answer. I think the best way to connect is writing a TCP/IP server in the Arduino (Example can be found easily on the internet), and using or the Ethernet Shield (~10U$S) or the Wifi Shield(~10U$S). The TCP/IP server for both solutions uses the same code, the only difference is the INIT.

Mobility: If you need you Arduino to be on the move, buy the Wifi shield.

Static: IF you are static, and only want to control from the Android phone, use the ETH shield (Lower cost).

Adrian