Yesterday, Internet changed our life. Today IoT is doing it all over again..
22 Billions of devices are expected to be part of IoT by 2020 – Gartner
Game Changers
Is this enough to get there?
Hack the IoT world with JavaScript Sajan John | Twitter:@sajanjohn
Idea Source: http://www.odetocode.com
Idea Source: http://www.odetocode.com
Why JavaScript? 1. Most popular language in the world today! 2. JavaScript is everywhere now! 3. Asynchronous 4. Easy learning curve 5. A language that can be used at back/middle/front-end layers 6. Light foot print 7. Efficient Memory Management 8. Node.Js and NPM
Node.js + arduino = magic!
Node.js + arduino + Gestures = Fun! https://www.youtube.com/watch?v=9rOXkKefzRU
Frameworks for hardware programming Johnny-Five.js Cylon.js
Ever growing community Write your own framework Using Node Serial Port and Node Web Socket.
 Write in JS and control Arduino  Use Firmata Protocol to communicate with Arduino  Can be used with Accelerometer, Button, Compass, Led, Joystick, Motor, (Ultrasonic) Ping, Proximity IR, Range IR, Sensor, Servo, Sonar  Running on a node.js server  Excellent for internet and cloud programming Johnny-Five
Demo – 1 : Let there be light!
 Install Arduino IDE  Install Node.js  npm install johnny-five  Upload Firmata to your arduino  Open Arudino IDE  Go to File > Examples > Firmata > StandardFirmata Johnny-Five Demo var five = require("johnny-five"), led, board; board = new five.Board(); board.on("ready", function(){ led = new five.Led(12) led.strobe(1000); })
Road Ahead - Classes - Modules - Lexical block scope (let, constant) - Concise method - Lambada operator - Binary and Octal literals - Mobile Controlled - NUI driven – Gesture / Voice - Wearable - Listening Walls - Learning Algorithms ES 6 IoT
Demo – 2 : Smart Home concept
Removed the video due to size restriction. You can watch the poorly recorded back up demo here https://www.youtube.com/watch?v=YMIduKslE7M
 Remote car is driven using JavaScript  When the car enters the garage lights will turn on automatically and turn off when it leaves the garage – using IR sensors  Chrome speech synthesizer integrated for voice commands  Socket used for mobile / remote control of appliances  Tech stack – Node.Js, Socket.Io, Johhny-Five, Express Js , Arudino Uno, Raspberry Pi, IR Sensors and Relays Smart Home Demo
Thank You

Hacking into IoT using JavaScript

  • 3.
    Yesterday, Internet changed ourlife. Today IoT is doing it all over again..
  • 4.
    22 Billions ofdevices are expected to be part of IoT by 2020 – Gartner
  • 5.
  • 6.
    Is this enoughto get there?
  • 7.
    Hack the IoTworld with JavaScript Sajan John | Twitter:@sajanjohn
  • 8.
  • 9.
  • 10.
    Why JavaScript? 1. Mostpopular language in the world today! 2. JavaScript is everywhere now! 3. Asynchronous 4. Easy learning curve 5. A language that can be used at back/middle/front-end layers 6. Light foot print 7. Efficient Memory Management 8. Node.Js and NPM
  • 11.
  • 12.
    Node.js + arduino+ Gestures = Fun! https://www.youtube.com/watch?v=9rOXkKefzRU
  • 13.
    Frameworks for hardwareprogramming Johnny-Five.js Cylon.js
  • 14.
    Ever growing community Writeyour own framework Using Node Serial Port and Node Web Socket.
  • 15.
     Write inJS and control Arduino  Use Firmata Protocol to communicate with Arduino  Can be used with Accelerometer, Button, Compass, Led, Joystick, Motor, (Ultrasonic) Ping, Proximity IR, Range IR, Sensor, Servo, Sonar  Running on a node.js server  Excellent for internet and cloud programming Johnny-Five
  • 16.
    Demo – 1: Let there be light!
  • 17.
     Install ArduinoIDE  Install Node.js  npm install johnny-five  Upload Firmata to your arduino  Open Arudino IDE  Go to File > Examples > Firmata > StandardFirmata Johnny-Five Demo var five = require("johnny-five"), led, board; board = new five.Board(); board.on("ready", function(){ led = new five.Led(12) led.strobe(1000); })
  • 18.
    Road Ahead - Classes -Modules - Lexical block scope (let, constant) - Concise method - Lambada operator - Binary and Octal literals - Mobile Controlled - NUI driven – Gesture / Voice - Wearable - Listening Walls - Learning Algorithms ES 6 IoT
  • 19.
    Demo – 2: Smart Home concept
  • 20.
    Removed the videodue to size restriction. You can watch the poorly recorded back up demo here https://www.youtube.com/watch?v=YMIduKslE7M
  • 21.
     Remote caris driven using JavaScript  When the car enters the garage lights will turn on automatically and turn off when it leaves the garage – using IR sensors  Chrome speech synthesizer integrated for voice commands  Socket used for mobile / remote control of appliances  Tech stack – Node.Js, Socket.Io, Johhny-Five, Express Js , Arudino Uno, Raspberry Pi, IR Sensors and Relays Smart Home Demo
  • 22.

