how to hack your own iot thing

16
Hack Your Own IOT TASTE OF IT 2015 Thing 1 Welcome to HACK YOUR OWN IOT THING. TASTE OF IT 2015 David Mezera [email protected] 937-610-3510 Questions? Contact me! 2 My name is David Mezera. I’m president of DataYard here in Dayton. We started out as Donet 20 years ago. Today we provide cloud, network, and data center services. I’m an electrical engineer and a computer engineer by education, so I’m fascinated by the potential of the technological marriage that is just starting with IOT. Blends my hardware and software education with the Internet focus of DataYard.

Upload: david-mezera

Post on 22-Jan-2018

264 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: How to Hack Your Own IOT Thing

Hack Your Own

IOT

TASTE OF IT 2015

Thing

1 Welcome to HACK YOUR OWN IOT THING.

TASTE OF IT 2015

David Mezera [email protected] 937-610-3510

Questions? Contact me!

2 My name is David Mezera. I’m president of DataYard here in Dayton. We started out as Donet 20 years ago. Today we provide cloud, network, and data center services.

I’m an electrical engineer and a computer engineer by education, so I’m fascinated by the potential of the technological marriage that is just starting with IOT. Blends my hardware and software education with the Internet focus of DataYard.

Page 2: How to Hack Your Own IOT Thing

Imagine an IOT “Thing”… 3 What’s the first thing you think of when you hear the phrase “IOT”, the “Internet of Things”.

Well, if you’ve tuned into industry hype anytime in the last couple of years, you might have imagined this: the Internet-connected refrigerator.

This is obviously a joke (laptop strapped to fridge door), but what is this even supposed to do?

This is an example of a “thing” with too broad a scope and no clear purpose.

4 This, on the other hand, is a FitBit — a Thing example we can easily wrap our heads around.

The FitBit has a clear purpose: it uses an accelerometer and heartbeat sensor to sense and report your physical activity, and help you track you progress.

Your data gets dumped into the cloud, analyzed, and made available for you to review — all with the intention of motivating you to better health.

Page 3: How to Hack Your Own IOT Thing

Physical Reality Virtual Reality

SENSE ANALYZE

ACTUATE TRIGGER

5 My definition of an IOT “Thing” is device that performs at least one of the following functions:1) Can sense and transmit data from the physical world into the virtual world, and that data can then be analyzed to produce useful and interesting results.2) Can receive data from the virtual world to produce a change in the physical world.

Physical Reality Virtual Reality

6 That’s the Big Idea behind IOT.

The permeability of the membrane separating the physical world from the virtual world. Such that a virtual switched moved into the ON position can have a direct effect on a device in the physical world, like a table lamp that turns on.

The universe of IOT can be very complicated, but i intend to use the rest of my time today to talk to you about you can use inexpensive off-the-shelf hardware, free software, and a little imagination to build your own things to do your own special stuff.

Page 4: How to Hack Your Own IOT Thing

7 So how is this even possible?

How is it possible that today we’re talking about deploying Things in the physical world that can interact with the virtual world?

A couple of things:

8 Small, inexpensive, intelligent hardware, makes it possible to embed processing power wherever it’s needed.

This 16GB SD card — $10 from Best Buy. Contrast this to the 1GB hard disk we bought at Donet in 1995 that cost $2000!

Computing power and storage capacity continues to shrink, and get cheaper. It makes it possible for us to push intelligent things closer to the edge.

Page 5: How to Hack Your Own IOT Thing

9 The second factor making Things possible is the nearly ubiquitous cellular, WiFi, and Bluetooth wireless signals that are available for transmitting and receiving data.

This is T-Mobile’s coverage map. More on this later.

adafruit.com “Maker-ish”

sparkfun.com “Engineer-y”

mcmelectronics.com LOCAL!

10 My favorite sources for parts and information:AdafruitSparkfunMCM Electronics (local!)

Page 6: How to Hack Your Own IOT Thing

11 So let’s say you want to build some kind of sensor to detect something in physical reality, and you want to record and report that sensor reading in virtual reality. Where do you start?

You know you’ll at least need the sensor. But you’ll need something to talk to that sensor, gather the physical reality measurement, and transmit it to virtual reality.

So let’s talk a little bit about the processing boards you can get to be “the brain”.

I’ve used a variety. The one you choose depends on how much processing power your thing needs (most IOT things don’t need much), and what software you want to use to control your thing.

$5 (clones)

$9 (clones)

12 Arduino and friends — Open Source HardwareOpen-source hardware license, so you can get a genuine Arduino or a cheap cloneArduino UNOATmega328 running at 16Mhz32KB RAM for programs16 digital I/O pins6 analog input pinsCan stack boards — build things without having to do EE$9 clones!

Mini Arduino Pro 5VFunctionally exactly the same as an UNO except it has TWO FEWER digital I/O pins: 14 instead of 16More wiring required, especially if you want to add sensors$5 clones

Page 7: How to Hack Your Own IOT Thing

13 Arduinos have a boot loader pre-programmed in — so all you need to do is write your Thing code and upload it into the firmware. EASY PEASEY!

