diy technology for the internet of things

36
DIY Technology for the Internet of Things Dr. Simon Monk

Upload: srmonk

Post on 05-Jul-2015

461 views

Category:

Technology


3 download

DESCRIPTION

These are the slides for the presentation that I gave at ICMEAE in Cuernavaca, Mexico on November 20th, 2014. This includes an example using Spark Core.

TRANSCRIPT

Page 1: DIY Technology for the Internet of Things

DIY  Technology  for  the  Internet  of  Things  

Dr.  Simon  Monk  

Page 2: DIY Technology for the Internet of Things

Simon  Monk  

•  Full-­‐;me  Author  -­‐  Open  Source  Hardware  and  Electronics  

Page 3: DIY Technology for the Internet of Things

Objec;ves  

•  What  is  the  Internet  of  Things  (IoT)?  •  Where  is  IoT  going  •  Making  IoT  devices?  •  An  example  technology:  the  Spark  Core  

Page 4: DIY Technology for the Internet of Things

What  is  the  Internet  of  Things?  

•  First  there  was  the  Internet  – Websites  serve  knowledge  – Browsers  are  the  terminal  nodes  of  the  network  

•  Now  the  Internet  of  Things  –  IoT  devices  can  be  terminal  nodes  – Websites  control  hardware  – Devices  talk  to  users  and  other  machines  using  the  Internet  

Page 5: DIY Technology for the Internet of Things

IoT  Examples  •  Home  automa;on  –  Smart  thermostats  (Nest  and  similar)  –  Ligh;ng,  access  control  

•  Automo;ve  •  Personal  – Health  and  ac;vity  monitoring  (on  your  wrist)  –  Keeping  an  eye  on  distant  loved-­‐ones  

•  Sensor  Networks  –  Radia;on  monitoring  following  Fukushima  disaster  

•  Energy  Management  –  Smart  appliances  

Page 6: DIY Technology for the Internet of Things

Nest  

•  Smart  Learning  Thermostat  

•  WiFi  enabled  remote  control  from  Smartphone  app  

•  Nest  account  allows  link  to  ‘The  Cloud’  

Page 7: DIY Technology for the Internet of Things

RunKeeper  

•  Uses  Smartphone  as  IoT  device  but  data  stored  in  ‘The  Cloud’  

•  Tracks  running  or  cycling  using  GPS  

Page 8: DIY Technology for the Internet of Things

Safecast  •  In  response  to  Fukushima  –   Official  informa;on  inadequate  –   It  filled  the  informa;on  gap  – Crowd-­‐sourced  solu;on  in  place  reassuring  people  very  quickly  

•  Hacker  Space,  OSH  (Open  Source  Hardware)  Design,  Data  CC  0  (Completely  free  to  all)  

•  Watching  the  planet  – Global  warming,  tsunami,  magnetometry  

Page 9: DIY Technology for the Internet of Things

Safecast  Hardware  

•  Geiger  Counters  all  sold  out  •  Data  logging  Geiger  Counter  •  HackerSpace  First  Genera;on  

•  Hang  device  out  of  car  window  (GPS)  

•  Arduino,  off-­‐the-­‐shelf  modules  

Page 10: DIY Technology for the Internet of Things

Safecast  So^ware  

•  Hardware  no  good  unless  data  gathered  and  visualised.  

 

Page 11: DIY Technology for the Internet of Things

Energy  Management  

•  Smart  Meters  – Send  usage  data  to  server  every  few  minutes  – Eventually  con;nuously  variable  energy  pricing  – Automa;c  control  of  non  ;me-­‐cri;cal  appliances  •  Run  washing  machine  when  demand  low  •  Boost  freezer  to  low  temperature  at  low  demand  

Page 12: DIY Technology for the Internet of Things

Where  is  IoT  Going?  

•  Gartner  Report  on    IoT  2014  Predicts  – 36.2%  growth  in  2015  – Home  and  Automo;ve  will  drive  growth  –  Inexpensive  devices  are  the  biggest  enabler  of  IoT  takeup  

Page 13: DIY Technology for the Internet of Things

Technology  for  IoT  

•  WiFi  enabled  Microcontrollers  •  Cellular  modem  technology  

Page 14: DIY Technology for the Internet of Things

IoT  on  WiFi  

•  Problem  

– WiFi  is  power  hungry  

•  Solu;on  

– Power  Management  of  device  (sleep  when  not  needed)  

Page 15: DIY Technology for the Internet of Things

IoT  on  WiFi  

•  Problem  

– WiFi  needs  password  to  connect  to  LAN  (Local  Area  Network)  

•  Solu;on  

– One-­‐;me  configura;on  

•  Temporary  WLAN  run  by  device  

 

Page 16: DIY Technology for the Internet of Things

IoT  on  WiFi  

•  On  LAN  communica;ng  with  Internet  

•  Send  requests  to  IoT  device  from  Internet  (E.g.  Open  Door!)  

