Wireless Connectivity Options for IoT By: MIST Makers John Varela and Nicholas Landy Outline • Introduction to the Internet of Things (IoT) • Wireless Communication in IoT • Current Standards • IEEE 802.11 (Wi-Fi) • IEEE 802.15.4 (Zigbee, 6LoWPAN) • • Comparison • Example Projects • A • B • C Introduction to the Internet of Things (IoT)

• A network of embedded devices that can be connected to each other and/or the internet • IoT systems can be used to • Share sensor data between devices • Store data on cloud databases • Display real-time device information on the internet and in mobile apps • Control devices remotely • Program devices to respond to wireless signals and triggers • IoT will redefine the current state of technology • It's estimated that by 2020, there will be 50 billion devices (things) on the IoT network • IoT is expected to be as important as the advent of the World Wide Web Some IoT Products

Nest Thermostat Smart thermostat. Learns preferred temperature levels and let's you change temperature on your phone.

Fitbit Wearable device that monitors fitness activity like calories burned and distance walked and sends info to the cloud to view online or on your phone.

Apple HomeKit Hub software framework that let's you control and monitor multiple home IoT devices in a single app. Communication in IoT

• One vital decision when making an IoT device is the communication protocol you use to transfer information to and from the network • This presentation will compare three popular technologies: Wi-Fi, Bluetooth, and IEEE 802.15.4 (e.g. Zigbee) • Other possible technologies include Z-Wave, 6LoWPAN, and Ethernet Communication Standards

• IEEE 802.11 (Wi-Fi) • IEEE 802.15.4 (Zigbee, 6LoWPAN) • Bluetooth IEEE 802.11 (Wi-Fi)

• Popular Wireless Communication Protocol • Networks are composed of routers and stations • Can serve as an internet gateway for other connected devices • Features: • High data throughput (20-100 Mbps) • Medium Range (~100 m) • Star Topology LAN • ~32 Maximum Nodes • Highest Interoperability (many devices are Wi-Fi compatible) • Issues: • Very High Power Consumption • Poor Security (SSID only, no data encryption) • High startup connection time (~3 seconds) IEEE 802.15.4

• Characterized by its mesh network topology. • Networks are composed of coordinators, routers, and end device nodes. • Common Technologies are: ZigBee and 6LoWPAN • Optimal for applications that depend on: • Low data rates • Mesh applications such as auto-routing between nodes. • Low power applications • Generally the distance between nodes is limited to about 10-20 meters, but the range can be significantly increased up to a few miles by making hardware modifications. • Requires a gateway for Internet connectivity. • Has very low interoperability, even in devices of the same family. Bluetooth

• Wireless technology specializing in transmitting data over short distances (~10 m). • Intended for portable equipment like headsets and other wearable devices. • Can build PANs in both star and P-2-P topologies • Features: • Fairly low power • Good data throughput (1-2 Mbps) • High interoperability with smartphone, tablet, and laptop devices • Like IEEE 802.15.4 , an internet gateway is required to connect to the internet • Only 7 nodes can be supported by a Bluetooth master device • Bluetooth profiles characterize how different types of Bluetooth devices communicate, which can improve interoperability and transmission speeds • Bluetooth LE is also available for lower power applications. Has lower data throughput (~20 kbps) but higher number of nodes (10-20) Important Considerations for Protocols

• When selecting a protocol for your project, you need to consider some of its properties: • Range: The maximum distance for transferring data • Data Throughput: The speed at which data is transferred (in Kbps or Mbps). • Power Consumption: How much power is necessary for a device using this protocol? • Frequency Band: Range of frequencies in which radio signals are transferred. Certain frequencies have more traffic or noise than others. • Security: How is information in the network protected from theft or damage? • Maximum Nodes: Maximum amount of devices (nodes) capable of running on a single network • Cost: Some protocols require more expensive hardware to implement Considerations cont.

• Network Topology: Organization of nodes (devices) in a connected network • Star networks are the most common topology. A single node transfers and receives information form all other nodes. • Commonly used in Wi-Fi and Bluetooth • Tree networks are used to link different star networks. • Mesh networks take away dependence on a central node for communication between any two nodes. • Commonly implemented by ZigBee, Z-Wave, and 6LoWPAN Figure Obtained from a series of instructional videos from Ember https://youtu.be/dn4631u2Zxg?t=127

Comparison of Wireless Protocols

Wi-Fi Bluetooth Zigbee Standard IEEE 802.11 IEEE 802.15.1 IEEE 802.15.4 Range 100 m 10 m 100 m+ Data Throughput 20-100 Mbps 1-2 Mbps 20, 40, 250 Kbps Battery Life 0.1 - 5 days 1 - 7 days 100 - 1000 days Frequency Band 2.4 and 5 GHz 2.4 GHz 868/915 Mhz, 2.4 GHz Security Low (SSID) 64, 128-bit AES 128-bit AES Maximum Nodes ~32 7 65535 Cost High Low Low Topology Star Star Mesh Network Type WLAN WPAN WPAN Hardware/Software variations

