![Page 1: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/1.jpg)
Arduino NetworkingAn IoT approach
Alexandru IOVANOVICITimisoara, march 2011
![Page 2: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/2.jpg)
What is Arduino ?
![Page 3: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/4.jpg)
All shapes and sizes
![Page 5: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/5.jpg)
What's on the board ?
![Page 6: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/10.jpg)
Demo
Do you [really] want to see a blinking led ? :)
![Page 11: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/11.jpg)
![Page 12: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/12.jpg)
Type 1Wired Networks
![Page 13: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/13.jpg)
![Page 14: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/14.jpg)
Plain serial
![Page 15: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/15.jpg)
I2C
Wire.h library;
![Page 16: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/16.jpg)
I2C
![Page 17: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/17.jpg)
Ethernet, the good, old Ethernet :)
Ethernet.h library
![Page 18: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/18.jpg)
Exotic ones X10; DMX; CAN-BUS; OneWire-MicroLAN; MIDI;
![Page 19: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/19.jpg)
Type 2Wireless networks
![Page 20: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/20.jpg)
HopeRF
VirtualWire library; Chep and ... quite unreliable :) Worth investigating;
![Page 21: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/21.jpg)
ZigBee - XBee
![Page 22: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/22.jpg)
ZigBee - XBee
![Page 23: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/23.jpg)
Demo moment
Let's play … or at least try :)
![Page 24: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/24.jpg)
Bluetooth
![Page 25: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/25.jpg)
802.11 ... what's that ? :)
![Page 26: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/26.jpg)
GSM
![Page 27: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/27.jpg)
Radioless
![Page 28: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/28.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/29.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/30.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/31.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/32.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/33.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/34.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/35.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/36.jpg)
THE Issue
V&VAre we building the right
software [product] ?
![Page 37: Arduino and Internet of Thinks: ShareIT TM: march 2010, TM](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/37.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/38.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062617/54c852ca4a795964118b456d/html5/thumbnails/39.jpg)
ZigBee
• Device Types:• Coordinator: one in each network;• Router: passing data to nodes;• End Device: talk to parent node (RT or COORD)