iot labs

29
IOT@NIGHT Doug 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

Upload: doug-seven

Post on 28-Jul-2015

225 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: IoT Labs

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

Page 2: IoT Labs

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

Page 3: IoT Labs

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

Page 4: IoT Labs

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

Page 5: IoT Labs

BUILDING A ‘THING’

Labs 1-3

Page 6: IoT Labs

ANATOMY OF AN ARDUINO YÚN

Atheros AR9331 ATmega32u4 

Page 7: IoT Labs

ANATOMY OF AN ARDUINO YÚN (CONT’D)

AR9331 LinuxWi-Fi

Ethernet

Micro USB

USB Host

ATmega 32u4

MicroSD

Page 8: IoT Labs

ANATOMY OF AN ARDUINO YÚN (CONT’D)

Digital IO 1-13

Analog Output 0-53.3V, 5V, GND

GND

Page 9: IoT Labs

WIRING A BREADBOARD Side rails create a circuit up and

down

Rows create a circuit (A-E & F-J)

Page 10: IoT Labs

LAB 1

Hello, World!

Page 11: IoT Labs

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)

Page 12: IoT Labs

LAB01.JS 5mm Green LED (1)

330-Ohm 1/4 Watt resistor(Orange-Orange-Brown) (1)

http://ThingLabs.io/arduino/01/

Page 13: IoT Labs

LAB 2

Reading Analog Input

Page 14: IoT Labs

VOLTAGE DIVIDER

A voltage divider splits input voltage input amongst two or more components.

The resisted voltage indicates the value.

Brighter light == Less resistance;

Page 15: IoT Labs

LAB02.JS Photoresistor (1)

10k-Ohm 1/4 Watt resistor(Brown-Black-Orange) (1)

http://ThingLabs.io/arduino/02/

Page 16: IoT Labs

LAB 3

Controlling Output with Input

Page 17: IoT Labs

PULSE WIDTH MODULATION (PWM)

Page 18: IoT Labs

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/

Page 19: IoT Labs

CONNECTING THE ‘THING’

Labs 4-6

Page 20: IoT Labs

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

Page 21: IoT Labs

NITROGEN: A PUB-SUB MESSAGING MODEL

Bad User

MotorizedBlinds

Rogue Light

Light Sensor

Nitrogen Service

Lighting App

Light

LightSwitch

Mobile App

Page 22: IoT Labs

LAB 4

Sending Data to the Cloud

Page 23: IoT Labs

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/

Page 24: IoT Labs

LAB 5

Sending Command & Control Messages

Page 25: IoT Labs

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

Page 26: IoT Labs

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/

Page 27: IoT Labs

LAB 6

Connecting Multiple Things

Page 28: IoT Labs

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>

Page 29: IoT Labs

LAB06.JS

http://ThingLabs.io/arduino/06/

Light Device

Light Sensor Device