Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:remotelab:ume:smartme [2019/09/27 16:46] salvatdien: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 ======
-/* //Give an information, where laboratory is located (partner name) and very short description (like one sentence).// */ +
 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  ===== 
-/* //Here provide some general idea of the laboratory. Do not use very complicated phrases. It is to be understood by people with limited understanding of the technology. Photos, schematics, and drawings may be attached as well.// +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), Arancino, which combines in the same board an Arduino-like MCU (based on an ARM Cortex M0+ @48MHz) and a Raspberry Pi 3 compute module. In this section, we will focus on the 5 pure Arduino nodes and their sensors and actuators.
-//Write objectives for the laboratory i.e. "its purpose is to model ...." or "simulate", or simply to "practice". Write some objectives. Provide a link to the live video stream (if any).// */ +
-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 practicing 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 Raspbery Pi 3 b+, the last node is a combo board developed by a spinoff company (SmartMe.io), Arancino, which combines in the same board an Arduino-like MCU (based on an ARM Cortex M0+ @48MHz) and a Raspberry Pi 3 compute module. In this section, we will focus on the 5 pure Arduino nodes and their sensors and actuators. +
- +
-==== Prerequisites ==== +
-/* //Describe prerequisite readings, software, hardware (if any) - note - only those that apply to ALL scenarios, knowledge necessary to understand. I case single scenario requires some extra knowledge/prerequisites, provide it with the scenario document, not here.// */+
  
 +===== 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 17: Line 11:
  
  
-==== Technical details ==== +===== Technical details =====
-/* //Provide technical details on the construction of the laboratory, both hardware, and software. Use technical words and sentences. It is to be understood by technology-related people. Consider it as a kind of laboratory hardware and eventually software implementation. Sections below (remove section if not present) present details. Provide circuit, essential mechanical schema, if necessary to use the laboratory and understand its physics/mechanics, etc.// */+
 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 
  
-{{ :en:iot-open:remotelab:ume:umelab.png?500 |UME Distance Lab Nodes 1-5}}+{{ :en:iot-open:remotelab:ume:umelab.png?470 |UME Distance Lab Nodes 1-5}}
  
  
-=== 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
-{{ :en:iot-open:remotelab:ume:nodo.png?850 | Nodes 1-5 schematic}}+ 
 +{{:en:iot-open:remotelab:ume:nodo_verticale.png?330 | Nodes 1-5 schematic}}
  
  
-=== Sensors === +===== Sensors =====
-/* //Describe sensors (if any). Provide details on measured values, connection details, accuracy, protocols, its relation to the physical/mechanical part of the laboratory (if any). Add photos and schematics, where the sensor is located. In case the sensor is virtual, do not expose it - present as physical until it is essential to know it regarding study (i.e. code implementation, timings, etc.). Provide links to external resources regarding i.e. necessary libraries, protocol definition, etc.// */+
  
 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 53: Line 46:
 Some nodes of the lab are equipped with "MIKROE-2818 DHT22 2 click" sensors. This sensor feature ultra-small size, low-power consumption, data signal transmission distance up to 20mts, and good measuring accuracy [1]. The sensing part is the CM2322, which uses a capacitive humidity sensor and a thermistor to measure the surrounding air. Typical temperature accuracy is ±0.3°C, while relative humidity accuracy is 2% RH. The humidity and temperature measurement are compensated by some calibration coefficient, which is saved in the OTP memory of an integrated MCU. The integrated MCU also provides I2C or 1Wire interface, selectable by the onboard SMD jumper selectors. The operating voltage can also be selected by the onboard SMD jumper [2]. As shown in the previous figure, the 1Wire mode was chosen while the operating voltage is 5V. The sensor is connected to pin 8 of Arduino Uno. Some nodes of the lab are equipped with "MIKROE-2818 DHT22 2 click" sensors. This sensor feature ultra-small size, low-power consumption, data signal transmission distance up to 20mts, and good measuring accuracy [1]. The sensing part is the CM2322, which uses a capacitive humidity sensor and a thermistor to measure the surrounding air. Typical temperature accuracy is ±0.3°C, while relative humidity accuracy is 2% RH. The humidity and temperature measurement are compensated by some calibration coefficient, which is saved in the OTP memory of an integrated MCU. The integrated MCU also provides I2C or 1Wire interface, selectable by the onboard SMD jumper selectors. The operating voltage can also be selected by the onboard SMD jumper [2]. As shown in the previous figure, the 1Wire mode was chosen while the operating voltage is 5V. The sensor is connected to pin 8 of Arduino Uno.
  
