Offline
Newbie
Karma: 0
Posts: 24
|
 |
« on: January 27, 2013, 08:16:49 pm » |
i have a budget of about 60-70ish dollars. i want to make a project where the Arduino takes the info from the sensors connected into the arduino, but i want to send that information to an android smartphone. The project also needs to be small, and i dont need that many pins in the arduino. what do you think is the best arduino and best way to do this?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 28
Posts: 1551
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #1 on: January 27, 2013, 08:46:23 pm » |
I used a JY-MCU Bluetooth slave module to get my robot to work with an Android tablet. However you can also use Wifi, to do the same. Look at the Bluetooth chat program.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #2 on: January 27, 2013, 09:39:38 pm » |
will it work with the arduino pro mini? or arduino lilypads? is there any setup required or is it plug and play type thing?
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 28
Posts: 1551
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #3 on: January 27, 2013, 11:36:45 pm » |
It should just be plug and play, mine was, aside from the pairing.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Toledo, OH
Offline
Sr. Member
Karma: 15
Posts: 407
|
 |
« Reply #4 on: January 28, 2013, 12:49:44 am » |
i have a budget of about 60-70ish dollars. i want to make a project where the Arduino takes the info from the sensors connected into the arduino, but i want to send that information to an android smartphone. The project also needs to be small, and i dont need that many pins in the arduino. what do you think is the best arduino and best way to do this?
I paid $8 for a bluetooth connection to my Android phone. http://rctimer.com/index.php?gOo=goods_details.dwt&goodsid=764&productname=Works perfectly. Tim
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #5 on: January 28, 2013, 08:12:40 am » |
Ok thanks  sho you know if our works with the Arduino pro mini? Because that's the board I want to use
|
|
|
|
|
Logged
|
|
|
|
|
Toledo, OH
Offline
Sr. Member
Karma: 15
Posts: 407
|
 |
« Reply #6 on: January 28, 2013, 05:14:58 pm » |
Ok thanks  sho you know if our works with the Arduino pro mini? Because that's the board I want to use It will work with any Arduino. Tim
|
|
|
|
|
Logged
|
|
|
|
|
Durham UK
Offline
Full Member
Karma: 1
Posts: 159
aka Craig Turner
|
 |
« Reply #7 on: February 04, 2013, 05:22:44 am » |
Hi teckel,
do you have any code examples of how to get this working with arduino and android?
cheers
|
|
|
|
|
Logged
|
Craig Turner, blog: http://gampageek.blogspot.co.uk/ It helps with my learning if I write things down, esp. for others to follow (constructive comments welcomed to improve)
|
|
|
|
Ayer, Massachusetts, USA
Offline
Edison Member
Karma: 27
Posts: 1095
|
 |
« Reply #8 on: February 04, 2013, 08:20:07 am » |
Hi teckel,
do you have any code examples of how to get this working with arduino and android?
cheers
Most of the bluetooth modules that you can buy have 4-6 pins (Rx, Tx, Power, Ground, and optionally Key, State). You hook Rx up to a port that does serial input, Tx up to a port that does serial output, Power and Ground to their respective rails, and State up to a LED if you want an indication of the connection. On your pro mini, you might connect Rx to pin 0, Tx to pin 1, and use the hardware serial port using the Serial function. You could use other pins with the software serial port emulation. On my Teensy 3.0, I'm using pins 7 & 8, which on that chip is the 3rd hardware serial port. Here is some quick and dirty code that I was using to test my HC-05 bluetooth serial device on my Teensy 3.0. I have 4 LEDs hooked up to pins 13, 12, 11, and 10. I use a single character command: - 'a' .. 'd' turns off the respective LED;
- 'A' .. 'D' turns on the respective LED;
- '*' turns on all of the LEDs;
- '0' turns off all of the LEDs;
- '.' and ',' introduce delays.
#include <stddef.h>
const int leds[] = { 13, 12, 11, 10 };
#define NUM_LEDS (sizeof (leds) / sizeof (leds[0]))
void setup (void) { size_t i;
Serial3.begin (9600); Serial3.print ("Start\r\n"); Serial3.flush ();
for (i = 0; i < NUM_LEDS; i++) { pinMode (leds[i], OUTPUT); digitalWrite (leds[i], LOW); } }
static int number = 0;
void loop (void) { if (Serial3.available ()) { char ch = Serial3.read (); if (ch >= 'a' && ch < 'a' + NUM_LEDS) digitalWrite (leds[ ch-'a' ], LOW);
else if (ch >= 'A' && ch < 'A' + NUM_LEDS) digitalWrite (leds[ ch-'A' ], HIGH);
else if (ch == '.') delay (1000);
else if (ch == ',') delay (250);
else if (ch == '0') { for (size_t i = 0; i < NUM_LEDS; i++) digitalWrite (leds[i], LOW); }
else if (ch == '*') { for (size_t i = 0; i < NUM_LEDS; i++) digitalWrite (leds[i], HIGH); }
number++; Serial3.print ("Bluetooth number: "); Serial3.print (number); Serial3.print (", read: "); Serial3.write (ch); Serial3.print ("\r\n"); } }
I happen to use the "Connection Terminal" app on the phone that provides a simple serial terminal interface: https://play.google.com/store/apps/details?id=app.bluetooth&hl=en. I also tested the BTInterface trial app as mentioned in this thread: http://arduino.cc/forum/index.php/topic,145241.0.html. One thing to watch out for is whether the device you buy can operate at the voltage your pro mini runs at (5v or 3.3v). I bought my unit from a US seller on ebay (nyplatform) for $11US, and the app on the phone was free. There are various other bluetooth apps on the phone.
|
|
|
|
« Last Edit: February 04, 2013, 08:34:18 am by MichaelMeissner »
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 28
Posts: 1551
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #9 on: February 04, 2013, 08:29:20 am » |
A simple code you can try is already provided to you in the Android examples, BlueToothChat. That is the same program I used to get started with, until I was able to break it down to what I needed, to make my own test app.
Get that code, pair the BT module and use a simple arduino code to toggle an LED on and off with "H" and "L".
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
Durham UK
Offline
Full Member
Karma: 1
Posts: 159
aka Craig Turner
|
 |
