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:sut:generalpurpose2 [2019/10/29 16:13] pczekalskien:iot-open:remotelab:sut:generalpurpose2 [Unknown date] (current) – external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== SUT VREL #1 and #3: General Purpose IoT Laboratory, air receiving nodes 1 and 3 ======+====== VREL #1 and #3: General Purpose IoT Laboratory, air receiving nodes 1 and 3 ======
 The laboratory is located at Silesian University of Technology, Gliwice, Poland, Akademicka 16, room 310. The laboratory is located at Silesian University of Technology, Gliwice, Poland, Akademicka 16, room 310.
 There are two nodes of this kind: Node 1 and 3, one per two air ducts, constituting a pair of working devices along with Nodes 2 and 4 respectively. There are two nodes of this kind: Node 1 and 3, one per two air ducts, constituting a pair of working devices along with Nodes 2 and 4 respectively.
Line 5: Line 5:
  
 ===== Introduction  ===== ===== Introduction  =====
-The lab consists of a mechanical airflow indicator going from the pipe (connected to a neighbour, TX lab). The indicator is a vertical flap, which changes position depends on airflow. The position of the flap is observable, using the camera and measurable using photoelectric proximity sensor. The signal from the sensor is sent to the AD converter and additionally is displayed on needle gauge.+The lab consists of a mechanical airflow indicator going from the pipe (connected to a neighbour, TX lab). The indicator is a vertical flap, which changes position depends on airflow. The position of the flap is observable, using the camera and measurable using photoelectric proximity sensor. The signal from the sensor is sent to the AD converter and additionally is displayed on needle gauge.
  
 ===== Prerequisites ===== ===== Prerequisites =====
Line 11: Line 11:
   * physical effect of the airflow,   * physical effect of the airflow,
   * elementary rules od light propagation,   * elementary rules od light propagation,
-  * work of unbalanced bridge.+  * work of the unbalanced bridge.
  
 ===== Sensors ===== ===== Sensors =====
-The sensor of flap position is made which photoresistors. For reference, next to the flap there is immovable surface made with the same material like the flap. Like in case of flaps, here is identical photoresistor. Both of resistor make an unbalanced bridge, with is balanced, if the flap is in the start position (without airflow). For balancing bridge in the start position, two another resistors in the bridge, are build which potentiometer.+The sensor of flap position is made which photoresistors. For reference, next to the flap there is an immovable surface made with the same material like the flap. Like in case of flaps, here is an identical photoresistor. Both of resistor make an unbalanced bridge, with is balanced, if the flap is in the start position (without airflow). For balancing bridge in the start position, two another resistors in the bridge, are build which potentiometer.
  
 ==== Technical details for the flap position monitor ==== ==== Technical details for the flap position monitor ====
-End of the air duct is fitted to rectangle flap, The flap is hanging loosely and can be pushed by the airflow. The flap is lighted by LED form the top, and at the opposite side of the flap, there is the photoresistor, which measures light intensity, reflected from the flap. The flap sensing system is connected to the analogue input A0.+The end of the air duct is fitted to rectangle flap, The flap is hanging loosely and can be pushed by the airflow. The flap is lighted by LED form the top, and at the opposite side of the flap, there is the photoresistor, which measures light intensity, reflected from the flap. The flap sensing system is connected to the analogue input A0.
  
-{{:en:iot-open:remotelab:sut:iotrx.jpg?450|}}+{{:en:iot-open:remotelab:sut:iotrx.jpg?470|}}
  
-Independent, in the lab there is a sensor of temperature and humidity, DHT22, connected to the D4/GPIO2.+Independent, in the lab there is a sensor of temperature and humidity, DHT11, connected to the D4/GPIO2.
  
-{{:en:iot-open:remotelab:sut:iotrx_sch.jpg?450|}}+{{:en:iot-open:remotelab:sut:iotrx_sch.jpg?470|}}
  
  
Line 40: Line 40:
 Then configure your LCD controller: Then configure your LCD controller:
 <code c> <code c>
-LiquidCrystal_I2C lcd(0x3F,20,4);  // set the LCD address to 0x3F for a 20 chars and 4 line display +LiquidCrystal_I2C lcd(0x3F,20,4);  // set the LCD address to 0x3F  
-</code> +                                   // for a 20 chars and 4 line display
- +
-=== Platformio.ini === +
-<code> +
-; PlatformIO Project Configuration File +
-+
-;   Build options: build flags, source filter +
-;   Upload options: custom upload port, speed and extra flags +
-;   Library options: dependencies, extra library storages +
-;   Advanced options: extra scripting +
-+
-; Please visit documentation for the other options and examples +
-; http://docs.platformio.org/page/projectconf.html +
- +
-[env:d1_mini] +
-platform = espressif8266 +
-board = d1_mini +
-framework = arduino +
-lib_deps = Wire, EmonLib, Adafruit NeoPixel, Encoder,DHT sensor library, Adafruit Unified Sensor, LCD, PubSubClient, KS0108_PCF8574, CoAP simple library+
 </code> </code>
  
Line 81: Line 63:
  
 ===== 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.h> 
 + 
 +LiquidCrystal_I2C lcd(0x3F,20,4);  
 + 
 +void setup() 
 +
 +  pinMode(4,OUTPUT); 
 +  pinMode(5, OUTPUT); 
 +  digitalWrite(4,LOW); 
 +  digitalWrite(5,LOW); 
 +  delay(2000); 
 +  pinMode(5, INPUT);       // reset pin 
 +  pinMode(4, INPUT); 
 +  delay(2050); 
 +  lcd.init(D2,D1); 
 +  lcd.backlight(); 
 +  lcd.home(); 
 +  lcd.print("Hello world..."); 
 +
 +void loop() 
 +
 +   
 +
 +</code> 
 +Finally, you should see Hello World message on the LCD and I2C bus should be recovered now.
en/iot-open/remotelab/sut/generalpurpose2.1572365626.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