-The PMS7003 consists on a digital and universal particle concentration sensor, which can be used to obtain the number of suspended particles in the air, i.e. the concentration of particles, and output them in the form of digital interface. The working principle of such sensor consists into produce scattering by using a laser to radiate suspending particles in the air, then collect scattering light in a certain degree, and finally obtain the curve of scattering light change with time. In the end, the equivalent particle diameter and the number of particles with different diameter per unit volume can be calculated [3]. So, the values of PM1.0, PM2.5, and PM10, will be available for our scopes. In order to physically interface the 10 bus lines of the sensor with Arduino Uno, the PMS7003 connector shown in the previous figure was employed [4]. By supplying the adapter at 5V, the particle sensor will operate correctly and the data will be available at RX and TX pins. However, the serial voltage level is 3.3V typical, while Arduino Uno needs 5V. For this reason, a bi-directional level converter was introduced [5]: by supplying the HV (High Voltage) side at 5V and the LV (Low Voltage) side at 3.3V, the serial levels will be correct on both sides (Arduino at 5V, PMS7003 at 3.3V). Since is not possible to deploy the code by using, at the same time, the default RX, TX pins (0,1) of Arduino Uno, the PMS7003 is connected to pins 9 and 10: by using the <SoftwareSerial.h> library, such pins can be used as RX and TX of Arduino Uno, respectively.+The PMS7003 consists of a digital and universal particle concentration sensor, which can be used to obtain the number of suspended particles in the air, i.e. the concentration of particles, and output them in the form of digital interface. The working principle of such sensor consists into produce scattering by using a laser to radiate suspending particles in the air, then collect scattering light to a certain degree, and finally obtain the curve of scattering light change with time. In the end, the equivalent particle diameter and the number of particles with different diameters per unit volume can be calculated [3]. So, the values of PM1.0, PM2.5, and PM10, will be available for our scopes. In order to physically interface the 10 bus lines of the sensor with Arduino Uno, the PMS7003 connector shown in the previous figure was employed [4]. By supplying the adapter at 5V, the particle sensor will operate correctly and the data will be available at RX and TX pins. However, the serial voltage level is 3.3V typical, while Arduino Uno needs 5V. For this reason, a bi-directional level converter was introduced [5]: by supplying the HV (High Voltage) side at 5V and the LV (Low Voltage) side at 3.3V, the serial levels will be correct on both sides (Arduino at 5V, PMS7003 at 3.3V). Since is not possible to deploy the code by using, at the same time, the default RX, TX pins (0,1) of Arduino Uno, the PMS7003 is connected to pins 9 and 10: by using the <SoftwareSerial.h> library, such pins can be used as RX and TX of Arduino Uno, respectively.
  
 [1]https://www.mouser.it/new/mikroelektronika/mikroelektronika-mikroe-2818-dht22-2-click/ [1]https://www.mouser.it/new/mikroelektronika/mikroelektronika-mikroe-2818-dht22-2-click/
Line 65: Line 58:
 [5]https://kamami.com/voltage-level-converters/234535-logic-level-converter-bi-directional.html [5]https://kamami.com/voltage-level-converters/234535-logic-level-converter-bi-directional.html
  
-=== Actuators === +===== Actuators =====
-/* //Describe actuators, their impact on the physical/mechanical part of the laboratory device, limits, connections, etc. Add photos and schematics, where the actuator is located. In case the actuator is virtual, do not expose it - present as physical until it is essential to know it regarding study (i.e. code implementation, timings, etc.). Provide links to external resources regarding i.e. necessary libraries, protocol definition, etc.// */+
 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 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 <LiquidCrystal.h> library supports the 4 bit communication. As shown in the figure, the Arduino Uno pins 5, 4, 13, 2 are used for the 4 bit communication (display pins 13, 14, 15, 16), while the Arduino Uno pins 7, 6 are used for the RS (Register Select) and for the E (Enable) (display pins 8, 6). The not used display data pins (9, 10, 11, 12) are simply not connected. The other display pins are used for the power supply (1,2) and to control the display light via the potentiometer (3,4). The display R/W pin (7) is simply connected to GND since only the write operation is required.  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 <LiquidCrystal.h> library supports the 4 bit communication. As shown in the figure, the Arduino Uno pins 5, 4, 13, 2 are used for the 4 bit communication (display pins 13, 14, 15, 16), while the Arduino Uno pins 7, 6 are used for the RS (Register Select) and for the E (Enable) (display pins 8, 6). The not used display data pins (9, 10, 11, 12) are simply not connected. The other display pins are used for the power supply (1,2) and to control the display light via the potentiometer (3,4). The display R/W pin (7) is simply connected to GND since only the write operation is required. 
    
