iot labs
TRANSCRIPT
IOT@NIGHTDoug Seven, Josh Holmes, Ivan Judson
Microsoft DX-TED, Partner Catalyst Team
Get settled and start preparing your machine by following the instructions at…
http://ThingLabs.io/arduino/00/
@ThingLabsIo
Field
Gate
ways Proto
col A
dapte
rsO
SS P
roje
ct
Clo
ud G
ate
way
Eve
nt
Hub ->
IoT H
ub
Hot Path AnalyticsAzure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI, Azure Data Factory
Hot Path Business LogicPaaS V2 & Actor Framework E
nte
rprise
Pro
cess
Connect
ions
Biz
Talk
Serv
ices,
Notific
ation H
ubs
Devi
ces
Linux,
Andro
id, iO
S, RTO
S, W
indow
s
Device Connectivity
Analytics & Operationalized Insights
BusinessConnectivity
IOT DEVICE <-> CLOUD PATTERNS
Field
Gate
ways Proto
col A
dapte
rsO
SS P
roje
ct
Clo
ud G
ate
way
Eve
nt
Hub ->
IoT H
ub
Hot Path AnalyticsAzure Stream Analytics, Azure Storm
Cold / Batch Analytics & Visualizations
Azure HDInsight, AzureML, Power BI, Azure Data Factory
Hot Path Business LogicPaaS V2 & Actor Framework E
nte
rprise
Pro
cess
Connect
ions
Biz
Talk
Serv
ices,
Notific
ation H
ubs
Devi
ces
Linux,
Andro
id, iO
S,
RTO
S, W
indow
s
Device Connectivity
Analytics & Operationalized Insights
BusinessConnectivity
IOT DEVICE <-> CLOUD PATTERNS
LITTLE BRAIN <=========> BIG BRAINMCU + Atheros /
LinuxMCU (e.g. ATMega) ARM/Atom / Linux, Windows
Micro-controller (MCU) MCU + SoC Micro-ComputerExample Arduino Pro
MiniArduino Uno Arduino Yún Raspberry Pi 2 MinnowBorad MAX
Micro-controller ATmega168 ATmega328 ATmega32u4 -- --
Processor-- --
Atheros AR9331(Wi-Fi SoC)
ARM Cortex-A7 Intel Atom E3825
GPU No No No Yes Yes
BUILDING A ‘THING’
Labs 1-3
ANATOMY OF AN ARDUINO YÚN
Atheros AR9331 ATmega32u4
ANATOMY OF AN ARDUINO YÚN (CONT’D)
AR9331 LinuxWi-Fi
Ethernet
Micro USB
USB Host
ATmega 32u4
MicroSD
ANATOMY OF AN ARDUINO YÚN (CONT’D)
Digital IO 1-13
Analog Output 0-53.3V, 5V, GND
GND
WIRING A BREADBOARD Side rails create a circuit up and
down
Rows create a circuit (A-E & F-J)
LAB 1
Hello, World!
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)
LAB01.JS 5mm Green LED (1)
330-Ohm 1/4 Watt resistor(Orange-Orange-Brown) (1)
http://ThingLabs.io/arduino/01/
LAB 2
Reading Analog Input
VOLTAGE DIVIDER
A voltage divider splits input voltage input amongst two or more components.
The resisted voltage indicates the value.
Brighter light == Less resistance;
LAB02.JS Photoresistor (1)
10k-Ohm 1/4 Watt resistor(Brown-Black-Orange) (1)
http://ThingLabs.io/arduino/02/
LAB 3
Controlling Output with Input
PULSE WIDTH MODULATION (PWM)
LAB03.JS 5mm Green LED (1)
330-Ohm 1/4 Watt resistor(Orange-Orange-Brown) (1)
Photoresistor (1)
10k-Ohm 1/4 Watt resistor(Brown-Black-Orange) (1)
http://ThingLabs.io/arduino/03/
CONNECTING THE ‘THING’
Labs 4-6
NITROGEN.IO Nitrogen is an open-source, JavaScript backend for IoT.
Nitrogen provides Device Management Security and permissions Data Ingest Command & Control
Nitrogen includes a JavaScript client library for device and web applications
NITROGEN: A PUB-SUB MESSAGING MODEL
Bad User
MotorizedBlinds
Rogue Light
Light Sensor
Nitrogen Service
Lighting App
Light
LightSwitch
Mobile App
LAB 4
Sending Data to the Cloud
LAB04.JS Photoresistor (1)
10k-Ohm 1/4 Watt resistor(Brown-Black-Orange) (1)
Update to package.json
Must rerun npm install
http://ThingLabs.io/arduino/04/
LAB 5
Sending Command & Control Messages
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, andis 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
LAB05.JS 5mm Green LED (1)
330-Ohm 1/4 Watt resistor(Orange-Orange-Brown) (1)
Photoresistor (1)
10k-Ohm 1/4 Watt resistor(Brown-Black-Orange) (1)
http://ThingLabs.io/arduino/05/
LAB 6
Connecting Multiple Things
PERMISSIONS Permissions enable control over which Principals can interact (or not) with
other Principals
Permission Types admin view send subscribe
Permissions enable explicit authorization control n2 permission add --action subscribe --authorized true --issueTo <PRINCIPAL ID> --principalFor <PRINCIPAL ID>
LAB06.JS
http://ThingLabs.io/arduino/06/
Light Device
Light Sensor Device