Graph to Android

I would like to to learn how to take the simple Arduino/Processing graph example and send it to my Android using a blue tooth connection. For the life of me I can find examples that work. There is always some compile error in the Android processing IDE when I try them. I have the btserial library installed w no luck. The sweet blue library didn't compile. Bluetooth desktop didn't seem to work.

There has got to be a very simple way for the Processing sketch to read the incoming sensor data over bt and graph it on my phone. I have been able to pair my phone and the bt device with Amarino. The Amarino, Eclipse graph example worked for me but Eclipse is too complicated for me at this point. I'm embarrassed to tell you how long I've been looking for a solution to my simple problem.

Thanks in advance.

No need to be embarrassed. I have more or less given up. I have three phones that can see the Arduino but none can talk to it. None are Android but my tablet is ICS and it doesn't want to talk either.

You might find this link useful.

Just to give a heads up, amarino sucks. I tried it myself and didn't get anywhere until I wrote my own eclipse program/app. I got it to work and i was able to send data to and from the arduino. Try the Bluetooth chat program, that's where I started.

I was hoping it would be as simple as replacing the 'import processing.serial' with a bluetooth command.
Not that easy huh?

Thanks for the link Nick. I have used that example and it works perfectly on my phone but the Eclipse environment is a bit over my simple head at this point. My ultimate goal is to put some sensors on a go kart and use Processing to build a digital dash. I just need a simple way to get the Arduino data to the Android via BT.

Thanks guys.

There are simple BT codes for android, you just need to find them. I might still have mine, but I'm not home right now.

Not sure if you're still looking for a way to get data on android from arduino via bluetooth but I recently endeavored to do and have some working examples.

First and foremost, check out the ketai library for processing: Google Code Archive - Long-term storage for Google Code Project Hosting.
Second and almost more importantly, check out the android processing project: http://wiki.processing.org/w/Android
You can now compile Processing sketches into android.apk's
(i presume you have Processing installed, if not, do so and play around with it)

then this blog covers some code that works with a couple changes (see below)

#include <softwareserial .h="">

didn't work for me. i had to change this to:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 7); // RX, TX

I have my BT chip tx/rx pins coming into 0 and 1 on my arduino.

SoftwareSerial mySerial(0, 1); // RX, TX

Other than those two things, everything else works. Installed the arduino sketch onto arduino.
Then ran the processing code, it compiled into an apk and installed & then ran on my phone.
note: im using this BT, JY-MCU v1.06. got it for $10 on amazon.


note2: notice the tx from the BT goes to RX on the arduino and viceversa.

note3: it will take a number of hours to:

  • download processing + get familiar.
    installing the android sdk, take the time to do this properly, check your API levels to make sure it'll run on your device
  • reading up on android + processing
  • I recommend the book: Rapid Android Developement as it goes over the Ketai library in depth
  • figuring out how to get all the processing libraries in the right place, ok this isnt too hard..

have fun and hope this works out, i have to say its been a head trip but pretty rewarding. Ketai + processing~android is an awesome combo.

EDIT this is also a good tut on how to test the BT on the arduino can send data to your laptop via the built in arduino serial port window. (just make sure you load your sketch onto the arduino over the usb serial port, for me that something like /dev/tty.usbmodem.... AND then change that in the serial port monitor to the BT serial port, something like /dev/tty-BtDeviceName)

If your using pins 0 & 1 why bother with software serial, and not just use regular serial? Software serial allows the user to send data serially and still use regular serial for debugging.

Since this has been resuscitated:

My ICS tablet still won't talk to Arduino but it now works fine with a bluetooth keyboard. This is the only success I have had with it.

I have since bought a new phone, a cheapo Huawei 210. It works perfectly with Arduino using BlueTerm.

Yes, that's right. the phone is so good I bought the abovementioned keyboard to go with that, so I can leave the tablet at home.

There is an app called Bluetooth Graphics. I have not yet tried it but it looks quite promising.