Arduino programs are called SKETCHES, and this is absolutely the simplest sketch possible. It has the two functions every sketch must, at a minimum, have: setup(), and loop().

14 Let’s step it up a notch, and imagine an Arduino that actually does something: Blink an LED — a light-emitting diode.

Page 8: How to Hack Your Own IOT Thing

15 This is the code that goes along with the hardware. Very C-like.

And you can see that we’ve crossed the line into “software-defined hardware”.

16 I love working with Arduinos when I’m making Things. They’re cheap and easy to work with. But they have one huge problem out of the box: they can’t talk to anything, especially not at a distance.

Not a very useful Thing.

You need to build communication capability in, or find a board that does it for you.

Which is why I like this board:

Page 9: How to Hack Your Own IOT Thing

$16

17 Sparkfun ESP8266 Thing Uses the ESP8266 WiFi-enabled micro controller80MHz ESP8266 (20% used by WiFi)Plenty of program memoryIntegrated TCP/IP stackLots of I/O pinsABOUT THE WIDTH OF A QUARTER$16 from Sparkfun

This board is included in the Arduino IDE as a supported board, and smart people at Sparkfun have written software libraries to make it talk to a WiFi access point.

A thing needs a connection to be able to pass data back and forth between the physical and virtual world; what if you don’t have WiFi where you want to capture data?

$40

$9 $9/mo*

18 Use a cheap cellular solution!

This is the FONA 800 from Adafruit. For $40 you can get a small module that will accept a SIM card for voice, texts, or data — and you can interface it with a processor board to handle those inputs.

Use Ting, which rides on the T-Mobile 2G networkCard costs $9 from Adafruit. Monthly recurring can be as cheap as $9/mo.

Monthly costs are tiered, but if you use less than 100MB/mo (no voice or texts) your monthly recurring Ting costs will be about $6/mo.

Page 10: How to Hack Your Own IOT Thing

Acceleration

Gas detectors

Humidity

Temperature

Pressure

Light

Proximity

RFID

Bluetooth

Switch settings

Voice/Sound

LOTS MORE

http://bit.ly/1X2hQ06Sensors!! 19 Sensors make things interesting — the number and variety of things you can actually detect in the physical world, and act upon, is staggering!

207 Thing-compatible sensors on the link provided.

How do you interact with a Thing? Where do you send Thing data, or trigger virtual events that will make your Thing do something?

“phant”data.sparkfun.com

FREE

20 Spark fun has data collectors for your Things, so they can push data up to the cloud. They’ve provided software libraries to talk to their services.

Think of it as an Excel spreadsheet your Thing can push data into, and you’ll process it offline later.

Great for receiving data from your Thing, but harder to read from to trigger events for your Thing to act on.

Page 11: How to Hack Your Own IOT Thing

Blynk blynk.cc

FREE

21 Blynk allows you to read sensor data from your Thing, and activate devices connected to your Thing, via really responsive smartphone apps for iOS and Android.

THING DEMO 22 Use a Sparkfun ESP8266 Thing + relay connected to LED panel + Blynk to build an IOT lightswitch.

Page 12: How to Hack Your Own IOT Thing

THING DEMO 23 Here’s the sketch that gets loaded into my Sparkfun ESP8266 to make it communicate with Blynk.

THING DEMO 24 Blynk can then be configured to talk to the Sparkfun ESP8266 and drive pin 14, the pin connected to my LED panel relay, high or low.

Page 13: How to Hack Your Own IOT Thing

25 Before I wrap up, mention some important loose ends I’ve left un-tied. There were lots of things I didn’t talk about that you should consider when building Things, issues that are important.

26 Security, privacy, whether or not you even should collect and publish certain types of sensor data from you Things.

Types of data — health data, PPI? Regulatory requirements?

Security in transit — encrypt or expose?

Database security — who can get to your collection of data?

Portal security — who can read your data, activate your devices?

What can the data reveal and how can it be exploited?

Your Thing might reveal more about you and your business than you care to reveal, so you need to think about Thing security.

Page 14: How to Hack Your Own IOT Thing

27 Remember this? The FitBit.

Great example of a mass produced IOT device.

28 If you tried to build a FitBit out of the types of devices I talked about today it might end up looking like this. Functional, but not at all marketable.

The boards I’ve been talking about today are generally bigger than they need to be because they’re general purpose, flexible.

But that’s OK, because all we’ve been doing here is talking about hardware and software you can use for prototypes and one-off devices — “things” that might only be useful for you or your business .

Great for custom projects, getting a startup idea off the ground.

Something moving into production engineering at scale would need to be miniaturized and enclosed with marketability in mind.

Page 15: How to Hack Your Own IOT Thing

29 So, if you’ve got an idea for a Thing and this session has given you enough juice to think about ways to build it, then I encourage you to give it a chance.

You’ll run into some roadblocks building your first things. Expect to fail. But there are tons of tutorials available to help you along the way

30 No, go forth and internet all the things.

Page 16: How to Hack Your Own IOT Thing

THANK YOU FOR ATTENDING!

David Mezera [email protected] 937-610-3510

Questions? Contact me!

31