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:b2 [2019/10/26 10:38] – pczekalski | en:iot-open:remotelab:ume:smartme:b2 [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== IB2: Presenting temperature and humidity values on the LCD ====== | + | ==== IB2: Presenting temperature and humidity values on the LCD ==== |
| - | + | === Target group === | |
| - | + | ||
| - | ===== Target group ===== | + | |
| This hands-on lab guide is intended for the Beginners but other target groups may benefit from it, treating it as basics for advanced projects. | This hands-on lab guide is intended for the Beginners but other target groups may benefit from it, treating it as basics for advanced projects. | ||
| - | ===== Prerequisites | + | === Prerequisites === |
| - | ==== Liquid Crystal | + | === Liquid Crystal === |
| - | For this library, you may refer to the [[en: | + | For this library, you may refer to the [[en: |
| - | ==== DHT sensors | + | === DHT sensors === |
| The nodes of SmartME Network Laboratory are equipped with different versions of DHT sensors: DHT11 and DHT22. | The nodes of SmartME Network Laboratory are equipped with different versions of DHT sensors: DHT11 and DHT22. | ||
| The sensors look a bit similar and have the same pinout, but have different characteristics. | The sensors look a bit similar and have the same pinout, but have different characteristics. | ||
| Below you can find the DHT technical specifications: | Below you can find the DHT technical specifications: | ||
| - | === DHT11 === | + | == DHT11 == |
| * Ultra-low-cost | * Ultra-low-cost | ||
| * 3 to 5V power and I/O | * 3 to 5V power and I/O | ||
| Line 27: | Line 25: | ||
| * 4 pins with 0.1" spacing | * 4 pins with 0.1" spacing | ||
| - | === DHT22 === | + | == DHT22 == |
| * Low cost | * Low cost | ||
| Line 45: | Line 43: | ||
| Temperature and relative humidity can be used to determine the apparent temperature or the human perceived equivalent temperature, | Temperature and relative humidity can be used to determine the apparent temperature or the human perceived equivalent temperature, | ||
| - | ===== Scenario | + | === Scenario === |
| First, initialize LCD screen with the labels of temperature and relative humidity. | First, initialize LCD screen with the labels of temperature and relative humidity. | ||
| Line 51: | Line 49: | ||
| More, but not used in the proposed exercise, it is possible to compute the heat index in Fahrenheit (the default) by using the function computeHeatIndex(temp_value_farenight, | More, but not used in the proposed exercise, it is possible to compute the heat index in Fahrenheit (the default) by using the function computeHeatIndex(temp_value_farenight, | ||
| Result | Result | ||
| - | You should see the values of temperature and relative humidity, that are sampled and displayed every 3 seconds (3000 ms). | + | You should see the values of temperature and relative humidity, that is sampled and displayed every 3 seconds (3000 ms). |
| Start | Start | ||
| There are no special steps to be performed. | There are no special steps to be performed. | ||
| - | ===== Steps ===== | + | === Steps === |
| - | ==== Step 1 ==== | + | == Step 1 == |
| Include LCD driver library and DHT library: | Include LCD driver library and DHT library: | ||
| <code c> | <code c> | ||
| Line 65: | Line 63: | ||
| - | ==== Step 2 ==== | + | == Step 2 == |
| Instantiate the software controller component for the LCD display. Then set up: | Instantiate the software controller component for the LCD display. Then set up: | ||
| - the DHTPIN (which refers to the digital pin we use to get the signal); | - the DHTPIN (which refers to the digital pin we use to get the signal); | ||
| Line 82: | Line 80: | ||
| </ | </ | ||
| - | ==== Step 3 ==== | + | == Step 3 == |
| Line 101: | Line 99: | ||
| - | ==== Step 4 ==== | + | == Step 4 == |
| Implement loop() to sample and display the values of temperature and relative humidity on the LCD display, every 3 seconds: | Implement loop() to sample and display the values of temperature and relative humidity on the LCD display, every 3 seconds: | ||
| Line 131: | Line 129: | ||
| - | ===== Result validation | + | === Result validation === |
| Observe the temperature and relative humidity values shown in the LCD display. The display will refresh values every 3 seconds. | Observe the temperature and relative humidity values shown in the LCD display. The display will refresh values every 3 seconds. | ||
| - | ===== Platformio.ini | + | === Platformio.ini === |
| < | < | ||
| [env:uno] | [env:uno] | ||
| Line 152: | Line 150: | ||
| </ | </ | ||
| - | ===== B2.cpp ===== | + | === IB2.cpp === |