Page 1
Enabling DHT11 Humidity Sensor on the Intel® Quark™ Microcontroller D2000 Application Note August 2016 Document Number: 334787-001EN
Page 2
You may not use or facilitate the use of this document in connection with any infringement or other legal analysis concerning Intel products described herein. You agree to grant Intel a non-exclusive,...
Page 3
Contents 1.0 Abstract ........................................................................................................................................................ 6 2.0 Introduction .........
Page 4
Tables Table 1. DHT11 Pin Description.................................................................................................................................... 8 Table 2. Output Description ...
Page 5
Revision History Date Revision Description August 2016 001 Initial release. Enabling DHT11 Humidity Sensor on Intel® Quark™ Microcontroller D2000 August 2016 Application Notes Document Number: 334787-...
Page 6
Abstract 1.0 Abstract The library of most Arduino-compatible sensors is driven by C++. However, Intel® System Studio for Microcontroller 2016 does not offer C++ compiler features. The lack of C++ comp...
Page 7
Introduction 2.0 Introduction Humidity and temperature data logging are extremely useful for agriculture-related projects to monitor crops and to keep the health of crops in check within the sensor ra...
Page 8
Introduction Table 1. DHT11 Pin Description Pin No. Pin Name Description 1 VDD 3–5.5V DC power supply 2 Data Serial data, single bus 3 NC Reserved 4 GND Ground Figure 2. DHT11 Schematic VDD VDD 5K Ohm...
Page 9
Introduction Figure 3. Intel® Quark™ Microcontroller D2000 Development Board and DHT11 Hardware Connection Note: Pin 0 and 1 on the Intel® Quark™ Microcontroller D2000 development board connects to US...
Page 10
Introduction Figure 4. DHT11 Timing Diagram Based on the DHT11 operational timing diagram shown in Figure 4, the Intel® Quark™ Microcontroller D2000 establishes communication with DHT11 by sending a L...
Page 11
Software Implementation 3.0 Software Implementation The initial software requirement for enabling DHT11 is to obtain the sensor library and Arduino sample code. These are publicly available on Git Hub...
Page 12
Software Implementation Figure 6. Standard C Code Structure int main() /* Everything in void setup() should be included here;*/ while (1) /* Everything in void loop() should be included here;*/ 3.3 Se...
Page 13
Software Implementation 3.4 Sending Logic Value You can use qm_gpio_set_pin() to set the DHT11 pin to HIGH (5V), as shown in Figure 10. Figure 10. Sending Logic HIGH #define PIN_DHT11 5 /* Pin 5 conne...
Page 14
DHT11 Sample Code in QMSI 4.0 DHT11 Sample Code in QMSI The following figures show the DHT11 code pieces written in QMSI, which have been adapted from the original source code. The overall code is div...
Page 15
DHT11 Sample Code in QMSI Figure 14. Sending Start Signal to DHT11 cfg.direction = BIT(PIN_DHT11); qm_gpio_set_config(QM_GPIO_0, &cfg); /* Act like Arduino’s pin Mode. Setting * DHT11 pin on D2000...
Page 16
DHT11 Sample Code in QMSI Figure 16. Comparing Cycle Counts for (i=0; i<80; i+=2) { cycles[i] = expect Pulse(0); */ LOW */ cycles[i+1] = expect Pulse(1); */ HIGH */ // Inspect pulses and determine ...
Page 17
Conclusion 5.0 Conclusion The following figure shows the expected output after you successfully download the code into the Intel® Quark™ Microcontroller D2000. Figure 18. Expected Output Note: The Rec...