Internet of Things a practical component-oriented approach What is IoT (wikipedia): The Internet of Things (IoT) is the internetworking of physical devices, vehicles, buildings and other items - embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data. Our approach is «component-oriented» : We design the IoT architecture with symbols of components, then we implement it. 1
Internet of Things Hardware/Software/Applications 2
Component-oriented approach All components taken into account are : are based on standards are open source are low cost Sensors and/or actuators are connected via serial buses : I2C SPI UART Micro-controllers (MCUs) and single board computers (SBCs) (Raspberry PI 3) Communication technologies : Ethernet,WiFi LoRa,HC-12, NRF24,.. GSM,4G, NB-IoT,.. Software : For MCUs - Arduino IDE and Arduino code for SBCs Linux - C/C++ language 3
Component-oriented approach All components have generic and specific symbols. some generic symbols 4
Component-oriented approach All components have generic and specific symbols. some specific symbols 5
IoT architecture : example 1 connection communication microcontroller sensors DHT11 An IoT architecture with Arduino Uno and network interface 6
IoT architecture : example 2 front-end server client back-end BH1750 HTU21D An IoT architecture with an ESP32 (IoT DevKit) and WiFi AP 7
IoT architecture : example 3 back-end NRF24L01 SSD1306 front-end front-end DS3231 back-end An IoT architecture with two nodes and NRF24 modems 8
IoT architecture : example 4 back-end front-end XL1276/8 front-end NEO-6M back-end An IoT architecture with two nodes and LoRa (UART)modems 9
An IoT architecture with WEB service TCP/HTTP WEB client IoT terminal IoT WEB server and gateway IoT architecture with an RPI3 gateway 10
An IoT architecture with WEB client LoRaEthernet/Internet gateway WiFi-LoRa gateways WEB client WEB server (bakobox.fr/lora.html) 11
An IoT architecture with WEB client WEB server (bakobox.fr/lora.html) 12
An IoT architecture for ThingSpeak.fr Access Point and WiFi Ethernet gateway ESP terminal in STAtion mode ThingSpeak client 13
An IoT architecture for ThingSpeak.fr 14
Two revolutionary circuits for IoT architectures ESP-12 /ESP-32 Processing and Wifi for the implementation of Access Points and Gateways SmartComputerLab IoT DevKit is based on ESP32 Heltec board (including LoRa modem) Semtech sx1278/6 in RFM9X circuits (433MHz and 868MHz) Configurable LoRa modem For the implementation of Lon Range (low data rate) communication links Many boards but can be used directly 15
ESP-12 (2014) 3.3V ESP8266EX is among the most integrated Wi-Fi chips in the industry. Measuring just 5mm x 5mm it integrates a 32-bit Tensilica MCU, standard digital peripheral interfaces, antenna switches, power amplifier, low noise receive amplifier, filters and power management modules - all in one small package. Tensilica L106 is a 32-bit micro controller (MCU) which features extra low power consumption, reaching a maximum clock speed of 160 MHz. With the Real Time Operation System (RTOS) enabled and Wi-Fi stack functional, about 80% of the processing power is still available for user applications. 16
ESP-32 (2016) Bluetooth WiFi SPI I2C 2*µProc UART ULP*µProc 17
Wemos D1 (ESP-8266EX) WiFi - STA and softap SPI, I2C and UART 11 digital input/output pins, all pins have interrupt/pwm/i2c/one-wire supported (except D0) 1 analog input(3.2v max input) a Micro USB connection Compatible with Arduino Compatible with nodemcu Attention: All of the IO pins run at 3.3V. 3.3V 18
Heltec ESP32 WiFi LoRa Frequency 240MHz FLASH 8 MB LoRa chip support frequency band SX127(868-91),SX1278(433-510MHz) Traditional Bluetooth and BLE WIFI Support mode sniffer,station,softap,wi-fi Direct 19
Heltec ESP32 pinout Frequency 240MHz FLASH 8 MB LoRa chip support frequency band SX127(868-91),SX1278(433-510MHz) 3.3V Traditional Bluetooth and BLE WIFI Support mode sniffer,station,softap,wi-fi Direct 20
SX127X/RFM9X configurable LoRa modems The technology behind LoRa was developed by Cycleo, a French company acquired by Semtech in 2012. LoRa is a wireless technology developed to create the low-power, wide-area networks required for machine-to-machine (M2M) and Internet of Things (IoT) applications. "LoRa technology offers a 20dB link budget advantage compared to existing solutions, which significantly extends the range of any application while delivering the lowest current consumption to maximize battery life." So how it is done? a bit of theory 21
LoRa modems a bit of theory Shannon's channel capacity for a communication link - maximum data rate in the presence of noise interference: C = B* log2(1+s/n) Where: C = channel capacity (bit/s), B = channel bandwidth (Hz) S = average received signal power (Watts) N = average noise or interference power (Watts) S/N = signal to noise ratio (SNR) expressed as a linear power ratio For a very small SNR <<1 we can write C = B* log2(1+s/n) => C= B*1.433*S/N or approximately even C = B*S/N Conclusion: to transmit an error free information in a channel of fixed noise-tosignal ratio, only the transmitted signal bandwidth need be increased. 22
LoRa modems a bit of theory C = B*S/N Conclusion: to transmit an error free information in a channel of fixed noise-tosignal ratio, only the transmitted signal bandwidth need be increased. An example: We need to obtain an additional 20dB sensibility? So we have the new S/N radio 102 times smaller. That involves the need of 100 times larger bandwidth to send one bit of data correctly. We can do it with a spread-spectrum sending 100 chips (in the same time bandwidth is 100 times higher) to carry 1 bit of data. 23
LoRa modems a bit of theory We can do it with spread-spectrum sending 100 chips (in the same time bandwidth is 100 times higher) to carry 1 bit of data. 100 times 24
LoRa modems a bit of theory For IoT, we need a cheap and practical implementation. So no highly accurate clocks but simple FM modulation and simple/fast synchronization. Rb = SF*BW / 2SF Rb = Bit Rate (bits/s) SF = Spreading Factor (7..12) BW = Bandwidth (Hz) Rs = BW / 2SF Rc = Rs* 2SF Rs = Symbol Rate (symbols/s) Rc = Chip Rate (chirps/s)) BW = Bandwidth (Hz) Rc = BW (chips/s) one chip is sent per second per Hz of bandwidth 25
IoT DevKit 26
ESP & LoRa modems a bit of practice The software: We use Arduino IDE to program Wemos D1 MCU with Radio Head RF_95 library. Attention : now works on Raspberry Pi 2/3 (38 ) or Orange Pi (15 ) 27
ESP & LoRa modems a bit of practice The software: We use ESP8266 - Wemos D1 board To be installed 28
ESP & LoRa modems a bit of practice To be used To be installed RadioHead RF95 class for LoRa 29
ESP & LoRa modems a bit of practice // If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then // you can set transmitter powers from 5 to 23 dbm: // rf95.settxpower(23, false); // for 868MHz // If you are using Modtronix inair4 or inair9,or any other module which uses the // transmitter RFO pins and not the PA_BOOST pins // then you can configure the power transmitter power for -1 to 14 dbm and with userfo true. // Failure to do that will result in extremely low transmit powers. rf95.settxpower(14, true); // for 433MHz // set mode: Bw-bandwidth,Cr-code rate,sf-spread factor //rf95.setmodemconfig(rh_rf95::bw125cr45sf128); // medium range default //rf95.setmodemconfig(rh_rf95::bw31_25cr48sf512); // slow long range rf95.setmodemconfig(rh_rf95::bw125cr48sf4096); // slow long range //rf95.setmodemconfig(rh_rf95::bw500cr45sf128); // fast short range freq=433.5; // RFM95-868.0, RFM98-433.0 rf95.setfrequency(freq); // 433.0-434.0 To do : explain the elements-values of different LoRa modulation modes 30
Summary Let us do it together! 31