prototyping hardware

45
Your Own JavaScript Army (prototyping devices doesn't have to suck) @noopkat | meow.noopkat.com/iotd-2014 1

Upload: suz-hinton

Post on 18-Jul-2015

65 views

Category:

Technology


0 download

TRANSCRIPT

Your Own JavaScript Army

(prototyping devices doesn't have to suck)

@noopkat | meow.noopkat.com/iotd-2014 1

Suz Hinton

hardware enthusiast

@noopkat | meow.noopkat.com/iotd-2014 2

If you dare

git clone https://github.com/noopkat/blend-micro-io.gitnpm installnode test.js

@noopkat | meow.noopkat.com/iotd-2014 3

...

I like to make stuff

@noopkat | meow.noopkat.com/iotd-2014 4

...

I like to make fun stuff

@noopkat | meow.noopkat.com/iotd-2014 5

@noopkat | meow.noopkat.com/iotd-2014 6

@noopkat | meow.noopkat.com/iotd-2014 7

@noopkat | meow.noopkat.com/iotd-2014 8

IoT

— Application code

— Data

— Security

@noopkat | meow.noopkat.com/iotd-2014 9

IoT

— Application code

— Data

— Security

— Devices

@noopkat | meow.noopkat.com/iotd-2014 10

...

Internet of Things

@noopkat | meow.noopkat.com/iotd-2014 11

...

Internet of Things

@noopkat | meow.noopkat.com/iotd-2014 12

...

Building hardware

@noopkat | meow.noopkat.com/iotd-2014 13

...

Building hardware

@noopkat | meow.noopkat.com/iotd-2014 14

Standard Prototyping Workflow

1. Arduino

@noopkat | meow.noopkat.com/iotd-2014 15

Standard Prototyping Workflow

1. Arduino

2. Sensors/hardware

@noopkat | meow.noopkat.com/iotd-2014 16

Standard Prototyping Workflow

1. Arduino

2. Sensors/hardware

3. Write C, or loosely related language

@noopkat | meow.noopkat.com/iotd-2014 17

Standard Prototyping Workflow

1. Arduino

2. Sensors/hardware

3. Write C, or loosely related language

4. Write -> compile -> upload

@noopkat | meow.noopkat.com/iotd-2014 18

Standard Prototyping Workflow

1. Arduino

2. Sensors/hardware

3. Write C, or loosely related language

4. Write -> compile -> upload5. Write -> compile -> upload6. Write -> compile -> upload

@noopkat | meow.noopkat.com/iotd-2014 19

More Pain

— Dependency management

— fragmented library sources

@noopkat | meow.noopkat.com/iotd-2014 20

(�°□°)�� ���(�°□°)�� ���(�°□°)�� ���(�°□°)�� ���@noopkat | meow.noopkat.com/iotd-2014 21

...

(this is actually supposed to be more fun)

@noopkat | meow.noopkat.com/iotd-2014 22

NodeJS

— JavaScript runtime

— both in and out of browser

— small module mentality

@noopkat | meow.noopkat.com/iotd-2014 23

Johnny-Five

— Robotics and other hardware in NodeJS

— Easy to use API

— Fast to get up and running with Arduino

@noopkat | meow.noopkat.com/iotd-2014 24

Getting started

npm install johnny-five

@noopkat | meow.noopkat.com/iotd-2014 25

Getting started

var five = require("johnny-five"), board = new five.Board();

board.on("ready", function() { // do Arduino things here});

@noopkat | meow.noopkat.com/iotd-2014 26

The 'Hello World' of hardware

var five = require("johnny-five"), board = new five.Board();

board.on("ready", function() {

var myLed = new five.Led(13); myLed.strobe();

});

@noopkat | meow.noopkat.com/iotd-2014 27

Can I prototype "real things" with this?

@noopkat | meow.noopkat.com/iotd-2014 28

Can I prototype "real things" with this?

- yes!

@noopkat | meow.noopkat.com/iotd-2014 29

What's in an off the shelf device?

@noopkat | meow.noopkat.com/iotd-2014 30

Fitness Device

1. 3 axis accelerometer

@noopkat | meow.noopkat.com/iotd-2014 31

Fitness Device

1. 3 axis accelerometer

2. Vibration motor

@noopkat | meow.noopkat.com/iotd-2014 32

Fitness Device

1. 3 axis accelerometer

2. Vibration motor

3. OLED screen

@noopkat | meow.noopkat.com/iotd-2014 33

Fitness Device

1. 3 axis accelerometer

2. Vibration motor

3. OLED screen

4. Battery

@noopkat | meow.noopkat.com/iotd-2014 34

Fitness Device

1. 3 axis accelerometer

2. Vibration motor

3. OLED screen

4. Battery

5. Bluetooth enabled micro-controller

@noopkat | meow.noopkat.com/iotd-2014 35

Fitness Device

1. 3 axis accelerometer2. Vibration motor

3. OLED screen4. Battery

5. Bluetooth enabled micro-controller

@noopkat | meow.noopkat.com/iotd-2014 36

Accelerometer

board.on("ready", function() {

var accel = new five.Accelerometer({ pins: ["A3", "A4", "A5"], sensitivity: 96, // mV/degree/seconds zeroV: 478 // volts in ADC });

accel.on("data", function(data) { console.log("raw: ", data); });

@noopkat | meow.noopkat.com/iotd-2014 37

credit: analog.com@noopkat | meow.noopkat.com/iotd-2014 38

credit: analog.com@noopkat | meow.noopkat.com/iotd-2014 39

OLED display

var Oled = require("oled-js");

board.on("ready", function() {

var oled = new Oled(board, five, 128, 32, 0x3C, "I2C");

});

@noopkat | meow.noopkat.com/iotd-2014 40

Bluetooth Low Energy

var blendMicroIO = require('./');

var board = new five.Board({ io: new blendMicroIO({"name": "BlendMicro"})});

board.on("ready", function() { // carry on as normal here});

@noopkat | meow.noopkat.com/iotd-2014 41

...

Building hardware

@noopkat | meow.noopkat.com/iotd-2014 42

...

Building hardware

@noopkat | meow.noopkat.com/iotd-2014 43

...

(Thank you)

@noopkat | meow.noopkat.com/iotd-2014 44

@noopkat | meow.noopkat.com/iotd-2014 45