Is it possible to communicate an Android application with a PIC microcontroller by the serial port? What phones of low cost can I use?
Sorry by my englisg, I'm from Colombia.
Not sure about PIC, but Arduino might be a good reference point and has a Android coupler called Amarino. Good luck.
Yes it is possible to communicate an Android application with a PIC microcontroller via Bluetooth also. Check that post here every thing written so descriptive and i test the code, they are given, it simulate in proteus.
http://www.nbcafe.in/interfacing-android-with-pic-microcontroller-via-bluetooth/
Well, it is indirectly possible via Bluetooth, that is for sure. As Peter Chuang stated, there has been some work done for interfacing Arduino boards and Android phones in the past. The exact same methodology can certainly work with a PIC microcontroller.
All you need is:
A PIC, preferably with an hardware UART to simplify coding (else software UART routines exist all over the net);
A Bluetooth serial module. An example of one would be the RN-42/RN41 from RovingNetworks (which is the basis for many Bluetooth adapters you might find on Sparkfun and other hobbyist-catering electronics stores)
An Android phone with Bluetooth.
I have actually tested such an interface myself, with a PIC18F26K22 linked to a RN-42 module, both being powered by a 3.3V linear regulator (MCP1700 3.3V). It is nearly plug and play, with baud rates easily achievable if in the low range (9600 baud and 19200 baud). As for higher baud rates, it is also possible if the PIC is clocked by a stable oscillator in the MHz range, and if the baud rate chosen corresponds to a USART BSEL register value that results in a close baud rate match between the 2 devices (which is possible because the RN-42 allows custom baud rates).
As for coding Bluetooth using Android SDK, it is a straightforward task using Google's own Bluetooth classes (BluetoothAdapter, inter alia)...
Microchip now has a PIC 24F based board that uses the Android Open Accessory (I think that's what AOA stands for) protocol over the USB port. You can buy the board (called the Android Discovery Kit or ADK) from Microchip. I believe both the Android software and the PIC software are inside the current Microchip PIC software libraries down load package.
Of course if you want to go open-souce you can go out and get the IOIO board. I believe that board uses a slightly different PIC 24F processor. And it may be using the Android debugging protocol instead of the newer AOA protocol. I think it depends on what version of the IOIO board you get. Also, I think the IOIO board can play host to either the Android (like the ADK does) as well as some (not all) bluetooth USB dongles.
You will have to "roll your own code" based on the example Android ADK code from Microchip. However, with the IOIO board, you can download a library of methods that you can call. The library abstracts the PIC features to the point of simply typing IOIO... into the Eclipse editor and having it come back with a list of matching methods. Or so I understand.
Yeah it is possible. You need to use Bluetooth chip which talks over Bluetooth SPP.
e.g. I used CSR-BC417 for more info Link to info of Bluetooth Chip
Micro-controller talks to Bluetooth chip using UART AT commands.
On other end you already have Android App like Bluetooth Chat where you can see the data coming from micro-controller and respond to it.
Download Android App
It is possible, i was using my Android smartPhone to send orders to a PIC microcontroller, you can use Bluetooth or WiFi hardware and the UART of the PIC, for example with de HC-06 bluetooth module or the Microchip's RN171XV WiFi module
about the app, i'm using this one:
https://play.google.com/store/apps/details?id=com.vagoscorp.virtualterminal
it's free and have a lot of working modes
for example instead of sending 123 as a character string '1' '2' '3', you can send it as a byte (byte value can be 0 up to 255), letting you to save and use directly the data as a number in the microcontroller ;).
You can see the received information as characters and/or bytes too (character 'A' have a byte value of 65, that's ASCII code, '1' will be 49)
I hope it will help you
Yes you can connect it. The best or easy way to connect is use HC-05 Bluetooth module. It is cheep and a loot of tutorials available make a google serch HC-05 interface pic.
Another way if you want connect through usb to serial converter you need to develop usb to serial driver or you can use a usb to serial converter chip that supports linux Driver and make a android application with these driver. If you are not a expert, I suggest to use hc-05 Bluetooth. It is a better option.
Related
I am new to using the RPi and just got the A+ model which I have been using to generate different types of data from external sensors. I was wondering if it is possible to send this data it is gathering to an android device in real-time, and if so the best method? I want to be able to notify the user (through a an app made with the Ionic framework) when the data enters a particular range etc.
And also is it possible to do this whilst the user is walking around with both the devices in hand?
The short answer to the question is: Yes, you can ;-)
The longer answer is much longer, since there are many ways to do this.
The one I personally would choose as the simplest is classic Bluetooth (not LE) using the SPP profile, which basically makes the BT link a serial connection between the RPi and the phone.
On this serial link you invent you own streaming protocol suitable for the data you want to transfer.
On the RPi side you install a module such as this: https://www.sparkfun.com/products/12577
(There are many alternatives, but the RN42 module is very foolproof...)
Don't know the level of your hardware skills, you might need something more plug and play if you feel uncomfortable hooking up the 4 wires needed for 3.3V power and serial communications between the Pi and the BT Module...
On the phone side you install https://github.com/don/BluetoothSerial, which gives you an API reachable from Ionic where you can receive the BT data stream.
With that and a bit of coding on both sides you are good to go.
I've used a Raspberry Pi in combination with an Android smartphone & Lego NXT.
Communication was achieved using Bluetooth on Raspbian. I used a cheap $1 USB Bluetooth dongle. The Bluetooth stack had to be compiled for Raspi, which may not be necessary anymore. Steps can be found here: Bluetooth error: Native Library bluecove_arm not available
Bluetooth seems most logical to me.
I'm at work at the moment, hence the lightweight answer, if you'd like to discuss this further then please leave a comment and I'll be happy to provide more verbose response.
You can upload the data to any cloud services. You can use Xively/Box. Xively is specially made for real time data collection.
To connect RPi to Xively, refer this: https://xively.com/dev/tutorials/pi/
For Box, refer this: http://www.sbprojects.com/projects/raspberrypi/webdav.php
You can then use Xively API in your android app. You can see GitHub for this
Google app store already has some apps for you, if you want to use
It might look a little complex. But its really simple once you follow the above methods.
My company wants to develop an Apple or Android app to tackle with an external sensor device, lets say the temperature of milk via a temperature sensor. The external device is tbd and currently under investigation, could be using a connector or WIFI or Bluetooth.
Do we need to apply for Apple MFI program to get access to the protocols used for that?
Since we do not want to implement the external device, i guessMFI license is not needed. But where do we get ressources to learn how to connect?
For Android you could do this using an Arduino Module
You can do this using Bluetooth / WiFi as your need!
Then make an Android app and communicate with the Arduino Module to get your data via Bluetooth / WiFi
For Ios/Apple
A Plus side of using Arduino
You can use Arduino for Iphone As Well as For Android
How? here you go ----> http://www.raywenderlich.com/38841/arduino-tutorial-temperature-sensor
If you really need to Know the temperature of milk via a temperature sensor here is a Full Tutorial
Which uses a Temperature sensor to find the Temperature and Query it to your Iphone
1 All the Requirements are given.
2 Cost Of all the parts with links
3 Source Code is also provided
4 Working
5 Circuit Diagrams
6 Step by Step Guide to code
7.Libraries are provided
8 Everything needed is provided for free (Software part)
Know everything About Arduino http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCsQFjAA&url=http%3A%2F%2Fwww.arduino.cc%2F&ei=K344UpiFCo2yrgfXi4CACQ&usg=AFQjCNENSvy_VhDmp9YsE0x0X702I5teeQ&sig2=utVrSYYIMBFAFStVGq--RQ&bvm=bv.52164340,d.dGI
Tutorials :-
http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&cad=rja&ved=0CFEQtwIwBA&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkS5C5Xhsv24&ei=g3w4UrDcLsOQkQWA44DQAQ&usg=AFQjCNHED0FWP8FpK29uEnUzxDeyh6751g&sig2=2rfcYp4Zqx5dt-KVri5sfw&bvm=bv.52164340,d.dGI
http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&cad=rja&ved=0CFgQtwIwBQ&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DY9R5O0mbvME&ei=g3w4UrDcLsOQkQWA44DQAQ&usg=AFQjCNHSbk25-B0KJTejgr4QewfK5aNivw&sig2=YZCyYJb_AVmvgmXVoAWLLw&bvm=bv.52164340,d.dGI
http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCsQFjAA&url=http%3A%2F%2Fblog.arduino.cc%2F2013%2F07%2F09%2Flet-your-arduino-talk-to-your-android-phone-without-any-android-programming%2F&ei=g3w4UrDcLsOQkQWA44DQAQ&usg=AFQjCNHRdHAkS8MBau7hN3Bv5HtN-fvU0A&sig2=lboevloczOpc28XwVM9cmQ&bvm=bv.52164340,d.dGI
http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDMQFjAB&url=http%3A%2F%2Fforum.arduino.cc%2Findex.php%3Ftopic%3D168329.0&ei=g3w4UrDcLsOQkQWA44DQAQ&usg=AFQjCNGQE5LOB60XfXmuiJdNYbIxqAqgJw&sig2=yk3dGNYeUOitvr6a4S8DkQ&bvm=bv.52164340,d.dGI
Just to expand a little more on Metalhead's answer. If you go the Arduino route, you will need to buy an Ethernet Shield or a Wifi Shield to use Ethernet or WiFi respectively. You can use Bluetooth if you are close enough to the sensor; you will still need to buy a Shield
One advantage of using the Wifi or Ethernet Shields is that you can use MQTT to remotely monitor your sensors over the Internet.
You can also look into a Raspberry Pi. It has more processing power than the Arduino and it comes with a built-in Ethernet card. If you are a Java programmer, you can install Java in a Raspberry Pi; you can't in an Arduino.
Android also gives you the option of using Android Open Accessory if you want to communicate and control the Arduino using USB or Bluetooth. You will have to be connected to the board directly via a USB cable (if using USB to communicate) since it needs the 5V from your phone to operate.
As a part of feasibly study. I need to choose between Android or iOS for integrating it with an embedded system.
Basically, that embedded system will have an AVR or a PIC Microcontroller. I want to establish a communication between a mobile and that particular system.
Need some wireless technology for communication (bluetooth,wifi,internet etc..)
Micro Controllers have communication ports like UART, USART etc..
It really depends on the kind of communication you need.
I particular, if you have a normal WIFI connection and your controller can work with receiving & sending your data via wifi, you may go iOS or Android.
If however you need some kind of free format serial communication, you need to go Android, serial cable via USB.
recarding other factors, I guess it really is just a personal taste issue.
Could you give more info on how & what needs to be communicated and what kind of communication device you have between your phone and the device itself.
Not sure if this is similar to what you have in minde, but you might look at this: http://www.arduino.cc/ being probably the best known example in this context.
Using some serial to bluetooth module would be the most easier to implement.
I would go with Android unless your target audience are photographers. Seriously. Also, with iOS you need to be careful. For instance you want to use BlueTooth, but not all iOS devices will connect to, say, the Bluetooth protocol for a keyboard. (Ah! You didn't know there were more then one Bluetooth protocol did you?) And I don't think any iOS device will let you connect using the Bluetooth serial port protocol.
With Android you can jump in and start flying immediately by using the (or a copy of) the PIC 24F based IOIO board. And if you are an Android / Eclipse developer (I think) you can down load and use the IOIO JAVA / Android libraries. I have been told this makes programming the IOIO board just about as easy as programming an Arduino. Especially if you are well versed in JAVA, Android and the Eclipse editor. Add to this the IOIO board can be a host to the Android (i.e. connected by wired USB) or host to some Bluetooth modules (i.e. connect to the Andoid's bluetooth radio).
If you don't want to go it along you can buy the Microchip Android Development Kit (ADK) board which is also a PIC 24F based "USB wired" using AOA protocol to connect to an Android. I say "not going it alone" as I would expect you can then get limited support from Microchip w.r.t. their hardware (the ADK board), software (Android) and firmware (PIC ADk board). This solution, however, does not have built in Bluetooth support. I am guessing you can add it, it's just not part of the ADK software/firmware that Microchip put together.
I am new to embedded programming and I am given a project to establish Bluetooth communication between an Android tablet and an ARM development board with Bluetooth capabilities.
Please tell me whether this project can be done or not ??
If it can be done then how should I approach it ??
Thanks
Check out this page: http://www.amarino-toolkit.net/
They are using the arduino board with a bluetooth component to connect to android. You can check the source code of their library to see how they establish and use the connection here:
http://code.google.com/p/amarino/
If what you want is a simple and robust communication method over Bluetooth then SPP is definitely the way to go.
The only issue could be the bandwidth, but if the throughput of a traditional serial cable connection is enough for your application then there certainly won't be any problems there. IIRC then most modules have > 1 Mbit throughput using SPP.
Some information about using SPP on Android is here.
But we need a little bit more information to give suggestions about what you need to do on your ARM kit. Maybe you could post a few details about its type, which Bluetooth module is in use there, how it is connected to the ARM MCU etc.
If you're lucky then your kit's BT module can function as a serial cable replacement and you can treat it as if the Android device is connected to your MCU's UART. Of course prior to that, some configuration is needed over some interface (could be the same UART, depending on module type) to establish a Bluetooth connection.
Oh and to answer your first question: yes, it certainly can be done :)
I haven't worked with Android to ARM board via bluetooth but I have done some work communicating between an Android device and an Arduino using bluetooth. I tried to document what I learned in a series of examples. There are several that might be helpful.
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-basic-bluetooth.html
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-turning-led-on-and.html
http://digitalhacksblog.blogspot.com/2012/05/android-example-bluetooth-simple-spp.html
The first two examples show how to setup communication via bluetooth from an Android device to an Arduino with a bluetooth board. I would expect that to get some initial connectivity between the Android and the ARM the Android side of things would be the same.
The third example shows how to setup a simple spp client and server between an Android device and a PC running windows.
Hope this helps.
I have a android tablet, i need to read raw data from any device(which supports rs 232) into my android tablet and display it in a rich text box inside my app. My android device should act as the host.
Thanks
http://blog.350nice.com/wp/
managed to run the ADK in an Arduino with a USB Host Shield controlling a servo or LED
im posting some good links u can refer..i personally found interesting..
http://code.google.com/p/android-serialport-api/wiki/android_to_rs232_guideline
http://sven.killig.de/android/N1/2.2/usb_host/
http://www.engadget.com/2011/05/10/google-announces-android-open-accessory-standard-arduino-based/
http://www.arduino.cc/
http://blog.makezine.com/2011/06/19/adventures-in-android-adk-development-hardware/
You need to get "FlexSerial" cable., getting the Tab to communicate with the RS232 cables in the right way may be tricky. The flex serial cable is certainly a start but the function you are looking for is probably very specific to the device you want to control so finding the right Android app will not be easy. Just out of curiousity, what device is it?