Connecting iOS & Android

to Arduino with Bluetooth

Mobile Philly - November 13, 2013

Presented by Don Coleman / @doncoleman

Bluetooth

Alternatives

  • WiFi
  • XBee ZigBee
  • ZWave
  • 433 MHz
  • Other 2.4 GHz

Bluetooth

Classic

Bluetooth

Low Energy


http://www.bluetooth.com/Pages/Smart-Logos.aspx
https://www.bluetooth.org/en-us/specification/adopted-specifications
https://developer.bluetooth.org/gatt/Pages/Definition-Browser.aspx
https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml

Arduino

http://arduino.cc/en/Reference/SoftwareSerialConstructor

PhoneGap

Apache Cordova

$ npm install cordova -g

Bluetooth Serial

PhoneGap Plugin

https://github.com/don/BluetoothSerial

Installing


$ cordova plugin install com.megster.cordova.bluetoothserial				        
                    

Connecting


    var macAddress = "00:00:AA:BB:CC:DD";
    
    var connected = function() {
      // connected, do something
    };
    
    var disconnected = funtion(error) { 
      // disconnected
    };

    bluetoothSerial.connect(macAddress, connected, disconnected);				    
                    

Receiving Data


  var onMessage = function(data) {
    console.log(data);
  };

  bluetoothSerial.subscribe("\n", onMessage, onFailure);
                    

Demo

Phone receives data from Arduino

Sending Data


  bluetoothSerial.write("Hello Arduino");
				    

c red, green, blue

c0,0,255\n

Demo

Phone controls LED strip on Arduino
Control NeoPixel LED on Arduino from Android

iBeacon

CoreLocation

(not CoreBluetooth)

CLBeacon, CLBeaconRegion, CLLocationManagerDelegate

Radius Networks

http://radiusnetworks.com

Demo

iBeacon, iOS and Hue Lights
http://www.rfduino.com

Thank You

Don Coleman

@doncoleman

don@chariotsolutions.com

http://don.github.io/slides/

 

 

Creative Commons License
Connecting iOS and Android to Arduino with Bluetooth by Don Coleman
is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/don/.../2013-11-13-mobilephilly-bluetooth.