arduino - android communication

Hi to all,
I am trying to make a smart home with an arduino mega, an Ethernet shield and an android smart phone.
So far i have found 2 ways, one is with a web server on the arduino, but i do not like this solution because i dont want a web page, a want an android app that does what i want.
The other is with socket, but i think it is deprecated.
Is there any other way? Do you have any suggestions?

Thanks!!!!!

Hi,

Web server doesn't mean you HAVE to have a web page. Basically, web server allows you to command Arduino via HTTP POST requests. For example, if your shield is set up at 192.168.1.1, you can turn your lights with the following request: http://192.168.1.1/?lightson.

You can enter it as an URL in any web browser, or use as a part of Tasker (that an automation app for Android) profiles and, ultimately, scenes. That allows for building your own standalone automation app, though Tasker is not a free app.

Sockets could be more secure, but as long as nobody knows what commands you use, you are completely safe.

I used Bluetooth on multiple occasions for arduino/android communication. It's not too difficult if you use the Amarino toolkit. Here are some of my projects (the second link is a smart home project, like you mentioned):

http://will-forfang.squarespace.com/mobile-ekg/

http://will-forfang.squarespace.com/home-automation/

And here is a link to the amarino toolkit:

http://www.amarino-toolkit.net/index.php/home.html

If you decide to go down this route, let me know if you hit any roadblocks. I'd be happy to give you pointers, insomuch as I'm able. :slight_smile:

I think it is better to look for the most suitable Android programme and make the Arduino decision based on that.

There is a raft of stuff available both WiFi and Bluetooth and the decisions are based on how remote you want to be. The Ethernet shield isn't going to be much use unless it is connected to a router or a WiFi repeater, and the same applies if you use Bluetooth. You may need to consider a network like NRF24 whereby the Android just talks to the base station.

you need to write a socket app based on what you are talking? if its putting in and out HTTP commands then just use get and put ,I have done all this already on my youtube channel winacro

I have written an inexpensive www.pfod.com.au for Android that makes it easy to control Arduino from your mobile.
pfodApp supports bluetooth and wifi/internet. You add 128 security to the wifi/internet connection.
See this instructable for a quick start

and

Coding on the Arduino side is small text strings which completely control what the Android mobile displays.
See www.pfod.com.au for example projects. You can also plot data from your Arduino.

Let me know if you need any help get it running.

corrected web link to www.pfod.com.au

Hi..
Is there any project about the NFC exchange data (possibly P2P) with an Android's smartphone?
Could arduino mega adk (for Android) be advised for these purposes???
I found two shields that perform NFC:

  • Adafruit PN532 NFC/RFID
  • NFC Transceiver Shield V2

I do it like this:
https://www.cs.helsinki.fi/u/ljlukkar/wot/

It's a webserver running on arduino but you get to choose the connection method from serial (bluetooth), ethernet and wifi and they all can be used with an Android phone.

drmpf
Can I use my own bluetooth module on a protoboard & connect that to UNO? Can't see any mention of a wiring schematic. Obviously I don't want to need to use your specified bluetooth shield if I have my own existing bluetooth components.
Regards

Can I use my own bluetooth module on a protoboard & connect that to UNO? Can't see any mention of a wiring schematic.

Yes you can use your bluetooth module on a protoboard and connect that to the UNO ,offcourse your blue module needs to support your protoboard by using a breakout board.

The wiring depends on what your bluetooth modules communication methodology is?

rbright:
drmpf
Can I use my own bluetooth module on a protoboard & connect that to UNO? Can't see any mention of a wiring schematic. Obviously I don't want to need to use your specified bluetooth shield if I have my own existing bluetooth components.
Regards

Sure, just wire the bluetooth module up the TX/RX. A couple of points to note. TX goes to RX and RX goes to TX and if there is a CTS and RTS pins connect them together. Finally check the voltage. Many Bluetooth modules only take 3.3V inputs.

see How to connect an Arduino Uno to an Android phone via Bluetooth – 42 Bots for an example of the wiring.
In the sketch make sure you write to the Serial you are using.

Email me via www.pfod.com.au if you need more help.

There are several Android application that works with Arduino over Ethernet, let me suggest you the one developed into an opensource project were I'm involved in :slight_smile:

SoulissApp
https://play.google.com/store/apps/details?id=it.angelic.soulissclient

You can load the relevant library on your Arduino, in a couple of minutes you have your Android controlling your Arduino.
http://code.google.com/p/souliss/

It is a complete system, so you can have multiple boards (not only over Ethernet, but also wireless or USART).

Regards,
Dario.

Android commander is also one of those

spch:
You can enter it as an URL in any web browser, or use as a part of Tasker (that an automation app for Android) profiles and, ultimately, scenes. That allows for building your own standalone automation app, though Tasker is not a free app.

Have you found a way to communicate between Arduino and Tasker? I'd like to connect Arduino with my Android phone via bluetooth and use Tasker to trigger and send commands to Arduino.
Is this already done?

Hi All,
Just published a free Android app, pfodDesigner (https://play.google.com/store/apps/details?id=au.com.forward.pfodDesigner), that lets you interactively create and preview custom Android menus to control your Arduino project (via bluetooth or wifi/internet) and then generate the required Arduino code to serve up the menu, via pfodApp, and handle the returned commands.

No Andriod Programming is required.
You only need to add the action code for each button to the generated Arduino sketch.

The menu designer lets you set colours, font sizes, styles and number of buttons etc. and gives interactive previews of the current design.
Here is a example menu design. See pfodDesignerV3 for a full tutorial and www.pfod.com.au for example projects

Latest version pfodDesigner generates code for Arduino 101 / Genuino 101, and latest version of pfodApp connects to BLE modules.