How we connected a golf grip to the cloud 6/4/2018 5:27 PM THR2163 How we connected a golf grip to the cloud Davide Mauri Director of SW Engineering @ Sensoria © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Who Am I? Microsoft Data Platform MVP since 2006 Working with SQL Server from 6.5, on BI from 2003 Specialized in Data Solution Architecture, Database Design, Performance Tuning, High-Performance Data Warehousing, BI, Big Data Very strong developer background Loves this community! President of UGISS (Italian SQL Server UG) for 11 Years AppDev VG Leader since 2017 Regular Speaker @ SQL Server events Director SW & Cloud @ Sensoria: http://www.sensoriafitness.com/ E-mail: dm@sensoriainc.com-Twitter: @mauridb Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
What Do We Do? Sensors Injected into IoT Garments Wearable Solutions Hardware/Firmware: Sensoria CORE Software/Platform/SDK/Cloud
Sensoria in the news
Why Are We Doing This? IoT for the Humans: “Internet Of Me” Quantify human activity Improve human performance Reduce risk of injury Golf is one of the most data-rich sport *everything counts* to make a good shot Angle, Speed, Impact, Pressure… And much more!
Instrumenting a Golf Grip It’s one of the most important thing to learn Measure how pressure is exerted on the grip is very interesting And even more try correlate the shot outcome with the recorded pressure pattern
Instrumenting a Golf Grip Sensoria Core + 8 Pressure Sensors Sensoria Core Pressure Sensor
Instrumenting a Golf Grip Sensors stream at 64Hz Each sensor has a specific calibration Data is sent to a receiver app via Bluetooth 4.0 LE Application shows real-time data
On-Premises: Data Collection Windows UWP Application Get data streamed from Sensoria Core Shows it in real time Pack it so that they can be send to Azure every second 32Hz/64Hz data cannot be streamed “as is”. Costs will be to high Data is sent real-time (if network permits) to Azure Must handle intermittent connection to Bluetooth and Internet. GUI must stay responsive
On-Premises: Data Collection Via the Sensoria SDK Sensoria Core sends streaming data Data is received in a dedicated thread Last received value is used to update GUI Received data is stored in concurrent queues ConcurrentQueue<T> Class https://msdn.microsoft.com/en-us/library/dd267265(v=vs.110).aspx
On-Premises: Data Delivery Two queues help to retain all gathered data and to handle slow internet connections Every second 64 sensors values are removed from the Receive Queue, packed into one JSON document and put in the Send Queue Every second a packed document is taken from the Send Queue and sent to Azure
On-Premises: Data Delivery Sensoria Core Data 8 Sensors 2 bytes each 64 samplings per second + additional data (Golf Club, DateTime, etc.) Received Data queue Send Data queue RealTime Every Sec Every Sec Azure
Solution Architecture Lambda Architecture http://lambda-architecture.net/
Cloud: Ingestion Event Hub takes care of data ingestion IoT could be used if you also need to send data back to the device Or if you need MQTT support Useful resource to decide which one to use: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-compare-event-hubs
Cloud: Stream Processing Processing is done using Stream Analytics Data is split in four streams with slightly different payload (in order to minimize size, by avoiding duplication) START, SWING, END EVAL EVAL contains evaluation data Evaluation is done manually by the golfer/caddie
Cloud: Serving Data is saved to a Azure SQL Database A PowerBI dashboard has been created to analyze all session at once
Cloud: Serving Data is also available to the UWP app to “Replay” the shoot
Cloud: Machine Learning Work in progress: analyze sensors data to check if a “best grip” pattern may exist Include additional external data to improve algorithm Goal: Give the golfer real-time feedback on its grip (via earbuds) VERY useful for training Performance improvement feedback in real-time on the golf course Gamification
Why Azure SQL: BEST VALUE! For the POC SQL Azure has the best feature/costs ratio, delivering great performance (sort of “battery included” solution) In-Memory features are perfect for fast data ingestion Columnstore is perfect for analytics All data was there so no need to add additional complexity to orchestrate data movements between different azure services
Future Options Other options evaluated and taken into consideration for production phase: Apache Storm Handle complex streams DocumentDB / CosmosDB quickly save raw JSON data, no matter the shape Azure SQL DW easy and faster usage of consolidated and cleaned data Historical analysis/comparison Raw Data stored in Azure Data Lake Future analysis of raw data (data science!)
Conclusions http://www.wired.co.uk/article/microsoft-data-driven-golf http://www.golfchannel.com/video/tech-spotlight-smart-grip-slope-range-finder-triton-driver/
6/4/2018 5:27 PM Thanks! © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Please evaluate this session Tech Ready 15 6/4/2018 Please evaluate this session From your Please expand notes window at bottom of slide and read. Then Delete this text box. PC or tablet: visit MyIgnite https://myignite.microsoft.com/evaluations Phone: download and use the Microsoft Ignite mobile app https://aka.ms/ignite.mobileapp Your input is important! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
6/4/2018 5:27 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.