•  Allow  IoT  device  to  send  data  to  cloud  (E.g.  Temperature  is  20C)  

Page 17: DIY Technology for the Internet of Things

IoT  on  WiFi  (Security)  

•  Hacking  gets  physical!  •  An  ahack  on  your  actual  home?  

•  Cloud  Programming  of  IoT  Device!  

•  Authen;ca;on  Tokens  •  SSL  

Page 18: DIY Technology for the Internet of Things

IoT  on  WiFi  (Data  Ownership)  

•  Physical  Data  Collected  – E.g.  Energy  usage  –  Is  the  home  empty?  – Targeted  marke;ng  of  products  – The  Cloud  knows  you  too  well?  – Health  data  – Smart  TV  viewing  habits    

Page 19: DIY Technology for the Internet of Things

DIY  IoT  

•  Arduino  +  WiFi  shield  – Looks  old  fasioned  

•  Arduino  Yun  – Expensive  

•  Spark  Core  – Designed  for  IoT  

Page 20: DIY Technology for the Internet of Things

IoT  with  Spark  Core  

•  WiFi  •  ARM  Cortex  M3  (72MHz)  •  128kB  Flash  •  USB2.0  •  12  bit  ADC  •  USART,  SPI  &  I2C  •  Breadboard  Friendly  •  18  I/O  pins  (3V)  logic  

Page 21: DIY Technology for the Internet of Things

IoT  with  Spark  Core  

•  Configura;on  Smartphone  App  

•  USB  Configura;on  •  Registers  with  Cloud  •  Built-­‐in  Firmware  works  with  Smartphone  App  to  control  pins  

•  Program  from  the  Cloud  

Page 22: DIY Technology for the Internet of Things

IoT  with  Spark  Core  •  Example  Project  –  Buzzy  Bee  

Page 23: DIY Technology for the Internet of Things

Test  Hardware  

Page 24: DIY Technology for the Internet of Things

Custom  Program  

•  Cloud  IDE  •  Flash  over  Internet  

•  Arduino  C  •  Func;ons  and  Variables  

•  REST  interface  

Page 25: DIY Technology for the Internet of Things

Test  with  curl  

Page 26: DIY Technology for the Internet of Things

Make  a  Web  Page  (head)  <html>!<head>!<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>!!<script>!var accessToken = "64a329ab1ddfaabc01838f744c0e5e243eee";!var url = "https://api.spark.io/v1/devices/55ff6b065075551487/buzz";!!function buzz()!{!

!$.post(url, {params: 1, access_token: accessToken });!} !!function noBuzz()!{!

!$.post(url, {params: 0, access_token: accessToken });!

} !</script>!</head>!!

Page 27: DIY Technology for the Internet of Things

Make  a  Web  Page  (body)  <body>!<h1>Buzzy Bee</h1> !!<h2 onClick="buzz()">BUZZ</h2>!<h2 onClick="noBuzz()">NO BUZZ</h2>!</body>!</html>!

Page 28: DIY Technology for the Internet of Things

Try  it  Live!  

•  hhp://monkmakes.com/buzz.html  

Page 29: DIY Technology for the Internet of Things

IoT  with  Spark  Core  •  Example  Project  –  Light  Sensor  •  Hardware  

Page 30: DIY Technology for the Internet of Things

IoT  with  Spark  Core  •  Example  Project  –  Light  Sensor  •  So^ware  int light = 0.0;!!void setup(){! Spark.variable("light", &light, INT);!}!!void loop() {! light = analogRead(lightSensorPin);!}!

Page 31: DIY Technology for the Internet of Things

IoT  with  Spark  Core  

Page 32: DIY Technology for the Internet of Things

IoT  with  Spark  Core  (Web  Page)  function getLight()!{!

!$.getJSON(url, gotResult);!!after()!

} !!function gotResult(result) !{!

!!!$("#light").html(result.result);!

}!!setInterval(getLight, 1000);!!!<h2 style="font-size:40pt;"id="light">-</h2>!

Page 33: DIY Technology for the Internet of Things

Try  it  Live!  

•  hhp://monkmakes.com/light.html  

Page 34: DIY Technology for the Internet of Things

IoT  Encapsulated  

•  Low  cost  Module  •  All  WiFi  wrapped  up  •  Simplifies  design  and  shortens  product  development  ;mes  

•  Many  products  can  benefit  from  adding  IoT  capability  

Page 35: DIY Technology for the Internet of Things

Summary  

•  More  and  more  devices  are  being  connected  to  the  Internet  

•  With  low-­‐cost  modules  that  can  act  as  a  microcontroller  with  IoT  almost  for  free,  adding  it  to  a  product  becomes  feasible  

•  The  Open  Source  movement  is  changing  aptudes  to  who  owns  data  –  slowly  

Page 36: DIY Technology for the Internet of Things

Contact  

•  Twiher:  @simonmonk2  •  Web:  www.monkmakes.com  •  Email:  [email protected]  

•  Blog:  www.doctormonk.com