Are you a developer who wants to learn about the Internet of Things (IoT)? Do you want to retrieve data from Internet-connected sensors for applications in home automation, healthcare, automotive, government and more? Do you want to control sensors and devices remotely from cloud, mobile, or desktop applications? In the IoT Fire Starter workshop you will use an IoT prototyping kit (that is yours to keep) to learn how to create micro-controller devices (the ‘Things’ in IoT) that use a variety of physical sensors such as light and temperature sensors; control switches; servos; and motors. You will learn how to connect these Things to Microsoft Azure IoT services to both collect data and issue control commands to the devices. Once you have mastered prototyping the hardware and connecting it to the Cloud, you will learn how to leverage Azure IoT services to gain insight into the data coming from your connected Thing, including analytics and machine learning. Following the workshop you will be able to continue your experience with your prototyping kit by following additional hands-on labs you can subscribe to online. You will need to bring your own laptop for this workshop.
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
IoT Fire Starter
1. IOT FIRE STARTER
A series of hands-on labs for the Internet of Things
WI-Fi SSID: ThingLabs
Password: ThingLabs
2. AGENDA
• Getting Started (Preparing your dev environment)
• Overview
• Maker 101
• Writing Digital Output
• Reading Analog Input
• Input Controls Output
• Connected Things 101
• Sending Data to the Cloud
• Command & Control
• Connecting Multiple Things
• Cloud IoT Services
• Visualizing IoT Data
• Hackathon
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
IOT DEVICE <-> CLOUD PATTERNS
5. 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
IOT DEVICE <-> CLOUD PATTERNS
6. LITTLE BRAIN <===============> BIG BRAIN
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
Cost $10 $30 $80 $19 $35++
$100 (1GB) -$140
(2GB)
7. WIRING A BREADBOARD
• Side rails create a circuit up and
down
• Rows create a circuit (A-E & F-J)
11. OTHER PREPARATION
• Set Up a Development Directory
C:DevelopmentIoTLabs
• Create a Free Particle Cloud Account
https://build.particle.io/signup
• Create a Microsoft Azure Trial Account
https://azure.microsoft.com/en-us/pricing/free-trial/
13. LAB 01: WRITING DIGITAL OUTPUT
The ‘Hello, World!’ of devices
14. BILL OF MATERIALS
• Particle Photon
• USB to micro-USB cable (there is one included in the Photon
Development Kit)
• LED (there is one included in the Photon Development Kit)
• 220-Ohm 1/4 Watt resistor (there is one included in the Photon
Development Kit)
15. CLAIM YOUR PHOTON
• Apple iPhone or Google Android – Use Particle Tinker App
• Windows PC –
• Download and install Photon drivers –
https://s3.amazonaws.com/spark-website/Spark.zip
• From Node.js Command Prompt:
particle identify (copy the device ID)
particle serial wifi (scan and select the Wi-Fi network)
(Wait for Photon to restart)
particle device add YOUR_DEVICE_ID_HERE
16. UPLOAD THE VOODOOSPARK FIRMWARE
• https://build.particle.io
• Create a new app named VooDooSpark
• Copy the code from http://tinyurl.com/VooDooSpark
• Target your Photon
• Validate the code
• Flash the Photon
17. OHM'S LAW
• Voltage = current (in amps) x resistance
• V = IR or R = V/I or I = V/R
• Resistance (R) = Voltage (V) / Current (I)
• R = 5V / 15mA (1,000 milliamps = 1 amp)
• R = 5 / .015
• R = 333.333 Ohms (330 Ohms is close enough)
• R = 5V / 10mA
• R = 5/.01
• R = 500 Ohms (560 Ohms is close enough)
20. GET YOUR PHOTON TOKEN
• From a Node.js Command Prompt:
particle token list
21. LAB01.JS
// Define the Jonny Five and Spark-IO variables
var five = require("johnny-five");
var Particle = require(”particle-io");
// Define the Johnny Five board as your Particle Photon
var board = new five.Board({
io: new Particle({
token: process.env.PARTICLE_KEY || 'YOUR API KEY HERE',
deviceId: process.env.PARTICLE_DEVICE || 'YOUR DEVICE ID HERE'
})
});
// Define the pin that is connected to the LED
var LEDPIN = "D7";
23. VOLTAGE DIVIDER
A voltage divider splits input
voltage input amongst two or
more components.
The resisted voltage indicates
the value.
Brighter light == Less resistance;
30. FieldGateways
ProtocolAdapters
CloudGateway
Hot Path Analytics
Cold / Batch Analytics & Visualizations
Hot Path Business Logic
EnterpriseProcessConnections
Devices
Linux,Android,iOS,RTOS,Windows
Device
Connectivity
Analytics &
Operationalized Insights
Business
Connectivity
IOT DEVICE <-> CLOUD PATTERNS
31. NITROGEN.IO
• Nitrogen is an open-source, JavaScript cloud gateway for IoT.
• Nitrogen provides
• Device Management
• Security and permissions
• Data Ingest
• Command & Control
• Nitrogen includes a JavaScript client library for device and web
applications
32. NITROGEN: A PUB-SUB MESSAGING MODEL
Bad User
Motorized
Blinds
Rogue
Light
Light
Sensor
Nitrogen
Service
Lighting
App
Light
LightSwitch
Mobile
App
35. OVERRIDING COMMANDMANAGER
• isRelevant – should I care about the message?
• Message type is _lightState or _lightLevel and
the message is either from or to this device ID
• isCommand – do I need to execute the message?
• Message type is _lightLevel
• obsoletes – do I care any more? (e.g. have I already processes this)
• Does the CommadManager think this is obsolete?
• Is the downstream message _lightState, and
is it in response to the specified upstream message, and
is the upstream message type _lightLevel
• executeQueue – do whatever needs to be done based on the message
• Iterate the activeCommands and perform some action
• start – get things going
• Starts the CommandManager, gets all the messages and subscribes to future messages
41. LITTLE BRAIN <===============> BIG BRAIN
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
Cost $10 $30 $80 $19 $35++
$100 (1GB) -$140
(2GB)