Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
CATCH ME IF YOU CANJAVA ON WEARABLES
Gerrit Grunwald Developer Evangelist Oracle
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
•Gerrit Grunwald •Oracle •Developer Evangelist
ABOUT ME
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
WEARABLES
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
WHAT IS IT…?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
•Miniature electronic device •Worn under, with or on top of clothing •Needs more computational support than hardware coded logic
WHAT IS IT
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
EXAMPLES
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
EXAMPLES
Earphones Glasses
Insoles Clothing
Watches
and more…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
USE CASES…?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Fitness-‐ and Health-‐tracking (data producing) • Location-‐tracking & Directions
(data producing & consuming) • Informational
(data consuming)
USE CASES
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
REQUIREMENTS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Small form factor (size, weight, unobtrusive) • Smart power management
(low power consumption, sleep mode, auto shutdown, rechargeable battery) • Connectivity
(wire, bluetooth, ant+, Z-‐Wave, WiFi, Cellular)
REQUIREMENTS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
SITUATION
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Lots of devices available • Predefined features •No real standard •Hard to combine products
SITUATION
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
WHAT IF YOU NEED SOMETHING
SPECIAL ?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ITDO Y OURSELF
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
IDEA
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
JRUNNER PROJECT
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• GPS data (latitude, longitude, altitude, speed, heading) • Heart Rate (bpm) • Haptic feedback through vibration • Audio feedback via Text To Speech • ON Switch and automatic shutdown • Battery monitor • Remote controlled by Phone/SmartWatch
FEATURE IDEAS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
RUNNING ON…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ODROID-‐W
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
USING…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Oracle Java SE embedded 8
ENVIRONMENT
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
SENSORS &
ACTORS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
THE PI4J PROJECT
http://pi4j.com
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING
LOCATION
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING LOCATIONEasy to setup UART access via Pi4J GNSS receiver High gain antenna Power cons. (22 mA) Form factor
HAB Supplies ublox M8Q
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
NMEANational Marine Electronics Association
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
$GNGGA,094211.00,5154.71261,N,00738.01853,E,1,05,3.97,86.7,M,46.3,M,,*78 $GNGSA,A,3,04,28,32,11,01,,,,,,,,5.20,3.97,3.36*1E $GNGSA,A,3,,,,,,,,,,,,,5.20,3.97,3.36*10 $GPGSV,2,1,08,01,40,277,27,04,74,283,22,11,60,281,22,19,,,16*4C $GPGSV,2,2,08,22,42,063,14,24,02,032,16,28,25,312,25,32,46,205,22*7B $GLGSV,1,1,00*65 $GNGLL,5154.71261,N,00738.01853,E,094211.00,A,A*7D $GNRMC,094212.00,A,5154.71273,N,00738.01910,E,0.596,,091214,,,A*67 $GNVTG,,T,,M,0.596,N,1.105,K,A*32
NMEA OUTPUT
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• GGA (Fix information) • GGL (Latitude and Longitude data) • GSA (Overall Satellite data) • RMC (Recommended minimum data for GPS)
• VTG (Vector track and Speed over Ground) • GSV (Detailled Satellite data)
NMEA SENTENCES
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
NMEA SENTENCES• GGA (Fix information) • GGL (Latitude and Longitude data) • GSA (Overall Satellite data) • RMC (Recommended minimum data for GPS)
• VTG (Vector track and Speed over Ground) • GSV (Detailled Satellite data)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Essential fix data which provide 3D location an accuracy data.
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
GGA SENTENCE
Time N/S E/W Altitude
Fix qual.Latitude Longitude
No. of Sat.
HDOP Alt. Unit
Mean Sea Level
Height Unit
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ACCESS GPS SENSORprivate void initSerial() throws SerialPortException { SERIAL.open(Serial.DEFAULT_COM_PORT, BAUD_RATE);
SERIAL.addListener(e -‐> { // Example: $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 final String[] dataArray = e.getData().replaceAll("\r\n", ";").split(";"); Arrays.stream(dataArray).forEach(sentence -‐> NmeaManager.INSTANCE.parse(sentence)); }); }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING HEART RATE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING HEART RATEEasy to setup GPIO access via Pi4J Form factor Simple Pulse detection
Polar Heart Rate Sensor
Manual HR calculation
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ACCESS HEART RATE SENSORprivate static final GpioController GPIO = GpioFactory.getInstance();
private static final GpioPinDigitalInput BPM_SENSOR = GPIO.provisionDigitalInputPin(RaspiPin.GPIO_04, PinPullResistance.PULL_DOWN);
private void registerListeners() { … BPM_SENSOR.addListener((GpioPinListenerDigital) e -‐> HeartRateMonitor.INSTANCE.beat()); … }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ACCESS HEART RATE SENSORpublic HeartRateMonitor { INSTANCE; … public void beat() { long now = System.currentTimeMillis(); long delta = now -‐ lastBeat -‐ PULSE_TIME; if (delta > 272 && delta < 1224) { // filter wrong sensor readings timeBetweenBeats[beatCount] = delta; beatCount++; if (beatCount > 9) beatCount = 0; } lastBeat = now; }
public int getHeartRate() { double average = LongStream.of(timeBetweenBeats).sum() / BEATS_TO_STORE; double rate = 60 / (average / 1000); return (int) rate; } …
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING
TEMPERATURE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TRACKING TEMPERATUREEasy to setup Low power cons. Temperature and Pressure I2C access via Pi4J Form factor
BMP180 Sensor
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
HAPTIC FEEDBACKEasy to setup Easy to access Form factor
Lilypad Vibe
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
ACCESS VIBRATION MOTORprivate static final GpioController GPIO = GpioFactory.getInstance(); private static final GpioPinDigitalOutput PIN = GPIO.provisionDigitalOutputPin(RaspiPin.GPIO_02, "Pin 02", PinState.LOW);
private void buzz(final long duration) { new Thread(() -‐> { PIN.high(); try { Thread.sleep(duration); } catch (InterruptedException exception) { } PIN.low(); }).start(); }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TEXT TO SPEECH
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Say the Heart Rate every Minute • Say incoming text messages •Uses high quality voice from Cepstral
TEXT TO SPEECH
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
CEPSTRAL VOICES
http://cepstral.com/en/raspberrypi
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
TEXT TO SPEECHprivate void speak(final String message) throws IOException { Runtime run = Runtime.getRuntime(); run.exec(String.join("", "swift \"", message, "\""); }
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
CONNECTIVITY
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MEANS…
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
HEAVY LIFTING
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MOBILE PHONE + WIFI ADAPTER
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
WiFi Hotspot High data rate (3G/LTE) Heavy lifting done by phone
MOBILE PHONE + WIFI ADAPTER
Device needs battery
Power cons. (WiFi~116mA)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MOBILE PHONE + BLE ADAPTER
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
BlueTooth Tethering High data rate (3G/LTE) Power cons. (BLE ~16mA) Heavy lifting done by phone
MOBILE PHONE + BLE ADAPTER
Limited throughput
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
COMMUNICATION
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Q TESSAGE UEUE TELEMETRY TRANSPORTM T
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
PUBLISH &
SUBSCRIBE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
COMMUNICATION
mosquitto
jrunner
jrunner/msg
JRunner
publish
subscribe
Client
subscribe
publish
MQTT Topics
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Odroid-‐U3
MQTT Brokermosquitto
COMMUNICATION
Mobile Phone
Bluetooth Cellular 2/3/4G
MQTT -‐ PUBLISHOdroid-‐W
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Odroid-‐U3
MQTT Brokermosquitto
COMMUNICATION
Database Server
Smart Watch
Desktop
Mobile Phone
MQTT -‐ SUBSCRIBE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
• Perfect for M2M • Lightweight • Low power • Support for QoS • Eclipse Paho Java library
MQTT
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
HARDWARE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
•Hardware compapble to Pi •Broadcom BCM2835 SoC •512 MB Ram •Realpme Clock •LiPo Baqery Charger •LiPo Baqery connector •RTC baqery connector •12 Bit ADC
HARDWAREOdroid-‐W
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
BMP180
HAB Supplies ublox M8Q
3.3 V
GPIO15 (RX)
Polar Heart Rate module
5 V
GPIO23LilyPad
Vibration Motor
ON/OFF
GPIO40 (Audio L)GPIO45 (Audio R)
GPIO27
HARDWARE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
•Odroid-‐W •1200 mAh LiPo Baqery •Custom PCB •HAB Supplies ublox M8 GPS •Polar Heart Beat Sensor •BLE USB Spck •ON Switch •Vibrapon motor •BMP180
HARDWARE
BLE stick
Vibration Motor
GPS Receiver
Heart Rate Sensor
7 cm
Custom PCB
On Switch
BMP180
Audio out
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
BATTERY LIFE
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
BATTERY LIFE
with a 15% Buffer ≈ 6.3 h
1200 mAh 3.7 V600 mW
≈× 7.4 h
Battery capacity Battery voltage
Estimated power consumption of Odroid-‐W
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
FINAL SETUP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
SETUP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
HOW TO CONTROL ?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MOBILE APP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MOBILE APP
Distance Duration
TimeBattery
BPM
BPM Indicator
Start/StopAlert Mark
Reset TrackShutdown Exit
Map
Static map
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
MOBILE APP
IOS ANDROID ANDROID
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
HOW TO MONITOR ?
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
DESKTOP APP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
DESKTOP APPStop Device
Track recording
Heart rate Height
Shutdown Device
Dist. Temp. Bat.Speed Weather
Team mates (OwnTracks)
Msg. Conn. Heading Cal.
Name
Points of interest
Map Overlays (rain, wind, pressure)
Zoom toolCurrent scale
Track information
Current and avg. BPM
Charts
Press.
DB state
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
DESKTOP APP
Visualize track altitude recording
Visualize track bpm recording