Line 79: Line 71:
  
  
-=== Software, libraries and externals === +===== Software, libraries and externals =====
-/* //Provide a list of software, software libraries and external resources (i.e. files) necessary during code development. Please note, write here only common for all hands-on-labs scenarios (there is a relevant section in scenario template. Remove this section if empty.// */ +
 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 110: Line 100:
 </code> </code>
    
-  Then configure your DHT sensor:+  Configure your DHT sensor:
 <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 126: Line 116:
 </code> </code>
    
-The PMS sensor is connected to pins 9 and 10: by using the <SoftwareSerial.h> library, such pins can be used as rx and tx of Arduino Uno, respectively. +The PMS sensor is connected to pins 9 and 10: by using the ''<SoftwareSerial.h>'' library, such pins can be used as rx and tx of Arduino Uno, respectively. 
 <code c> <code c>
 #include <SoftwareSerial.h> #include <SoftwareSerial.h>
Line 133: 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 ''Ethernet.h'' library allows an Arduino board to connect to the Internet.
 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 146: Line 136:
 </code> </code>
    
-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/subscribe messaging with a server that supports MQTT.+MQTT connectivity protocol requires a dedicated library. The ''MQTT.h'' library uses the Arduino Ethernet Client API for interacting with the underlying network hardware. This library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT.
 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 152: Line 142:
 </code> </code>
    
-“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. 
 <code> <code>
Line 177: Line 167:
  
  
-=== Communication === +===== Communication =====
-/*//Describe communication if it is implemented and sealed (not intended to be implemented by students, or provided i.e. as default code). Present data flow. Describe protocols and details i.e. key-value pairs, etc. Provide how exceptions are handled.//*/ +
 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 189: Line 177:
   * receive messages subscribing to a specific topic.   * receive messages subscribing to a specific topic.
  
-{{ :en:iot-open:remotelab:ume:mqtt_-publish_and_subscribe_system_.png?500 |}}+{{ :en:iot-open:remotelab:ume:mqtt_-publish_and_subscribe_system_.png?400 |}}
  
  
-=== Limits === +===== Limits =====
-/*//Provide information about limits on usage, i.e. need for maintenance/service break, access mode (parallel, booking, etc.), manual mechanical reset, etc.//*/+
 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. 
  
  
-==== Hands-on labs ==== +===== Support =====
-/*//List study scenarios (hands-on labs), linking to the Dokuwiki pages with hands-on labs descriptions (there should be a separate page for each scenario). Classify each scenario and refer to the target group using starting keywords: +
-  * Beginners +
-  * Undergraduates +
-  * Masters +
-  * Professionals +
-Note, assume that more professional group automatically contains less professional ones. Note - use language and as appropriate to the target group, i.e.://*/ +
- +
-  * Beginners:  +
-     * [[en:iot-open:remotelab:ume:smartme:b1|B1: Basic operations on the 2x16 LCD screen.]] +
-     * [[en:iot-open:remotelab:ume:smartme:b2|B2: Showing temperature and humidity values on the LCD.]] +
-     * [[en:iot-open:remotelab:ume:smartme:b3|B3: PWM mode (~) of digital pins, programming threshold values.]] +
-  * Undergraduates:  +
-     * [[en:iot-open:remotelab:ume:smartme:u1|U1: PMS7003]] +
-  * Masters: +
-     * [[en:iot-open:remotelab:ume:smartme:m1|M1: MQTT to publish a message]] +
-     * [[en:iot-open:remotelab:ume:smartme:m2|M2: MQTT to subscribe to a topic to receive messages]]  +
- +
-==== Support ==== +
-/*//Give some information about how to access help, how to get support in case of the trouble etc.//*/+
 gmerlino@unime.it, rdipietro@unime.it  gmerlino@unime.it, rdipietro@unime.it 
- 
- 
en/iot-open/remotelab/ume/smartme.1569602798.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0