arduino and internet of thinks: shareit tm: march 2010, tm

39
Arduino Networking An IoT approach Alexandru IOVANOVICI Timisoara, march 2011

Upload: alexandru-iovanovici

Post on 28-Jan-2015

110 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Arduino NetworkingAn IoT approach

Alexandru IOVANOVICITimisoara, march 2011

Page 2: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

What is Arduino ?

Page 3: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

What is Arduino ?

Platform for physical computing...

...and for tinkering;

Can run standalone or networked;

Cheap (~EUR30);

Extensible … very extensible;

Open source !

Page 4: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

All shapes and sizes

Page 5: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

What's on the board ?

Page 6: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Short version …

ATMEGA328 AVR microcontroller [or bigger];

Headers for pins (analogue, digital, serial, power);

USB port and USB-serial converter [quite expensive]

Power regulator: 5V@250mA and 3.3V;

Reset switch :)

Status LEDs (power, serial, debug): very useful :)

Page 7: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Reading the PHY world == Input

Sound (microphone);

Light (light dependant resistor);

Heat (thermistor);Motion/Force

(switches, dials, flex, pressure, accelerometer, Wii nunchuck, IR/ultrasound ranging) Remote events (BUTTONS serial input from computer);

Page 8: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Writing to the PHY world == Output

Sound (buzzer, speaker);

Light: visible, IR and UV (LEDs);

Motion (motors, servos);

Other power devices (using relays);

3D printer (Rep rap), CNC;

Remote events (serial output to computer);

OR NETWORKING !!!

Page 9: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

It's programmable

Computer (Linux, Mac, Windows)

Arduino IDE; USB device cable; Arduino board.

Patience :)

Page 10: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Demo

Do you [really] want to see a blinking led ? :)

Page 11: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM
Page 12: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Type 1Wired Networks

Page 13: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM
Page 14: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Plain serial

Page 15: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

I2C

Wire.h library;

Page 16: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

I2C

Page 17: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Ethernet, the good, old Ethernet :)

Ethernet.h library

Page 18: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Exotic ones X10; DMX; CAN-BUS; OneWire-MicroLAN; MIDI;

Page 19: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Type 2Wireless networks

Page 20: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

HopeRF

VirtualWire library; Chep and ... quite unreliable :) Worth investigating;

Page 21: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

ZigBee - XBee

Page 22: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

ZigBee - XBee

Page 23: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Demo moment

Let's play … or at least try :)

Page 24: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Bluetooth

Page 25: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

802.11 ... what's that ? :)

Page 26: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

GSM

Page 27: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Radioless

Page 28: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Exotic ones

Way too many :) NRF2401, PCR-1000, RSSS, W800RF32A, HT12E,

HomeEasy, EasyRadio

Have't use any of them :)

Page 29: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Developement

Prototyping; A lot of hacks and tinkering

some unorthodox shortcuts: 5 <-> 3.3

Page 30: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Architecture

Nodes: 2 LEDs + 2 buttons; Can send simple events: HUG, TWT;

Gateway: 2 LEDs Provide Twitter output;

Coordinator (?)

Page 31: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Packet structure

#ID|TYPE|MSG$Ex:

#1|IF|HLO$#1|EV|HUG$#1|EV|TWT$

Page 32: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Packet structure Serial processing of the packet:

If the ID is not OK then discard the packet; If I’m not receiving IF pkts then discard.

Check IDCheck ID

Check pkt typeCheck pkt type

Check valueCheck value

DO ACTIONDO ACTION

ENDEND

Page 33: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

I/O• Node:

• Xbee conn: 11, 12;• D8, D9 – Button;• D10, D13 – LEDs;

• Gateway:• Xbee conn: 2, 3;• D6, D7 – LEDs;• D4, D5 – buttons; NOT USED

Page 34: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Implementation

• 1 man;• Two 4 hour sessions;• 2 ZigBee modules;• 2 Arduino 2009;• Custom ZigBee adaper;• Custom sheild

• messy

Page 35: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

Issues

• Way too simple protocol:• Should be much more extendable and cusomizable• JSON vs. XML ???

• Quite slow communication:• 9600 bps;• Reliability issues;

• Higher level error detection and correction routines;

Page 36: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

THE Issue

V&VAre we building the right

software [product] ?

Page 37: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

THE Issue

• Lack of specifications• We know how to work with Arduino and

ZigBee ...• To do what ?

Page 38: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

ZigBee

• Low power digital radio link: IEEE802.15• Low data rate;

• Personal Area Networks;• Simpler and less expensive than BT;• “low-cost” ? :)• Lots of specifications ans “alliances”• Vendor-dependent stack ... or free• ZB2007: two stacks:

• Simple and Pro;

Page 39: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM

ZigBee

• Device Types:• Coordinator: one in each network;• Router: passing data to nodes;• End Device: talk to parent node (RT or COORD)