SlideShare une entreprise Scribd logo
1  sur  45
IOT FIRE STARTER
A series of hands-on labs for the Internet of Things
WI-Fi SSID: ThingLabs
Password: ThingLabs
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
OVERVIEW
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
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
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)
WIRING A BREADBOARD
• Side rails create a circuit up and
down
• Rows create a circuit (A-E & F-J)
GETTING STARTED
Preparing your development environment
DOWNLOADS & INSTALLATIONS
• Install a Code Editor - http://Code.VisualStudio.com
• Install Git - http://git-scm.com
• Install Node.js - http://nodejs.org
NPM INSTALLATIONS
• Install Johnny-Five
npm install -g johnny-five
• Install Particle-CLI
npm install -g particle-cli
• Install Nitrogen CLI
npm install -g nitrogen-cli
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/
MAKER 101
The fundamentals of maker development kits
LAB 01: WRITING DIGITAL OUTPUT
The ‘Hello, World!’ of devices
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)
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
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
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)
WIRINGTHEPHOTON
PACKAGE.JSON
{
"name": "IoT-Labs-Photon",
"repository": {
"type": "git",
"url": "https://github.com/ThingLabsIo/IoTLabs/Photon"
},
"version": "0.1.0",
"private": true,
"dependencies": {
"johnny-five": "^0.8.0",
”particle-io": "^0.8.1”
}
}
cd C:DevelopmentIoTLabs
npm install
GET YOUR PHOTON TOKEN
• From a Node.js Command Prompt:
particle token list
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";
LAB 02: READING ANALOG INPUT
Ambient Light Detection
VOLTAGE DIVIDER
A voltage divider splits input
voltage input amongst two or
more components.
The resisted voltage indicates
the value.
Brighter light == Less resistance;
WIRINGTHEPHOTON
LAB 03: INPUT CONTROLS OUTPUT
Night Light
PULSE WIDTH MODULATION (PWM)
WIRINGTHEPHOTON
CONNECTED THINGS 101
The fundamentals of connecting Things to the Cloud
LAB 04: SENDING DATA TO THE CLOUD
Nitrogen
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
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
NITROGEN: A PUB-SUB MESSAGING MODEL
Bad User
Motorized
Blinds
Rogue
Light
Light
Sensor
Nitrogen
Service
Lighting
App
Light
LightSwitch
Mobile
App
WIRINGTHEPHOTON
LAB 05: COMMAND & CONTROL
CommandManager
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
WIRINGTHEPHOTON
LAB 06: CONNECTING MULTIPLE THINGS
Permissions
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>
WIRINGTHEPHOTONS
AMBIENTLIGHTDETECTOR
INDICATORLIGHT
OTHER STUFF
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)
ANATOMY OF AN ARDUINO YÚN
Atheros AR9331ATmega32u4
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
THINGLABS.IO
DSEVEN@MICROSOFT.COM
IVAN.JUDSON@MICROSOFT.COM

Contenu connexe

Tendances

Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
nimak
 
Cloud penetrator-hakin9-review-march-2012
Cloud penetrator-hakin9-review-march-2012Cloud penetrator-hakin9-review-march-2012
Cloud penetrator-hakin9-review-march-2012
Amiga Utomo
 

Tendances (14)

Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive servicesBirdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
Birdwatching using a Raspberry pi, Azure IoT Hub and Cognitive services
 
Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019Security Automation Simplified - BSides Austin 2019
Security Automation Simplified - BSides Austin 2019
 
Automated Abstraction of Flow of Control in a System of Distributed Software...
Automated Abstraction of Flow of Control in a System of Distributed  Software...Automated Abstraction of Flow of Control in a System of Distributed  Software...
Automated Abstraction of Flow of Control in a System of Distributed Software...
 
Virus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing GatekeeperVirus Bulletin 2015: Exposing Gatekeeper
Virus Bulletin 2015: Exposing Gatekeeper
 
Gatekeeper Exposed
Gatekeeper ExposedGatekeeper Exposed
Gatekeeper Exposed
 
Meet the Eclipse SmartHome powered Mars Rover
Meet the Eclipse SmartHome powered Mars RoverMeet the Eclipse SmartHome powered Mars Rover
Meet the Eclipse SmartHome powered Mars Rover
 
