Pages: [1]   Go Down
Author Topic: Graph to Android  (Read 1477 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2310
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://www.jerome-bernard.com/blog/2011/11/15/bluetooth-communication-between-an-arduino-and-an-android-phone/

Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 108
Posts: 3786
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 06, 2013, 11:33:11 am by ericnickel » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 108
Posts: 3786
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: https://code.google.com/p/ketai/
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)
http://prof-takaya.blogspot.com/2013/02/connecting-android-and-arduino-by.html

Code:
#include <softwareserial .h="">
didn't work for me.  i had to change this to:
Code:
#include <SoftwareSerial.h>

Code:
SoftwareSerial mySerial(10, 7); // RX, TX
I have my BT chip tx/rx pins coming into 0 and 1 on my arduino.
Code:
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.
http://2.bp.blogspot.com/-pnK3I1l-Qhw/T_wf75kTbwI/AAAAAAAABkA/mRFDJ93tpbw/s1600/Arduino+Bluetooth.png
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)
« Last Edit: November 02, 2013, 11:30:18 pm by sakotturi » Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 108
Posts: 3786
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 48
Posts: 2310
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: