This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:ume:smartme [2019/10/26 10:35] – pczekalski | en:iot-open:remotelab:ume:smartme [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== SmartMe Network Laboratory: Arduino Nodes 1-5 ===== | + | ====== SmartMe Network Laboratory: Arduino Nodes 1-5 ====== |
| The SmartMe lab is located at the Engineering building of the University of Messina, in Messina, Italy. | The SmartMe lab is located at the Engineering building of the University of Messina, in Messina, Italy. | ||
| - | ==== Introduction | + | ===== Introduction |
| Its main goal is to provide a simple testbed of a smart city, mainly focusing on smart environment application scenarios. To this purpose, 6 nodes have been equipped and made available to students for practising in these contexts. These nodes can be framed into the MCU (Arduino) + MPU (Raspberry Pi) category: 5 out of 6 combine an Arduino Uno with a Raspberry Pi 3 b+, the last node is a combo board developed by a spinoff company (SmartMe.io), | Its main goal is to provide a simple testbed of a smart city, mainly focusing on smart environment application scenarios. To this purpose, 6 nodes have been equipped and made available to students for practising in these contexts. These nodes can be framed into the MCU (Arduino) + MPU (Raspberry Pi) category: 5 out of 6 combine an Arduino Uno with a Raspberry Pi 3 b+, the last node is a combo board developed by a spinoff company (SmartMe.io), | ||
| - | ==== Prerequisites ==== | + | ===== Prerequisites |
| To approach this laboratory, the student should grasp: | To approach this laboratory, the student should grasp: | ||
| * basic MQTT concepts like topics, broker, subscribing and publishing; | * basic MQTT concepts like topics, broker, subscribing and publishing; | ||
| Line 11: | Line 11: | ||
| - | ==== Technical details ==== | + | ===== Technical details |
| 4 Arduino nodes are Internet-connected by a router through ETH, while the 5th is reachable only by the IoT gateway (RaspPi). | 4 Arduino nodes are Internet-connected by a router through ETH, while the 5th is reachable only by the IoT gateway (RaspPi). | ||
| The Lab configuration is shown in the figure below | The Lab configuration is shown in the figure below | ||
| - | {{ : | + | {{ : |
| - | === Node schematic === | + | ==== Node schematic |
| All Arduino nodes are configured as reported in the following schematic | All Arduino nodes are configured as reported in the following schematic | ||
| - | {{ : | ||
| + | {{: | ||
| - | === Sensors === | + | |
| + | ===== Sensors | ||
| Each node is equipped with either a DHT11 or DHT22 sensor and a PMS7003 sensor. | Each node is equipped with either a DHT11 or DHT22 sensor and a PMS7003 sensor. | ||
| Line 45: | Line 46: | ||
| Some nodes of the lab are equipped with " | Some nodes of the lab are equipped with " | ||
| - | The PMS7003 consists | + | The PMS7003 consists |
| [1]https:// | [1]https:// | ||
| Line 57: | Line 58: | ||
| [5]https:// | [5]https:// | ||
| - | === Actuators === | + | ===== Actuators |
| There are no mechanical actuators in this laboratory. | There are no mechanical actuators in this laboratory. | ||
| Each node is equipped with a 2x16 LCD screen and with an RGB led, but it is possible to use only the green light component. | Each node is equipped with a 2x16 LCD screen and with an RGB led, but it is possible to use only the green light component. | ||
| - | The green led of the RGB is connected to the Arduino pin 3. Since such pin supports the PWM, the led brilliance can be set. Moreover, the led can be used for blinking or to indicate when a threshold is reached. | + | The green led of the RGB is connected to the Arduino pin 3. Since such a pin supports the PWM, the led brilliance can be set. Moreover, the led can be used for blinking or to indicate when a threshold is reached. |
| The 2x16 LCD is a Displaytech 162B based on the HD44780 standard. Such standard means that the display supports almost all characters of the ASCII character table. Therefore, it is possible to display the most important characters. The display controller, which is integrated into the display, can generate these characters and send them to the matrix. In addition to the already 208 known characters, it is also possible to draw any other characters and signs. The display controller handles most of the operations, so the code for the microcontroller is very short [6]. Both 8 bit or 4-bit mode can be used to drive the display. The < | The 2x16 LCD is a Displaytech 162B based on the HD44780 standard. Such standard means that the display supports almost all characters of the ASCII character table. Therefore, it is possible to display the most important characters. The display controller, which is integrated into the display, can generate these characters and send them to the matrix. In addition to the already 208 known characters, it is also possible to draw any other characters and signs. The display controller handles most of the operations, so the code for the microcontroller is very short [6]. Both 8 bit or 4-bit mode can be used to drive the display. The < | ||
| Line 70: | Line 71: | ||
| - | === Software, libraries and externals === | + | ===== Software, libraries and externals |
| The following libraries are required to run the example proposed below for the hands-on labs: | The following libraries are required to run the example proposed below for the hands-on labs: | ||
| * Liquid Crystal | * Liquid Crystal | ||
| Line 99: | Line 100: | ||
| </ | </ | ||
| - | | + | |
| <code c> | <code c> | ||
| #define DHTPIN 8 // Digital pin connected to the DHT sensor | #define DHTPIN 8 // Digital pin connected to the DHT sensor | ||
| Line 115: | Line 116: | ||
| </ | </ | ||
| - | The PMS sensor is connected to pins 9 and 10: by using the < | + | The PMS sensor is connected to pins 9 and 10: by using the '' |
| <code c> | <code c> | ||
| #include < | #include < | ||
| Line 122: | Line 123: | ||
| - | Arduino Ethernet Shield requires a dedicated library. With the Arduino Ethernet Shield, the library “Ethernet” allows an Arduino board to connect to the Internet. | + | Arduino Ethernet Shield requires a dedicated library. With the Arduino Ethernet Shield, the '' |
| The Arduino Ethernet Shield library can be imported to the source code via: | The Arduino Ethernet Shield library can be imported to the source code via: | ||
| <code c> | <code c> | ||
| Line 135: | Line 136: | ||
| </ | </ | ||
| - | MQTT connectivity protocol requires a dedicated library. The “MQTT” library uses the Arduino Ethernet Client API for interacting with the underlying network hardware. This library provides a client for doing simple publish/ | + | MQTT connectivity protocol requires a dedicated library. The '' |
| The Arduino Ethernet Shield library can be imported to the source code via: | The Arduino Ethernet Shield library can be imported to the source code via: | ||
| <code c> | <code c> | ||
| Line 141: | Line 142: | ||
| </ | </ | ||
| - | “platformio.ini” (Project Configuration File) | + | === “platformio.ini” (Project Configuration File) === |
| The Project configuration file is named platformio.ini. | The Project configuration file is named platformio.ini. | ||
| < | < | ||
| Line 166: | Line 167: | ||
| - | === Communication === | + | ===== Communication |
| The user can connect and program the controller of each node by using the Distancelab environment by booking it for the time he needs. The user can use the MQTT protocol. MQTT stands for Message Queuing Telemetry Transport. | The user can connect and program the controller of each node by using the Distancelab environment by booking it for the time he needs. The user can use the MQTT protocol. MQTT stands for Message Queuing Telemetry Transport. | ||
| Line 176: | Line 177: | ||
| * receive messages subscribing to a specific topic. | * receive messages subscribing to a specific topic. | ||
| - | {{ : | + | {{ : |
| - | === Limits === | + | ===== Limits |
| At the same time, only one user can program the controller. But all users connected to the Distancelab MQTT broker can read the values if they are being transmitted over MQTT. | At the same time, only one user can program the controller. But all users connected to the Distancelab MQTT broker can read the values if they are being transmitted over MQTT. | ||
| - | + | ===== Support | |
| - | ==== Support ==== | + | |
| gmerlino@unime.it, | gmerlino@unime.it, | ||
| - | |||
| - | |||