Editor's Notes

  • #3 Good day everyone. Thank you for joining us today. Last year, Cisco launched a campaign on IoT that kind of give us a glimpse to the future. Let’s watch the video to refresh your memory. Some of those scenes are almost like lifted form a science – fiction movie right? What if I tell you, If you are a web programmer, with less than 2000 rs and few days in hand can recreate some of those moments we saw in the video?
  • #4 Everything will change. All the repetitive mundane work will take over by smart algoirthams. Power companies read meters through tele-metering systems instead of visiting houses; doctors remotely monitor the conditions of their patients 24/7 by having the patients use devices at home instead of requiring the patients to stay at hospital; vehicle-mounted terminals automatically display the nearest parking space; sensors in smart homes turn off utilities, close windows, monitor security, and report to homeowners in real time. These are scenarios that only existed in science fiction previously What exactly IoT is dong to you. It will change the way you are using everything in your life. Everything is getting smarter day by day A smart car A Smart home A smart healthcare system Sensing layer Communication layer Management layer
  • #6 arduino_  Can be connected to sensors and actuators  14 digital input / output pins and 6 analog input  Communication is done by sending or receiving 0V – 5V Enter Arduino - Electronics for common man!  singleboard micro-controller open sourced  16MHz micro-controller  Easy to progam  Open Source!  Great for driving motors, reading sensors BUILDING ROBOTS! ! ! a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python.
  • #7 For IoT to become as widespread as everyone hopes, system designers will need a “make-it-to-fit, light-weight, OS-independent platform" and "cool [IoT] apps” that can help break through separate ecosystem walls of many embedded systems. For IoT to become as widespread as everyone hopes, we will need a development language that is light weight, OS-independent and have the ability to break through the closed eco systems and walls of many embedded systems For IoT to become as widespread as everyone hopes, we will need a development language that is light weight, OS-independent and have the ability to break through the closed eco systems and walls of many embedded systems
  • #8 My name is Sajan and I am here to advocate how JS can be your friend as a prototyping tool for production ready IOT implementation.
  • #11  There was a time when turning an LED on and off using a microcontroller took a week, and detailed knowledge of the microcontroller. But that was before Arduino. But even with Arduino people sometimes found it hard to hack together the things the wanted to do, especially when you had to deal with networks, something that was traditionally seen as hard on an Arduino. What is the core concept behind Huge community support. Huge knowledge base Existing API, plugins, libraries JS is everywhere! Every hardware and every layer in the application JavaScript utility libraries like Underscore.js, lodash, traverse and Async can be perfect to use in a range of common situations across different devices. There are some very powerful functions in the above modules that would be useful to IoT projects. Platform written in JS using Chrome V8 runtime engine Written in C++ - efficient Event based model – great for hardware hacking! Extremely efficient and light weight NPM – 97000+ packages node.js is a server-side solution for JavaScript—it’s an event-driven Javascript platform which does non-blocking I/O—and is rapidly gaining popularity, and mindshare amongst the web community. It’s that popularity and the arrival
  • #12 What Node + Arduino = Magic! Using JavaScript as controller software of these hardwares. ! ! ! NODEJS + HW Framework uController + Special Firmware Serial Comm • Serial communication is made by a node package called serialport • Special Firmware let you control your hardware over serial comminaciton with JavaScript.
  • #13  node.js is a server-side solution for JavaScript—it’s an event-driven Javascript platform which does non-blocking I/O—and is rapidly gaining popularity, and mindshare amongst the web community. It’s that popularity and the arrival of boards that natively speak Javascript—like the Tessel or the Espruino—that means that a third community is now growing.
  • #14 Johnny-Five • Compitable with almost every electronic board : Beagle Bone, Intel Galileo,Pinoccio,Raspberry Pi, Spark Core, Arduino of course. • Uses node-serialport package by Chris Williams • Has a large community : NodeBots, NodeCopter, NodeRocket ! Cylon.js—a JavaScript framework for robotics, physical computing, and the Internet of Things written for node.js.
  • #15 From the Node.js side I like to use Node Serial Port and then a Node Web Socket implementation to keep things near real-time. This way I can push to the Arduino, or stream data from it. Not that you can’t with the Firmata/Johnny-Five setup.
  • #19 TBD ES6 Features JavaScript & IoT future plans IoT Today Mobile Controlled Mobile Keyless entry Wifi security camera Connected fitness tracker Tomorrow Listening walls Learning alogirthms that connected to variious sensors Efficient smart homes that auto learn and control the events Connected wellness monitoring Class SmartHome { } Convnetjs, brain.js, synaptic.js mind.sourcefroge.net .