*These figures pertain specifically to ZigBee, but still apply to other technologies. https://youtu.be/dn4631u2Zxg?t=274 Hardware/Software cont.

• Example SOC(System On Chip) solutions • TI's CC26xx family of low-power MCU's (Multi- standard) • ATmega64/128/256 RFR2 Low-power MCU's with IEEE 802.15.4 transceiver. • Silicon Labs' EM35x MPU's (ZigBee) • Edison (Built-in Bluetooth LE) • RFD22301

• Example Network Co-processors • ESP8266 (Wi-Fi) • EMW3165 (WI-Fi) • XBee family of devices • KEDSUM Bluetooth serial transceivers Hardware/Software variations

• The microcontroller + Transceiver option was how RF technologies were first implemented but are not as popular anymore. • SOC Microcontroller is part of IC • Requires least amount of hardware. • Lowes price. • Highest power efficiency due to hardware optimizations with Stack. • Requires more software development to implement the stack. • Network Co-Processor • These reduce the software developing time by allowing any MCU/MPU to access the stack features of the Co-processor through serial communication. Gateways

• Most wireless technologies, such as Bluetooth and • Go to this link for a more in depth description of a ZigBee, allow you to only communicate through that Gateway and an example project of having a standard. In order to have an IoT project, your as a gateway for an . network must be adapted to also have internet • These are all off-the shelve parts but all of the connectivity. tools and concepts used, apply to custom made solutions. Pay attention to the API used!! • The solution is to have at least one device that has internet connectivity, through Wi-Fi or Ethernet, http://thenewstack.io/tutorial-prototyping-a-sensor- connected to your RF network node-and-iot-gateway-with-arduino-and-raspberry- pi-part-1/ http://thenewstack.io/tutorial-configuring-a-sensor- node-and-iot-gateway-to-collect-and-visualize-data- part-2/

Sample Projects Sample projects

• To summarize the following slides: • SOC solutions are advised if you are implementing your IoT connectivity in your board and need a customized design. • This will require regular MCU/MPU tools, such as debugger and IDE, as well as the required Stack provided by the manufacturers of the specific SOC. • Network Co-processors are advised if you want to avoid the software development of the stack, and instead want IoT connectivity by just using serial commands from any MCU/MPU of your choosing. • Most options are available in off-the shelve devices, but companies like Atmel and TI also sell these IC’s • SBC are ideal to use as your gateway to connect your nodes to the internet SOC implementation

• Aside from a few development boards, SOC solutions are the way to go if you are designing your own microcontroller board or need a small footprint. • If you are familiar with ATmega 8-bit MCU’s, I recommend you to use the ATmega256RF2R. 32-bit ARM Cortex-M0 versions are also available. • You will need additional components to use the IEEE802.15.4 functionalities, such as an antenna, proper filtering circuit, and required oscillators for the built-in transceiver. • Check the datasheet to find out the required components!!! • I suggest creating an account on Circuithub and searching for “pinoccio”. Look at the Altium or Eagle design files for referece. https://circuithub.com/explore?q=pinoccio&tools=eagle,kicad,altium,circuitmaker&page=1 • In the software side, you must download an IDE for debugging along with the drivers and stack provided by the SOC manufacturer.

Using SBC(single board computers)

• SBC's give you the power to very quickly connect your project to the internet by using the power of a full OS such as Linux. The following links and tutorials can be easily implemented in the Raspberry pi, Beagle Bone Black, and Intel Edison, while running on a Linux image. • SBC’s are great to use as gateways to connect between your RF network and the internet. for most of these systems, you will need a RF USB dongle (Bluetooth or ZigBee) and either a Wi-Fi dongle or Ethernet connection for internet connectivity.

• Most project tutorials provide you with a custom image, this explains how to install them. https://learn.sparkfun.com/tutorials/sd-cards-and-writing-images • Sample tutorial of blinking an LED with a Raspberry Pi depending if a keyword appears on a tweet. https://learn.sparkfun.com/tutorials/raspberry-pi-twitter-monitor • Camera monitoring system that sends emails based on the different Bluetooth devices in range. http://www.instructables.com/id/Daycare-Monitoring-and-Tracking-System-Using-Intel/?ALLSTEPS

Projects using cloud ecosystems

• IBM Bluemix cloud ecosystem provide developers with "recipes", tutorials on how to connect popular devices such as Arduino, Raspberry pi, ESP8266, TI sensor tag, etc. https://developer.ibm.com/recipes/ • Sparkfun's cloud ecosystem allows users to push and access data online. https://learn.sparkfun.com/tutorials/pushing-data-to-datasparkfuncom Additional Resources

• TI’s wireless connectivity solutions http://www.ti.com/lit/sg/slab056d/slab056d.pdf • Adafruit’s IoT resources https://blog.adafruit.com/category/iot/ • IoT software resources and list of API’s http://postscapes.com/internet-of-things-software-guide

• Zigbee intructional videos by Ember. (Great for learning about the Stack) https://www.youtube.com/user/EmberCorp/videos