| Literature DB >> 30104529 |
Iván Froiz-Míguez1, Tiago M Fernández-Caramés2, Paula Fraga-Lamas3, Luis Castedo4.
Abstract
In recent years, the improvement of wireless protocols, the development of cloud services and the lower cost of hardware have started a new era for smart homes. One such enabling technologies is fog computing, which extends cloud computing to the edge of a network allowing for developing novel Internet of Things (IoT) applications and services. Under the IoT fog computing paradigm, IoT gateways are usually utilized to exchange messages with IoT nodes and a cloud. WiFi and ZigBee stand out as preferred communication technologies for smart homes. WiFi has become very popular, but it has a limited application due to its high energy consumption and the lack of standard mesh networking capabilities for low-power devices. For such reasons, ZigBee was selected by many manufacturers for developing wireless home automation devices. As a consequence, these technologies may coexist in the 2.4 GHz band, which leads to collisions, lower speed rates and increased communications latencies. This article presents ZiWi, a distributed fog computing Home Automation System (HAS) that allows for carrying out seamless communications among ZigBee and WiFi devices. This approach diverges from traditional home automation systems, which often rely on expensive central controllers. In addition, to ease the platform's building process, whenever possible, the system makes use of open-source software (all the code of the nodes is available on GitHub) and Commercial Off-The-Shelf (COTS) hardware. The initial results, which were obtained in a number of representative home scenarios, show that the developed fog services respond several times faster than the evaluated cloud services, and that cross-interference has to be taken seriously to prevent collisions. In addition, the current consumption of ZiWi's nodes was measured, showing the impact of encryption mechanisms.Entities:
Keywords: HAS; IoT; MQTT; WSN; WiFi; ZigBee; fog computing; home automation; wireless sensor networks
Year: 2018 PMID: 30104529 PMCID: PMC6111259 DOI: 10.3390/s18082660
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1Zigbee versus WiFi protocol stack.
Characteristics of the most common home automation technologies. RF: Radio Frequency, EG: Electric Grid, OF: Optical Fiber, TP: Twisted Pair.
| Technology | Medium | Openness | Data Rate |
|---|---|---|---|
| KNX | EG, RF, TP | Open | 9.6 Kbps |
| LonWorks | EG, RF, OF, Coaxial, TP | Open | 1.25 Mbps |
| X10 | EG | Open | 60 bps |
| Insteon | EG, RF | Proprietary | 38.4 Kbps |
| ModBus | TP | Open | RTU: 19.2 Kbps-TCP: 10/100/1000 Mbps |
| BacNet | TP | Open | 10/100/1000 Mbps |
| Z-Wave | RF | Partially open (open-source layer for integration) | 9.6 Kbps |
| EnOcean | RF | Partially open (open OSI layers 1–3) | 25 Kbps |
| ZigBee | RF | Open | 256 Kbps |
| WiFi | RF | Open | 600/54 Mbps |
| Bluetooth | RF | Open | 1 Mbps |
Comparison of the main features of the most relevant academic HAS and the proposed system (part 1).
| System | Main Objective | Messaging Protocol | Actuation Capabilities | Open-Source Code | Conceived for Fog Computing | Cost | Relevant Features/Challenges |
|---|---|---|---|---|---|---|---|
| ZiWi | MQTT-based HAS | MQTT | Yes | OpenHAB (Node source code available on GitHub) | Yes | 180 (whole demonstrator) | High flexibility, interoperability and scalability |
| [ | Intelligent building monitoring | Ad hoc | Yes | No | No | Low cost | Delays due to SMS-based commands |
| [ | Indoor ambient intelligence monitoring | Ad hoc | Yes | No | No | Cost-effective | Alarm control center, several scenarios |
| [ | Energy efficiency | Ad hoc | Yes | No | No | Low-cost | Heuristic scheduling algorithm |
| [ | ZigBee-based HAS | Ad hoc | No | No | No | Not specified | Software designed of the coordinator and terminal node |
| [ | Gateway for assisted living applications | Ad hoc, dependent on the assisted living device | Yes | No | No | Not specified | Biometrics and actimetry for assisted living |
| [ | HAS for heterogeneous networking | Ad hoc | Open API | No | Cloud capabilities | Not specified | Integrated home appliances with prediction algorithms |
| [ | Enabling IoT services in HAS | Ad hoc | Yes | No | No | Not specified | Basic GUI with sensor readings |
| [ | Power outlet control and monitoring | Ad hoc | Yes | No | No | 45 (one smart socket) | Experimental analysis with theoretical and empirical measurements |
| [ | Smart building energy efficiency monitoring | Ad hoc messages routed with CTP (Collection Tree Protocol) | Yes | No | Decentralized architecture | Not specified | Decision-making manager and integration of different applications |
| [ | HAS | XMPP | Yes | Openfire | No | Low-cost | Android app for control units |
| [ | HAS | MQTT | Yes | OpenHAB | No | Cost-effective (less than $60 for a Raspberry Pi 2, an SD card and four ESP8266 modules) | Overall delay from UI to Node is less than 600 ms |
| [ | MQTT-based HAS | MQTT | Yes | No | No | Not specified | It makes use of ESP8266 WiFi modules |
Comparison of the main features of the most relevant academic HAS and the proposed system (part 2).
| Reference | Home Controller Hardware | Communication Transceivers | Communication Topology | Sensors and Actuators | Node Hardware |
|---|---|---|---|---|---|
| ZiWi | Raspberry Pi Model B | WiFi, ZigBee | Mesh | Temperature (LM35, TMP36, DHT11), humidity (HIH-5030, DHT11), luminosity (LDR), motion (Parallax PIR rev. A) and current sensors (ACS712) | NodeMCU (ESP8266), Xbee Series 2 |
| [ | PC | ZigBee, WiFi and GSM/GPR | Star | Temperature (LM-35DZ) and relays | WN-USB ZigBee module |
| [ | 32-bit ARM microcontroller | X10, Serial, EIB, ZigBee, Bluetooth, DTMF, CAN and GSM/GPRS/UMTS | Star | Multiple I/O pins for attaching sensors and actuators | Proprietary board based on a 32-bit ARM microcontroller |
| [ | Android tablet and Arduino MEGA with an Ethernet shield | X10, ZigBee | Tree | Light and switch modules | Arduino |
| [ | 32-bit ARM-Cortex M3 microcontroller | ZigBee | Tree | The paper only suggests different sensors and actuators for the HAS, but it is actually not implemented | CC2530 |
| [ | - | EIB/KNX, WiFi, Bluetooth and ZigBee | Star | Environmental (door/window opening, light, temperature), biometric (wrist pulse oximeter, body scale, wrist blood pressure, ear thermometer) and actimetry (movement detection, bed/chairs presence, lighting control, water and electricity meter) sensors and actuators | WaspMote platform |
| [ | Raspberry Pi 2 | WiFi, ZigBee, IrDA, Ethernet | Star | Smart plugs, IP cameras | Raspberry Pi 2 (the controller also acts as sensor node) |
| [ | Cubietrack board (ARM-Cortex A7) | WiFi, ZigBee | Star | Temperature, light and current sensors (ACS712). Relays and dimmers. | ESP8266, Xbee |
| [ | PC | ZigBee | Star | Smart plugs | ATmega328P microcontroller |
| [ | - | IEEE 802.15.4 | Tree | - | MICAz motes |
| [ | - | WiFi, IR | Star | Dust sensor | Commercial UART-WiFi module |
| [ | Raspberry Pi 2 model B | WiFi | Star | - | ESP8266 |
| [ | PC | WiFi | Star | Luminosity sensor (LDR), LED and buzzer | ESP8266 |
Figure 2Generic fog computing architecture.
Comparison of the features of commercial home automation systems.
| Solution | HomeSeer | Qivicon | Loxone | Domintell |
|---|---|---|---|---|
| Protocols | Insteon, UPB, Wi-Fi, X10, PLC-BUS, Modbus, Z-Wave | Wi-Fi, ZigBee | KNX, DMX, Modbus, RS232, RS485, EnOcean, Loxone Air | S-Bus |
| Transmission | Wired and wireless | Wireless | Wired and wireless | Wired |
| Locking system | Yes | Yes | Yes | Yes |
| Temperature | Yes | Yes | Yes | Yes |
| Media center | Yes | Yes | Yes | Yes |
| Lighting | Yes | Yes | Yes | Yes |
| Environmental control | Yes | Yes | Yes | Yes |
| Video surveillance | Yes | Yes | No | No |
| User experience | Acceptable | Acceptable | Good | Good |
| Variety of peripherals | High | Very high | Medium | Medium |
| Technical security | Yes | Yes | Yes | Yes |
| Anti-intrusion | Yes | Yes | Yes | Yes |
| System Requirements | 800 MHz Quad-Core CPU, 1 GB RAM-1.5 GHz Dual-Core CPU, 2 GB RAM-1.8 GHz Dual-Core CPU, 2 GB RAM | 1-Core ARM v11, 600 MHz, 512 MB RAM | 400 MHz, 64 MB RAM | Not provided by the manufacturer |
| Price (€) | 1000–1200 | 1300 | 1250 | 900 |
Feature comparison of the most relevant open-source home automation software.
| Software/Feature | Main Task | License | Main Development Language | Web Interface | Protocols | Low-Cost Gateway Support | Messaging Service | API | Plugins | Documentation |
|---|---|---|---|---|---|---|---|---|---|---|
| Ago Control [ | HAS | GPL v3 | C++ | Yes | Many | Yes | AMQP | No | A few | Good |
| (e.g., Raspberry Pi or PogoPlug) | (MQTT supported) | (but JSON-RPC interface) | ||||||||
| Calaos [ | Control and monitor homes | GPL v3 | C++ | Yes | A few | Yes | - | Yes | Under development | Limited |
| (under development) | (e.g., Raspberry Pi, Cubieboard) | (JSON-based) | (partly in French) | |||||||
| Domticz [ | HAS | GPL v3 | C++ | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi or FreeNAS) | (JSON-based) | |||||||||
| Fhem [ | HAS | GPL v2 | Perl | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi, NAS) | (ASCII commands) | (partly in German) | ||||||||
| FreeDomotic [ | IoT framework | GPL v2 | Java | Yes | A few | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi) | (REST API, under development) | (partly in Italian) | ||||||||
| Home-Assistant [ | HAS | Apache 2.0 | Python 3 | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi 3) | (REST/Python/Websocket APIs) | |||||||||
| Home Genie [ | HAS | GPL v3 | Javascript / C# / Python / Ruby | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi, CubieTrack) | (REST API and SDK) | |||||||||
| ioBroker [ | IoT platform | MIT | Javascript / Node.js | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., ARM-based boards) | (REST API) | |||||||||
| Jeedom [ | HAS | GPL v2 | PHP | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi 2 or 3, Synology NAS) | (JSON RPC and HTTP-based) | (partly in French) | ||||||||
| LinuxMCE [ | Home automation suite | GPL/Pluto | C / C++ | No | Many | Yes | - | No | Many | Extensive |
| (only for administration) | (e.g., Raspberry Pi) | |||||||||
| MajorDoMo [ | HAS | MIT | PHP | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi 2 or 3) | (HTTP-based) | (Addons market) | (partly in Russian) | |||||||
| MyController [ | Sensor controller | Apache 2.0 | Java | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi) | (REST) | |||||||||
| OpenHAB [ | HAS | EPL v1 | Java | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., ARM-based boards) | (REST) | |||||||||
| OpenNetHome [ | HAS | GPL v3 | Java | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi) | XMPP | (REST) | ||||||||
| Pimatic [ | Home automation framework | GPL v2 | Node.js | Yes | Many | Yes | MQTT | Yes | Many | Extensive |
| (e.g., Raspberry Pi) | XMPP | (HTTP-based) |
Figure 3General view of ZiWi’s communications architecture.
Main characteristics of ESP8266-based boards.
| Model | ESP-01 | ESP-12 | ESP-201 | NodeMCU v1.0 | Sparkfun Thing | Adafruit Huzzah | WeMos D1 Mini |
|---|---|---|---|---|---|---|---|
| ESP Version | ESP-01 | ESP-12 | ESP-201 | ESP-12E | ESP-12E | ESP-12E | ESP-12E |
| Number of GPIO pins | 2 | 11 | 11 | 11 | 11 | 11 | 11 |
| Memory | 512 KB | 512 KB | 512 KB | 4 MB | 4 MB | 4 MB | 4 MB |
| Ease of integration in prototypes | Medium | No | High | High | High | High | High |
| Power voltage | 3.3 V | 3.3 V | 3.3 V | 3.3 V–6 V | 3.3 V–6 V | 3.3 V–6 V | 3.3 V–6 V |
| Form factor | Small | Medium | Large | Large | Large | Medium | Small |
| Price | $3 | $3 | $3 | $6.5 | $16 | $10 | $4 |
| Compatible with Arduino IDE | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Serial comms. | It needs a USB adapter | It needs a USB adapter | It needs a USB adapter | It needs a USB adapter | micro-USB | It needs a USB adapter | micro-USB |
Figure 4Implemented communications architecture.
Sensors used by ZiWi’s nodes.
| Sensor | Identifier | Output | Operation Range | Precision | Input Voltage Range | Consumption | Price |
|---|---|---|---|---|---|---|---|
| Temperature | LM35 | Analog | −55, +150 C | ±0.5 C | 4–30 V | 114 µA | $3 |
| Temperature | TMP36 | Analog | −40, +125 C | ±1–2 C | 2.7–5.5 V | 40 µAA | $1.50 |
| Humidity | HIH-5030 | Analog | 0–100% | ±3% | 2.7–5.5 V | 200 µA | $10 |
| Luminosity | LDR | Analog | 1–1000 lx | - | max. 100 V | max. 75 mA | $0.5 |
| Temperature and Humidity | DHT11 | PWM | 0–50 C / 20–80% | ± 2 C / ± 5% | 3–5 V | 200 µA | $5 |
| Motion | Parallax PIR sensor rev. A | Digital | 0–6 m | - | 3–5 V | 100 µAA | $10 |
| Current | ACS712 | Analog | Up to 30 A | ±1.5% | 4.5–5.5 V | 10 mA | $3–$5 |
Figure 5Electronic schematic of the actuator node.
Figure 6Final prototype of the actuator node.
Figure 7Temperature sensor glued on the back of a power outlet.
Figure 8Schematic of the sensor node.
Figure 9Prototype of the sensor node.
Figure 10Electronic schematic of the Master node.
Figure 11Prototype of the Master node.
Figure 12Example of the creation of a rule using IFTTT.
Figure 13Flow diagram of the simplified IFTTT smart lighting rule.
Figure 14HAS prototype for showing purposes.
Figure 15Communications architecture for the demo tests.
Response time comparison of ZiWi with other state-of-the-art systems.
| System | Scenario | Response Time |
|---|---|---|
| ZiWi-Fog | Turn on a light when low luminosity is detected | 20 ms |
| ZiWi-Fog | Switch on a relay | 18 ms |
| ZiWi-Fog | Switch off a relay | 16 ms |
| ZiWi-Cloud | Detect and notify alert through Telegram | 2.735 s |
| ZiWi-Cloud | Turn on a light when low luminosity is detected through IFTTT | 51.388 s |
| [ | Switch on/off relay | 2 s |
| [ | Switch on/off relay | 25 s |
| [ | Read sensor value | 0.5 s |
| [ | Act on actuator | 0.5 s |
| [ | Detect and react to a shortcut | 1233.19 µs |
| [ | Collect sensor values and react depending on them | 32.9 ms |
ZigBee success delivery rate in the presence of WiFi cross-interference.
| Node Distance | WiFi Enabled | Channel Overlapping | Average Local RSSI (dBm) | Average Remote RSSI (dBm) | Packets Sent | Packets Received | TX Errors | Packets Lost | Packet Delivery Success Rate (%) |
|---|---|---|---|---|---|---|---|---|---|
| Short | No | No | −36 | −36 | 100 | 100 | 0 | 0 | 100% |
| Short | Yes | No | −42 | −44 | 100 | 96 | 3 | 1 | 96% |
| Short | Yes | Yes | −49 | −44 | 100 | 86 | 14 | 0 | 86% |
| Medium | No | No | −59 | −54 | 100 | 100 | 0 | 0 | 100% |
| Medium | Yes | No | −55 | −50 | 100 | 96 | 4 | 0 | 96% |
| Medium | Yes | Yes | −56 | −51 | 101 | 78 | 20 | 3 | 77.23% |
Node consumption with and without encryption.
| Mode | Sensor Node Consumption (mA) | Actuator Node Consumption (mA) | ||||
|---|---|---|---|---|---|---|
| Without Encryption | With APS Encryption | Difference | Without Encryption | With SSL Encryption | Difference | |
| Average | 23.494 | 24.006 | +2.13% | 39.369 | 87.800 | +55.16% |
| In Transmission | 55.200 | 56.400 | +2.13% | 96.950 | 117.74 | +17.66% |
| Idle | 12.925 | 13.208 | +2.14% | 20.175 | 21.940 | +8.04% |