« Reply #10 on: February 04, 2013, 09:59:08 am » |
Thanks for the input guys
I'll get myself one of those devices and play with it.
cheers
|
|
|
|
|
Logged
|
Craig Turner, blog: http://gampageek.blogspot.co.uk/ It helps with my learning if I write things down, esp. for others to follow (constructive comments welcomed to improve)
|
|
|
|
Toledo, OH
Offline
Sr. Member
Karma: 15
Posts: 407
|
 |
« Reply #11 on: February 04, 2013, 10:15:55 am » |
Hi teckel,
do you have any code examples of how to get this working with arduino and android?
cheers
It seems others have taken care of this for you. They're right, you just treat it like a standard serial connection. You need to be running some sort of app on the other end (like a terminal emulator on an Android). You could then expand that to a mobile app. I've only done Android apps, but I'm sure you could do the same with the iPhone/iPad. Tim
|
|
|
|
|
Logged
|
|
|
|
|
Ayer, Massachusetts, USA
Offline
Edison Member
Karma: 27
Posts: 1095
|
 |
« Reply #12 on: February 04, 2013, 12:37:35 pm » |
Hi teckel,
do you have any code examples of how to get this working with arduino and android?
cheers
It seems others have taken care of this for you. They're right, you just treat it like a standard serial connection. You need to be running some sort of app on the other end (like a terminal emulator on an Android). You could then expand that to a mobile app. I've only done Android apps, but I'm sure you could do the same with the iPhone/iPad. Tim From what I've read, iphone apps are a little bit more tricky, since the iphone bluetooth will only connect to bluetooth devices blessed by Apple, and in order to be blessed by Apple, the developer needs to pay a hefty fee to be licensed as an Apple developer. In terms of Android apps, I just download the Bluetooth Controller App, which gives you 9 buttons that you can label, and these buttons will send a particular text message to your device. For my usage, that is sufficient, since I just want a simple replacement for an IR remote control, and it is a lot simpler than a chat program that you enter in text, and hit a send key. https://play.google.com/store/apps/details?id=apps.BT&hl=en
|
|
|
|
|
Logged
|
|
|
|
|
Toledo, OH
Offline
Sr. Member
Karma: 15
Posts: 407
|
 |
« Reply #13 on: February 04, 2013, 04:00:13 pm » |
Hi teckel,
do you have any code examples of how to get this working with arduino and android?
cheers
It seems others have taken care of this for you. They're right, you just treat it like a standard serial connection. You need to be running some sort of app on the other end (like a terminal emulator on an Android). You could then expand that to a mobile app. I've only done Android apps, but I'm sure you could do the same with the iPhone/iPad. Tim From what I've read, iphone apps are a little bit more tricky, since the iphone bluetooth will only connect to bluetooth devices blessed by Apple, and in order to be blessed by Apple, the developer needs to pay a hefty fee to be licensed as an Apple developer. In terms of Android apps, I just download the Bluetooth Controller App, which gives you 9 buttons that you can label, and these buttons will send a particular text message to your device. For my usage, that is sufficient, since I just want a simple replacement for an IR remote control, and it is a lot simpler than a chat program that you enter in text, and hit a send key. https://play.google.com/store/apps/details?id=apps.BT&hl=enNice little app for simple testing. Thanks, it will help. Tim
|
|
|
|
|
Logged
|
|
|
|
|
Queens, New York
Offline
Edison Member
Karma: 28
Posts: 1551
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
|
 |
« Reply #14 on: February 04, 2013, 04:04:03 pm » |
I didn't see that app when I was starting out  , is it new? That would have made things much easier for me.
|
|
|
|
|
Logged
|
UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino
Arduino Tutorials, coming soon.
"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown
|
|
|
|
|