This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:sut:generalpurpose [2019/08/01 08:33] – pczekalski | en:iot-open:remotelab:sut:generalpurpose [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | + | ====== VREL #2 and #4: General Purpose IoT Laboratory, air pushing nodes 2 and 4 ====== | |
| - | ===== VREL #2 and #4: General Purpose IoT Laboratory, air pushing nodes 2 and 4 ===== | + | |
| The laboratory is located at Silesian Technical University, Poland, Gliwice Akademicka 16, room 310. | The laboratory is located at Silesian Technical University, Poland, Gliwice Akademicka 16, room 310. | ||
| - | ==== Introduction | + | ===== Introduction |
| The node is an airflow generator, connected to the appropriate air receiving node. There is an air duct that connects nodes (node 2 send air to node 1, while node 4 send air to node 3). | The node is an airflow generator, connected to the appropriate air receiving node. There is an air duct that connects nodes (node 2 send air to node 1, while node 4 send air to node 3). | ||
| The lab consists of the fan which is a source of airflow going to the air duct. The beam of the airflow can be regulated in two ways: | The lab consists of the fan which is a source of airflow going to the air duct. The beam of the airflow can be regulated in two ways: | ||
| Line 10: | Line 9: | ||
| The voltage on the fan is visible on needle multimeter. | The voltage on the fan is visible on needle multimeter. | ||
| - | ==== Prerequisites ==== | + | ===== Prerequisites |
| The user needs to know: | The user needs to know: | ||
| * physical effect of the airflow, | * physical effect of the airflow, | ||
| Line 16: | Line 15: | ||
| * working od servo-motors and its control. | * working od servo-motors and its control. | ||
| - | ==== Technical details ==== | + | ===== Technical details |
| End of the pipe is fitted to fan which is covered by rectangle flap. The flap is hanging on servomotor lever. Both fan and servomotor, are connected to the PWM outputs (each has its pin, enabling to control them independently) from the SoC. It is possible to change the rotating speed of the fan, and also the position of the flap. Parallel, the voltage on the fan (effective value), is displayed on analogue spindle voltage meter and can be observed via camera. | End of the pipe is fitted to fan which is covered by rectangle flap. The flap is hanging on servomotor lever. Both fan and servomotor, are connected to the PWM outputs (each has its pin, enabling to control them independently) from the SoC. It is possible to change the rotating speed of the fan, and also the position of the flap. Parallel, the voltage on the fan (effective value), is displayed on analogue spindle voltage meter and can be observed via camera. | ||
| - | {{: | + | {{: |
| - | === Sensors === | + | ===== Sensors |
| - | There is temperature and humidity sensor in the lab node: DHT22, connected to the GPIO0 (D3). | + | There is a temperature and humidity sensor in the lab node: DHT11, connected to the GPIO0 (D4). |
| - | === Actuators === | + | ===== Actuators |
| There are two actuators (fan, servo) and LCD display. | There are two actuators (fan, servo) and LCD display. | ||
| * The fan is a DC controlled one, where using PWM one can change rotation speed. | * The fan is a DC controlled one, where using PWM one can change rotation speed. | ||
| * the pin is GPIO 15/ D8 | * the pin is GPIO 15/ D8 | ||
| - | * The servo is an analogue servo, | + | * The servo is an analogue servo, |
| * min timing 1500us max timing 1900us | * min timing 1500us max timing 1900us | ||
| * the pin is GPIO 14 / D5 | * the pin is GPIO 14 / D5 | ||
| Line 38: | Line 37: | ||
| * SCL GPIO4 / D2 | * SCL GPIO4 / D2 | ||
| - | {{: | + | {{: |
| + | |||
| + | ===== Software, libraries and externals ===== | ||
| + | LCD display requires a dedicated library. Of course, you can control it on the low-level programming, | ||
| + | The LCD I2C control library can be imported to the source code via: | ||
| + | <code c> | ||
| + | #include < | ||
| + | </ | ||
| + | Then configure your LCD controller: | ||
| + | <code c> | ||
| + | LiquidCrystal_I2C lcd(0x3F, | ||
| + | // for a 20 chars and 4 line display | ||
| + | </ | ||
| - | === 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.// | ||
| === Communication === | === Communication === | ||
| Line 54: | Line 63: | ||
| * Passkey: IoTlab32768 | * Passkey: IoTlab32768 | ||
| * Setup your microcontroller for DHCP, to automatically obtain an IP address, your ESP will obtain the address from the 192.168.90.X pool. | * Setup your microcontroller for DHCP, to automatically obtain an IP address, your ESP will obtain the address from the 192.168.90.X pool. | ||
| - | * MQTT server is available under fixed address: 192.168.90.5, | + | * MQTT server is available under the fixed address: 192.168.90.5, |
| * User: vrel | * User: vrel | ||
| * Password: vrel2018 | * Password: vrel2018 | ||
| Line 61: | Line 70: | ||
| At the same time, only one user can program the controller, although analysing the signal by others (unlimited number) the users is reasonable. Model is provided to work continuously, | At the same time, only one user can program the controller, although analysing the signal by others (unlimited number) the users is reasonable. Model is provided to work continuously, | ||
| - | ==== Hands-on labs ==== | ||
| - | Generally, this node provides airflow to the neighbour receiving (Rx) node: node 2 sends air to node 1, node 4 sends air to node 2. For simple scenarios it is enough to book just one node while to simulate complex scenarios, it is essential to book and solve complex problems using two nodes. | ||
| - | * Beginners: | ||
| - | * [[en: | ||
| - | * [[en: | ||
| - | * [[en: | ||
| - | * Undergraduates: | ||
| - | * [[en: | ||
| - | * [[en: | ||
| - | * Masters: | ||
| - | * [[en: | ||
| - | * [[en: | ||
| - | ==== Support ==== | + | ===== Support |
| - | gabriel.drabik@polsl.pl | + | In case the LCD display hangs and you are sure that your code should work but it does not, it may be the case the I2C bus is stuck and hang the I2C to LCD controller converter.\\ |
| + | In this case, please use the following code to reset the I2C bus (you can embed it to your source code or run separately, then run your original code, again): | ||
| + | <code c> | ||
| + | #include <Arduino.h> | ||
| + | #include < | ||
| + | |||
| + | LiquidCrystal_I2C lcd(0x3F, | ||
| + | void setup() | ||
| + | { | ||
| + | pinMode(4, | ||
| + | pinMode(5, OUTPUT); | ||
| + | digitalWrite(4, | ||
| + | digitalWrite(5, | ||
| + | delay(2000); | ||
| + | pinMode(5, INPUT); | ||
| + | pinMode(4, INPUT); | ||
| + | delay(2050); | ||
| + | lcd.init(D2, | ||
| + | lcd.backlight(); | ||
| + | lcd.home(); | ||
| + | lcd.print(" | ||
| + | } | ||
| + | void loop() | ||
| + | { | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | Finally, you should see Hello World message on the LCD and I2C bus should be recovered now. | ||