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/10/29 14:25] – pczekalski | en:iot-open:remotelab:sut:generalpurpose [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| 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 ===== | ||
| Line 37: | Line 37: | ||
| * SCL GPIO4 / D2 | * SCL GPIO4 / D2 | ||
| - | {{: | + | {{: |
| ===== Software, libraries and externals ===== | ===== Software, libraries and externals ===== | ||
| Line 47: | Line 47: | ||
| Then configure your LCD controller: | Then configure your LCD controller: | ||
| <code c> | <code c> | ||
| - | LiquidCrystal_I2C lcd(0x3F, | + | LiquidCrystal_I2C lcd(0x3F, |
| + | // | ||
| </ | </ | ||
| - | == Platformio.ini == | ||
| - | < | ||
| - | ; PlatformIO Project Configuration File | ||
| - | ; | ||
| - | ; Build options: build flags, source filter | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; Please visit documentation for the other options and examples | ||
| - | ; http:// | ||
| - | |||
| - | [env: | ||
| - | platform = espressif8266 | ||
| - | board = d1_mini | ||
| - | framework = arduino | ||
| - | lib_deps = Wire, EmonLib, Adafruit NeoPixel, Encoder,DHT sensor library, Adafruit Unified Sensor, LCD, PubSubClient, | ||
| - | </ | ||
| === Communication === | === Communication === | ||
| Line 88: | Line 71: | ||
| - | ==== 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 < | ||
| + | #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. | ||