How to deploy arduino ide code to Android app? - android

I want to make my arduino UNO pin 13 to be high when user clicks on button. I have used arduino blink template .program runs fine from my computer. But I want this program to work on Android phones too. Is there any way to do this?
Thanks in advance

It is not possible this way. You can't run arduino code on Android, However you can code android app to communicate with arduino through USB or Bluetooth.
To do this you will need arduino shield, or USB OTG cable and USB TTL converter.
In my app I use usb, so here is basic example what you have to do:
Download some serial usb library, I use this one:
http://felhr85.net/2014/11/11/usbserial-a-serial-port-driver-library-for-android-v2-0/
You need android device that supports USB OTG and USB OTG cable.
Connect USB to ttl converter using usb otg to android
Connect usb to ttl converter to arduinos serial port(must be hardware serial and must connect GNDs).
Run the app and send some data.
Receive data on arduino and do your action
Edit://
It is probably easier to do with some arduino shield designed to communicate with Android, however I didn't use such shield, because I needed qucik and cheap solution.

Related

How can i communicate Android device with using com port?

I am working on Android project using Qt and i need to communicate between mobile phone and computer. I want to make little demo with using Putty.I want to send data mobile phone over USB cable and display on Putty to ensure communication. When i search Serial port on mobile phone const QList<QSerialPortInfo> &info = QSerialPortInfo::availablePorts(); info.count() is equal zero. Application can not find any serial port on mobile phone but i can send or receive data (drag and drop) over USB cable. How can i communicate to Android device with using Serial Port?
Thank you for answers..
Not many mobile phones that come with a native serial port as far as I know.
If what you mean is you have a USB serial port connected to your mobile phone through an OTG cable maybe you need to take a look here. There is also an app on the Play Store based on the same code.
I have discovered what i did wrong. The phone does not support OTG feature, so i could not see serial port by using qt serialport library. If anyone faces this problem, i hope this works for him/her.

Sending serial data from android to a PICAXE microcontroller with usb cable

I am working on a project that including an android phone that sends simple serial messages to a picaxe microcontroller(14m2) like '1','2','a' etc.
I searched alot on the web, and I only found a way that the android smartphone first "connecting" to the device and "discover" it, the problem is that PICAXE microcontroller is NOT a 'USB' device, and it can't be discoverd by the android, that means the android will not be able to send serial messages to the PICAXE.
if theres any way to send simple pulses from android to PICAXE, please let me know about it.
EDIT: There's any way to do that by connecting the AXE027 download cable with OTG?
I do some project with communicating over serial port. You can use chineese bluetooth adapters (see on ebay arduino bluetooth), those communicate with controllers via Usart and connect to phone by bluetooth. There is sample project Bluetooth chat from google about how to use bluetooth on android. On hardware iside, you can use arduino for receiving data by bluetooth and converting it in format of your controller. You wont have to use any wires

Android: RS232 Serial Communication with android device

I have a MR400s taximeter hardware. I want to communicate with this taximeter using RS232 cable and I have already achieved this connection and communication in windows. But I wanted to make connection using android device.
How can I achieve this?
Thanks
Ishan jain
I use the USB to serial library, you can find it here: USB Serial for Android.
It doesn't require any root access. You'll need to check if your Android device supports USB host mode. Then, using a usb OTG cable and a USB to serial adapter cable you can start communicating with your serial device via RS232. There are code examples to get you started on the Github page of the USB to Serial library.
An alternative to a cable connection to the Android device (using the "USB Serial for Android" library, see the other answer) is a converter from RS232 to Bluetooth.
Such a converter will use the serial connection profile of Bluetooth, and ways access such a connection in Android are discussed in this question.
You can build such a converter based on an Arduino by adding a Bluetooth shield and simple code that converts incoming data from the serial port to outgoing data on the Bluetooth connection. (I could not find detailed instructions for this right now.) When you want to connect the Arduino's serial port to a RS232 device you would need another shield for logic level conversion (RS232 is ±12 V, Arduino is 5 V or 3.3 V).
There is also a commercial product implementing this Photologic Text Streamer (ca. 265 USD !!!). It seems that this provides a read-only connection for Android (not totally sure about that, though). A read-only connection is still ok for cases where you only want to read sensor values.
Finally, you could do a similar thing using an Arduino and a wifi shield.

How to communicate via modbus RTU on android through micro USB port?

For the project i am working on i have a slave device that communicates using modbus protocol. All i need to do is be able to read the holding registers on the device via modbus RTU. The device has an RS485 output. I have already purchased an RS485 to usb converter cable that include an FTDI chip. And also a usb to micro usb cable to connect that to the tablet. So far i have been able to write a simple java program in netbeans to connect through the usb port on my laptop and read data from the holding registers on the device. So i do not have a problem with communicating with modbus.
The problem i am having is with sending the modbus communication through the micro usb port. My tablet is set up as a host, and i have been able to recognize that a device is attached. I am also able to connect to the port that the device is attached to. Im just getting very confused on how to use the micro usb protocol to send modbus communication over. The code i have for modbus on my laptop just needs a port number to communicate through, but i dont think it is that simple with an android tablet. I have been going through this http://developer.android.com/guide/topics/connectivity/usb/host.html and understand for the most part what is going on, but i cant figure out how to use this information to send modbus communication over. any help would be great!

Direct serial port connectivity from arduino to android for data communication

Using Arduino I can get the sensor values logged into the serial monitor over the USB cable...
Is there any way that I can read these values directly on an android tablet by connecting a usb convertor(So that I can tramnsmitt it via GPRS to a server Db)...Please give my some solid directions...
You can do it wired if you use a FT232 or CP2102 converter. Here are a couple apps on the Google Play store that act as a serial monitor.
USB Serial Terminal
Slick USB Serial Terminal
One thing to note is that wired USB communication with Android is not very common, so you may run into some problems depending on the phone you are using. If you want a more guaranteed solution, look into an Arduino Bluetooth module that supports SPP - Serial Port Profile. You can connect the Arduino's RX/TX pins to the Bluetooth module, and have it communicate with the Android device over a wireless Bluetooth serial connection.
Also, here is a similar question on SO, however the answer may have outdated information regarding using the wired solution.
How to make Android and Arduino communicate without a wireless module

Categories

Resources