Internet of things

IT Pro Camp Jax 2015
By David Fekke

DISCLAIMER

  • Please recite the following oath with the presenter
  • If I _state_your_name_ electrocute myself after trying to replicate something from this presentation, I swear that neither I nor any loved ones or members of my extended family will sue this presenter pursuant to all Federal, state and local laws, including those in international and intergalactic jurisdictions.   

IoT

  • Internet of Things
  • This is about wanting to program hardware
  • The components for building your own hardware has become very inexpensive
  • Getting to the point where almost any device can have its own IP address

The internet is everywhere

  • Desktop Computers
  • Mobile devices
  • Wi-Fi enabled microcontrollers
  • Thermostats, Nest
  • Refrigerators, (SAMSUNG)
  • Your Car (3G Data)

Example iot device


BIG DATA

  • IoT devices collect lots of data
  • Data can be analyzed with tools like Hadoop
  • AWS and Azure both have Big Data
    and Machine learning solutions  

Wearables

Apple Inc. Reveals Bigger-Screen iPhones Alongside Wearables

Wi-fi chip


CC3000
IEEE 802.11 b/g Compatible
SmartConfig iOS/Android Config

Bluetooth LE 4.0

Been available for about 3 years
Supported by most Android and iOS devices
Supported by Mac OS X and Linux
Not supported by Windows :-(
Wireless serial connection
Many device profiles supported or create your own
Generic Attribute Profiles (GATT)
Examples include Heart Monitors, iBeacon, Keyboards
Security missing from Spec, roll your own
Recommend using HMAC256

Microcontrollers

  • Not computers
  • Write programs as firmware
  • Some come with Wi-Fi
  • Inputs and outputs
  • Digital and Analog
  • Not enough power to stream video or audio
  • Wire up servos, lights, sensors, speakers and cameras
  • Power robots

Arduino


  • Introduced in 2005
  • Connect to USB
  • 12 Digital pins, 6 Analog
  • All kinds of shield modules
  • Firmware written in C, C++

Spark Core


  • Wi-Fi chip built-in
  • ARM processor
  • Always connected cloud service
  • Web based IDE, C and C++
  • New node compatible firmware

Particle photon


Same form factor as Spark Core
Uses Broadcom chip
Has faster processor an more memory

ESPrUINO


  • Introduced in 2013
  • Javascript based microcontroller
  • Does not run V8 or node
  • Does not have Wi-Fi, but can be added
  • 72Mhz ARM microcontroller with
    256KB of Flash memory and 48KB of RAM

Esprino pico

Espruino Pico
Introduced this Spring
Same size as Spark Photon
Same JavaScript as last Esprino
Very easily solder to your projects, and Bluetooth or Wi-Fi modules

Tessel


  • Released June 2014 supposedly
  • Runs Node code
  • Has modules, reduces the need to solder or breadboard
  • Wi-Fi CC3000 built into board
  • Modules include Servo interface, GPS, GPRS, Bluetooth, accelerometer, climate, camera, infrared and SD Card reader

tessel 2


Node, Rust and Python
Runs OpenWRT
2 modules, 2 USB and Ethernet
Just $35!

Netduino


  • Modeled after Arduino
  • Runs .NET code
  • .NET micro framework
  • Can use this with Linux and Mac OS X

Raspberry PI


  • Full computer with ARM processor
  • Runs different versions of Linux
  • HDMI output, 2 USB ports, Ethernet
  • GPIO digital ports, no analog ports
  • Model a/b, 256 and 512 MB RAM
  • Runs Node.js

RASPBERRY PI 2


New 4 core 900 Mhz processor
Can run Windows 10!!!

Beaglebone black


Similar to Raspberry Pi
2x46 pins
Runs Debian, Android and Ubuntu

GALILEO

FPO
Arduino compatible
100 MB Ethernet Port
USB host and client port
Quark SOC chip

CHIP $9 computer

Built for work, play, and everything in between!       \(•◡•)/
1Ghz P + 512MB Ram + 4GB storage
WiFi + Bluetooth LE
RGB and HDMI breakout modules

Many others

  • Most boards and standard firmware are open source
  • Many knockoffs of the Arduino, ATMega chip
  • ARM Microprocessors are becoming common
  • Common to see these on Kickstarter
  •  Intel Edison SoC will run Node.js 70 pins

Arduino code

  • Requires void setup() and void loop() methods
// Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }


Johnny-five

  • Rick Waldrons framework for controlling microcontrollers
  • Pre-built modules for different boards, buttons, gyros, IR, Led, motor, pin, relay, sensor, servo, sonar and steppers
var five = require("johnny-five"), 
                board = new five.Board();
            
            board.on("ready", function() {
            
              var servo = new five.Servo({
                pin: 12, 
                type: "continuous"
              });
            
              // Clockwise, top speed.
              servo.cw(1);
            });

JS Language support

  • Many languages supported through tethering
  • Firmware usually written C
  • Chris WIlliams created Node-serial
  • Many NPM modules written for interfacing with controllers
  • Johnny-five written by Rick Waldron
  • Cylon.js also popular
  • Arduinos will use Standard Firmata firmware
  • Spark Cores will use Voodoo firmware
  • Tessels support Node natively through Lua

Why use javascript

  • Most microcontrollers run inside of a run loop
  • Requires break and interrupt logic
  • Difficult to do more than one thing at a time
  • Javascript is more accessible than  C or C++
  • Javascript is asynchronous, and can do multiple things at the same time inside of a single thread
  • Javascript is the best language for programming robots
  • NPM libraries make programming different kinds of hardware easy

electrical engineering for dummies

  • V = I R
  • Voltage = Current x Resistance
  • Albert Einstein said that the fact that this equation is so simple, it was proof that there was a God
  • 5 Volts considered standard voltage for most electronics
  • There is a push to make 3.3 Volts the standard
  • Check the tolerance of your microcontroller, some will go as high as 12 or 15 Volts
  • If you burn something out, these things are cheap
  • Test your circuits on a breadboard, then solder 
  • Check max amps, and find correct resister
  • Please unplug from a power source while wiring

Digital communication

Many sensors can communicate using an address
Many different protocols can be used
GPIO - can use single pin
SPI - fast, multiple devices but requires 3 pins
I2C - only 2 pins, 2 way communication
UART - slower than SPI or I2C, 1 device only 

Breadboard


hopefully this demo won't
make your HEAD Explode




Questions

?

Contact me

  • David Fekke
  • email me at David Fekke at gmail dot com
  • On Skype as my first name and last name as one word
  • Twitter @davidfekke and @jaxnode
  • Thanks for coming out tonight
  • Once again, please don't electrocute yourself and sue me