Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How To Electrocute Yourself using the Internet


Published on

A talk about the Internet of things, Arduino and JavaScript frameworks including BreakoutJS and Johnny-Five

Published in: Technology, Business
  • Be the first to comment

How To Electrocute Yourself using the Internet

  3. 3. Tom Scott being Electrocuted as part of a PayPal charity hack. (
  4. 4. Matt, of SI Digital, being shocked.
  5. 5. WHAT I'M GOING TO BE TALKING ABOUT Internet of Things Arduino Johnny Five BreakoutJS
  6. 6. Today computers—and, therefore, the Internet—are almost wholly dependent on human beings for information ... The problem is, people have limited time, attention and accuracy—all of which means they are not very good at capturing data about things in the real world ... We're physical, and so is our environment ... Ideas and information are important, but things matter much more. Yet today's information technology is so dependent on data originated by people that our computers know more about ideas than things. If we had computers that knew everything there was to know about things—using data they gathered without any help from us—we would be able to track and count everything. - Kevin Ashton
  7. 7. XIVELY Cloud Based Service Users send JSON, XML or CSV to a RESTful API Amalgamates data from around the world and stores it Data is also accessible through AJAX requests
  8. 8. WHAT CAN YOU USE THE INTERNET OF THINGS FOR? MONITORING AN ENVIRONMENT Moderating the temperature in your house Making sure you're not being broken in to REACTING TO DATA FROM AN ENVIRONMENT Printing out the news every morning Flashing a light when someone enters a room ... ... on the other side of the world
  11. 11. MAKE THE COSM Pulls from Xively based on a user defined search term Data is updated in real time User can use the data provided to trigger sounds
  12. 12. STRAVA Gathers data about your surrounding area Transfers this data to a server which aggregates Server reacts to the data you post
  13. 13. ARDUINO
  14. 14. WHAT IS AN ARDUINO? Open Source Microcontroller board with addressable GPIO pins Various form factors depending on need Communicates with electronics using GPIO pins
  15. 15. GUH-PEE-OH WHAT? General Purpose Input and Output Can be used to receive and transmit current to electronic components Can also be used to pass messages to serial input Are how the Microcontroller talks to the outside world
  16. 16. PINS ON THE ARDUINO Normal pins which can be set high or low Analogue and PWM Pins Analogue pins which can read values between 0 and 1023 PWM Pins can be set to values between 0 and 255
  17. 17. WARNING WINDOWS USERS You will have to bypass windows security to install drivers for the Arduino. Drivers are unsigned by Arduino As such, you will need to disable Driver Signature Checking
  18. 18. S.H.I.E.L.D.S. Not a comic law enforcement agency (in this case) Add on to an Arduino which extends functionality Can be stacked, but some care does need to be taken
  19. 19. S.H.I.E.L.D. REQUIREMENTS Plugs to the non-GPIO pins need to reach all shields. Each shield will have outputs which need to be left unconnected to. Outputs to the Arduino need to be unique.
  20. 20. PROGRAMMING AN ARDUINO Breaks down in to two main types Code that is compiled to C / C++ and uploaded to the microcontroller Code that communicates with the board and issues commands
  21. 21. BREAKOUT JS; WHAT? Javascript based framework Can be ran in a web page Needs Arduino to be connected to a computer Needs a server to run on your computer Resulting web page can be connected to from any device on the local network
  22. 22. BREAKOUT JS; HOW? Install the Firmata firmware Open the file located in the Breakout zip in the firmware folder Upload it to the board using any compatible IDE
  23. 23. BREAKOUT JS; INSTALLING THE SERVER Depends on which server you want to install; Java or Node
  24. 24. USING THE JAVA SERVER Unzip the folder relevant to your Operating System MacOS, Linux, Windows x32 & x64 Run the resulting Executable
  25. 25. USING THE NODE SERVER Install NodeJS Navigate to the node_server folder in command line Run “npm install” to install all dependencies “node server.js” starts the server
  26. 26. WHAT THE API LOOKS LIKE Classes for most things you would connect to an Arduino Mixed in amongst normal Javascript and HTML BO and JSUTILS namespacing
  27. 27. BO.I2CBase, BO.IOBoard, BO.IOBoardEvent, BO.PhysicalInputBase, BO.Pin, BO.PinEvent, BO.WSocketEvent, BO.WSocketWrapper, BO.custom.ID12RFIDReader, BO.custom.RFIDEvent, BO.filters.Convolution, BO.filters.FilterBase, BO.filters.Scaler, BO.filters.TriggerPoint, BO.generators.GeneratorBase, BO.generators.GeneratorEvent, BO.generators.Oscillator,,,,,,,,,,,,,,,,,,,,,,, JSUTILS.Event, JSUTILS.EventDispatcher, JSUTILS.SignalScope, JSUTILS.Timer, JSUTILS.TimerEvent
  28. 28. HELLO WORLD EXAMPLE vrIBad=B.Oor; a Oor OIBad vrIBadvn =B.OorEet a OorEet OIBadvn; vrLD=B.oLD a E Oi.E; vrBto =B.oBto; a utn Oi.utn vrBtoEet=B.oBtoEet a utnvn Oi.utnvn; vrhs =wno.oainhsnm; a ot idwlcto.otae / i tefl i oee lcly sttehs t "oahs" / f h ie s pnd oal, e h ot o lclot i (idwlcto.rtclidxf"ie" ==0 { f wno.oainpooo.neO(fl:) = ) hs ="oahs" ot lclot; } vradio=nwIBadhs,88) a run e Oor(ot 87; adioadvnLsee(OorEetRAY oRay; run.dEetitnrIBadvn.ED, ned) fnto oRayeet { ucin ned(vn) / Rmv teeetlsee bcuei i n lne nee / eoe h vn itnr eas t s o ogr edd adiormvEetitnrIBadvn.ED,oRay; run.eoevnLsee(OorEetRAY ned) vrld=nwLDadio adiogtiiaPn1); a e e E(run, run.eDgtli(1) bto =nwBto(run,adiogtiiaPn2) utn e utnadio run.eDgtli(); bto.dEetitnrBtoEetPES oPes; utnadvnLsee(utnvn.RS, nrs) bto.dEetitnrBtoEetRLAE oRlae; utnadvnLsee(utnvn.EES, nees) $'bnet)o(cik,trLdf) (#tLf'.n'lc' uneOf; $'bnih'.n'lc' trLdn; (#tRgt)o(cik, uneO) }
  29. 29. HELLO WORLD EXAMPLE fnto trLdnet { ucin uneO(v) / Tr teLDo / un h E n ldo(; e.n) } fnto trLdf(v){ ucin uneOfet / Tr teLDof / un h E f ldof) e.f(; } fnto oPeset { ucin nrs(v) / gtarfrnet tebto ojc ta frdteeet / e eeec o h utn bet ht ie h vn vrbn=ettre; a t v.agt $'sae)hm(Bto "+bnpnubr+"sae Pesd) (#tt'.tl"utn t.iNme tt: rse"; } fnto oRlaeet { ucin nees(v) / gtarfrnet tebto ojc ta frdteeet / e eeec o h utn bet ht ie h vn vrbn=ettre; a t v.agt $'sae)hm(Bto "+bnpnubr+"sae Rlae"; (#tt'.tl"utn t.iNme tt: eesd) }
  30. 30. CONNECTING TO THE INTERNET WITH BREAKOUTJS BreakoutJS runs in a web page Treat it like any other Javascript Library XMLHttpRequest() is something you can use Or jQuery.ajax() if you prefer! No extra shields needed to extend functionality
  31. 31. WHAT WOULD YOU USE BREAKOUTJS FOR? Large scale hacks which need monitoring Systems which you can adjust over an internal network Setting the colour of lights using a colour picker Monitoring the heating and adjusting a thermostat Deciding which person to administer an electrical shock to
  32. 32. JOHNNY FIVE
  33. 33. JOHNNY FIVE; WHAT? NodeJS based framework Needs the Arduino connected to the computer running Johnny Five
  34. 34. JOHNNY FIVE; HOW? Upload the "StandardFirmata" Arduino example to your Arduino Install NodeJS Pick a directory nmisaljhn-ie p ntl onyfv
  35. 35. WHAT DOES THE API LOOK LIKE? Creating instances of hardware objects and passing initiation properties vrsro=nwfv.ev(0; a ev e ieSro1) servo.min(), servo.max(),, move(deg), sweep(deg)
  36. 36. HELLO WORLD EXAMPLE vrfv =rqie"onyfv",bto,ld ltol a ie eur(jhn-ie) utn e, iBo; vrbad=nwfv.or(; a or e ieBad) bado(ray,fnto( { or.n"ed" ucin) /Oc tebadi rayadteclbc frs yu cd ge hr! /ne h or s ed n h alak ie, or oe os ee ltol=fle iBo as; ld=fv.e(3; e ieLd1) bto =nwfv.utn8; utn e ieBto() bto.n"on,fnto( { utno(dw" ucin) i(iBo = fle{ fltol = as) ldof) e.f(; }le es{ ldo(; e.n) } ltol=!iBo; iBo ltol }; ) bto.n"od,fnto( { utno(hl" ucin) ldsrb(; e.toe) }; ) }; )
  37. 37. CONNECTING TO THE INTERNET WITH JOHNNY FIVE Johnny Five is just a Node package Treat it like any other Node Library Connecting to API's is the same as you normally would with NodeJS No extra shields needed either!
  38. 38. WHAT WOULD YOU USE JOHNNY FIVE FOR? Autonomously monitoring and adjusting Inteligently regulating an aquarium Building a little robot to intelligently avoid walls Letting twitter decide who to administer a shock to
  39. 39. The Internet of Things is already here! No concrete definition; make it your own We can take part with (relative) ease BreakoutJS : Watch and control your environment Johnny Five : Control your environment with AI