Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
ThingLabs IoT Workshop
1.
2.
3.
4. FieldGateways
ProtocolAdapters
OSSProject
CloudGateway
EventHub->IoTHub
Hot Path Analytics
Azure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI,
Azure Data Factory
Hot Path Business Logic
PaaS V2 & Actor Framework
EnterpriseProcessConnections
BizTalkServices,NotificationHubs
Devices
Linux,Android,iOS,RTOS,Windows
Device
Connectivity
Analytics &
Operationalized Insights
Business
Connectivity
5. FieldGateways
ProtocolAdapters
OSSProject
CloudGateway
IoTHub
Hot Path Analytics
Azure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI,
Azure Data Factory
Hot Path Business Logic
PaaS V2 & Actor Framework
EnterpriseProcessConnections
BizTalkServices,NotificationHubs
Devices
Linux,Android,iOS,RTOS,Windows
Device
Connectivity
Analytics &
Operationalized Insights
Business
Connectivity
6. MCU + MPUMCU (e.g. ATMega) MPU
Micro-controller (MCU) MCU + MPU MPU
Example
Arduino Pro Mini Arduino Uno Arduino Yún Particle Photon Raspberry Pi 2
MinnowBorad
MAX
Micro-
controller
ATmega328 ATmega328 ATmega32u4 -- -- --
Micro-
processor
-- -- Atheros AR9331 ARM Cortex-M3 ARM Cortex-A7 Intel Atom E38xx
GPU No No No No Yes Integrated
Wi-Fi SoC No No Yes Yes No No
Linux No No Yes No Yes Yes
Windows 10
IoT
No No No No Yes Yes
26. // lab01.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin that is connected to the LED
var
// Create a Johnny Five board instance to represent your Particle Photon.
// ‘Board ‘is simply an abstraction of the physical hardware,
// whether it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
27. // The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Set the pin you connected to the LED to OUTPUT mode
this
// Create a loop to "flash/blink/strobe" the LED once per second
var
this function
this
28. In this lab you will read input from an analog sensor using a voltage divider.
Photon.ThingLabs.io/02/
Tweet with @ThingLabsIO and #ilikedark
29. A voltage divider splits input
voltage input amongst two or
more components.
The resisted voltage indicates the
value.
Brighter light == Less resistance;
30.
31. // lab02.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin you will use to read the residual voltage
// coming from the photoresistor
var
// Create a Johnny Five board instance to represent your Particle Photon.
// ‘Board ‘is simply an abstraction of the physical hardware, whether
// it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
32. // The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Read the residual voltage coming from the photoresistor
this function
// Multiple the value by 3.3V / 1024, which the the
// value range of the photoresistor
33. In this lab you will use analog input to control digital output.
Photon.ThingLabs.io/03/
Tweet with @ThingLabsIO and #NightLight
34.
35.
36. // lab03.js
var "johnny-five"
var "particle-io"
// Set up the access credentials for Particle and Azure
var 'YOUR PARTICLE ACCESS TOKEN HERE'
var 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE'
// Define the pin that is connected to the LED
var “D0"
// Define the pin you will use to read the residual voltage
// coming from the photoresistor
var "A0"
// Create a Johnny Five board instance to represent your Particle Photon. ‘Board ‘is
simply an abstraction of
// the physical hardware, whether it is a Photon, Arduino, Raspberry Pi or other boards.
var new
new
37. // The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
"ready" function
"Board connected..."
// Set the pin you connected to the LED to OUTPUT mode
this
// Create a new 'photoresistor' hardware instance.
new
// Analog pin 0
// TODO: Handle the photoresistor data events
38. // Replace ‘TODO: Handle the photoresistor data events’ with the following:
// Define the callback function for the photoresistor reading.
// The freq value used when the photoresistor was defined
// determines how often this is invoked.
// Scale the sensor's data from 0-1023 to 0-255.
"data" function
// Multiple the value by 3.3V / 1024, which the the
// value range of the photoresistor
this
// Set the brigthness of the LED
this
42. In this lab you will gather telemetry and send it to the cloud.
Azure.ThingLabs.io/02/
Tweet with @ThingLabsIO and #Telemetry
43. {
"name": "IoT-Labs",
"version": "0.1.0",
"private": true,
"description": "Sample app that connects a device to Azure using Node.js",
"main": "weather.js",
"author": "YOUR NAME HERE",
"license": "MIT",
"dependencies": {
"johnny-five": "^0.8.104",
"particle-io": "^0.10.1” ,
"j5-sparkfun-weather-shield": "^0.2.0",
"azure-iot-device": "^1.0.0-preview.3”
}
}
44. // weather.js
var five = require ("johnny-five");
var device = require("azure-iot-device");
var Weather = require("j5-sparkfun-weather-shield")(five);
var Particle = require("particle-io");
// Set up the access credentials for Particle and Azure
var token = 'YOUR PARTICLE ACCESS TOKEN HERE';
var deviceId = 'YOUR PARTICLE PHOTON DEVICE ID/ALIAS HERE';
var location = 'THE LOCATION OF THE PARTICLE PHOTON DEVICE';
var connectionString = 'YOUR IOT HUB DEVICE-SPECIFIC CONNECTION STRING HERE';
45. // Create a Johnny Five board instance to represent your Particle Photon.
// Board is simply an abstraction of the physical hardware, whether it is
// a Photon, Arduino, Raspberry Pi or other boards.
var board = new five.Board({
io: new Particle({
token: token,
deviceId: deviceId
})
});
// Create an Azure IoT client that will manage the connection to your IoT Hub
// The client is created in the context of an Azure IoT device, which is why
// you use a device-specific connection string.
var client = new device.Client(connectionString, new device.Https());
46. // The board.on() executes the anonymous function when the
// board reports back that it is initialized and ready.
board.on("ready", function() {
console.log("Board connected...");
// The SparkFun Weather Shield for the Particle Photon has two sensors on the I2C bus –
// a humidity sensor (HTU21D) which can provide both humidity and temperature, and a
// barometer (MPL3115A2) which can provide both barometric pressure and humidity.
// Controllers for these are wrapped in the convenient ‘Weather’ plug-in class:
var weather = new Weather({
variant: "PHOTON",
freq: 1000,
elevation: 100 // Put your current elevation (in feet) here
})
// Don’t close the board.on() function yet
47. // The weather.on("data", callback) function invokes the anonymous callback function
// whenever the data from the sensor changes (no faster than every 25ms). The anonymous
// function is scoped to the object (e.g. this == the instance of Weather class object).
weather.on(“data" , function () {
// Create an Azure IoT Message
var payload = JSON.stringify({
deviceId: deviceId,
location: location,
// celsius & fahrenheit are averages taken from both sensors on the shield
celsius: this.celsius,
fahrenheit: this.fahrenheit,
relativeHumidity: this.relativeHumidity,
pressure: this.pressure,
feet: this.feet,
meters: this.meters
});
// Don’t close the weather.on() or board.on() functions yet
48. // Create the message based on the payload JSON
var message = new device.Message(payload);
// For debugging purposes, write out the message payload to the console
console.log("Sending message: " + message.getData());
// Send the message to Azure IoT Hub
// printResultsFor() is a function you will write next
client.sendEvent(message, printResultFor('send'));
}); // Close the weather.on() function
}); // Close the board.on() function
49. In this lab you will create visualizations of IoT data.
Azure.ThingLabs.io/03/
Tweet with @ThingLabsIO and #IoTBI
50.
51.
52.
53. SELECT
MAX(fahrenheit) MaxTempF,
MIN(fahrenheit) MinTempF,
AVG(fahrenheit) AvgTempF,
MAX(celsius) MaxTempC,
MIN(celsius) MinTempC,
AVG(celsius) AvgTempC,
MAX(relativeHumidity) MaxHumidity,
MIN(relativeHumidity) MinHumidity,
AVG(relativeHumidity) AvgHumidity,
location,
deviceId,
System.Timestamp AS Timestamp
INTO
[TemperatureBI]
FROM
[DeviceInputStream]
GROUP BY
TumblingWindow (second, 1), deviceId, location