Android Apps the Right Way
Android Apps the Right WayAndroid Apps the Right Way
Android Apps the Right Way
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 
How to Install & Configure Your Own Identity Manager GE
How to Install & Configure Your Own Identity Manager GEHow to Install & Configure Your Own Identity Manager GE
How to Install & Configure Your Own Identity Manager GE
 
Raspberry pi and Azure
Raspberry pi and AzureRaspberry pi and Azure
Raspberry pi and Azure
 
Prometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observabilityPrometheus: From technical metrics to business observability
Prometheus: From technical metrics to business observability
 
Cloud penetrator-hakin9-review-march-2012
Cloud penetrator-hakin9-review-march-2012Cloud penetrator-hakin9-review-march-2012
Cloud penetrator-hakin9-review-march-2012
 
Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8
 
FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012FusionInventory at LSM/RMLL 2012
FusionInventory at LSM/RMLL 2012
 

Similaire à IoT Fire Starter

Similaire à IoT Fire Starter (20)

Plone FSR
Plone FSRPlone FSR
Plone FSR
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
How to debug IoT Agents
How to debug IoT AgentsHow to debug IoT Agents
How to debug IoT Agents
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Learn OpenStack from trystack.cn
Learn OpenStack from trystack.cnLearn OpenStack from trystack.cn
Learn OpenStack from trystack.cn
 
FIWARE Wednesday Webinars - How to Debug IoT Agents
FIWARE Wednesday Webinars - How to Debug IoT AgentsFIWARE Wednesday Webinars - How to Debug IoT Agents
FIWARE Wednesday Webinars - How to Debug IoT Agents
 
How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)
 
How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
OpenDaylight Integration with OpenStack Neutron: A Tutorial
OpenDaylight Integration with OpenStack Neutron: A TutorialOpenDaylight Integration with OpenStack Neutron: A Tutorial
OpenDaylight Integration with OpenStack Neutron: A Tutorial
 
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClassIBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 8598 Domino and JavaScript Development MasterClass
 
Python Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + JenkinsPython Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + Jenkins
 
Splunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shells
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Stackato
StackatoStackato
Stackato
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016What's new in Docker - InfraKit - Docker Meetup Berlin 2016
What's new in Docker - InfraKit - Docker Meetup Berlin 2016
 
Integrating Splunk into your Spring Applications
Integrating Splunk into your Spring ApplicationsIntegrating Splunk into your Spring Applications
Integrating Splunk into your Spring Applications
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

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)
  • 8. GETTING STARTED Preparing your development environment
  • 9. DOWNLOADS & INSTALLATIONS • Install a Code Editor - http://Code.VisualStudio.com • Install Git - http://git-scm.com • Install Node.js - http://nodejs.org
  • 10. NPM INSTALLATIONS • Install Johnny-Five npm install -g johnny-five • Install Particle-CLI npm install -g particle-cli • Install Nitrogen CLI npm install -g nitrogen-cli
  • 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/
  • 12. MAKER 101 The fundamentals of maker development kits
  • 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)
  • 19. PACKAGE.JSON { "name": "IoT-Labs-Photon", "repository": { "type": "git", "url": "https://github.com/ThingLabsIo/IoTLabs/Photon" }, "version": "0.1.0", "private": true, "dependencies": { "johnny-five": "^0.8.0", ”particle-io": "^0.8.1” } } cd C:DevelopmentIoTLabs npm install
  • 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";
  • 22. LAB 02: READING ANALOG INPUT Ambient Light Detection
  • 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;
  • 25. LAB 03: INPUT CONTROLS OUTPUT Night Light
  • 28. CONNECTED THINGS 101 The fundamentals of connecting Things to the Cloud
  • 29. LAB 04: SENDING DATA TO THE CLOUD Nitrogen
  • 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
  • 34. LAB 05: COMMAND & CONTROL CommandManager
  • 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
  • 37. LAB 06: CONNECTING MULTIPLE THINGS Permissions
  • 38. 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>
  • 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)
  • 42. ANATOMY OF AN ARDUINO YÚN Atheros AR9331ATmega32u4
  • 43. ANATOMY OF AN ARDUINO YÚN (CONT’D) AR9331 LinuxWi-Fi Ethernet Micro USB USB Host ATmega 32u4 MicroSD
  • 44. ANATOMY OF AN ARDUINO YÚN (CONT’D) Digital IO 1-13 Analog Output 0-53.3V, 5V, GND GND