Ks0129 keyestudio EASY plug DHT11 Temperature and Humidity Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 28: Line 28:
<br>
<br>
==Upload the Code==
==Upload the Code==
Copy and paste below code to [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE] and upload.  
Below is an example code. Open or drag below code to [https://wiki.keyestudio.com/Getting_Started_with_Mixly  Mixly Blocks] and upload. <br>
<pre>
<br>[[File:ks0397 20.1.png|500px|frameless|thumb]]<br>
#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 9
void setup(){
Serial.begin(9600);
Serial.println("DHT TEST PROGRAM ");
Serial.print("LIBRARY VERSION: ");
Serial.println(DHT11LIB_VERSION);
Serial.println();
Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}
void loop(){
int chk;
Serial.print("DHT11, \t");
chk = DHT.read(DHT11_PIN);//READ DATA
switch (chk){
case DHTLIB_OK:
Serial.print("OK,\t");
break;
case DHTLIB_ERROR_CHECKSUM:
Serial.print("Checksum error,\t");
break;
case DHTLIB_ERROR_TIMEOUT:
Serial.print("Time out error,\t");
break;
default:
Serial.print("Unknown error,\t");
break;
}
// DISPLAT DATA
Serial.print(DHT.humidity,1);
Serial.print(",\t");
Serial.println(DHT.temperature,1);
delay(1000);
}
</pre>


<span style="color: red">'''Code to Note: ''' </span> <br>
<br>
Before compile the code, do remember to put the libraries needed inside the libraries folder of Arduino IDE directory.<br>
==What You Should See==
Download all the libraries:<br>
Open the Serial monitor, you should be able to see the temperature and humidity data. <br>
https://drive.google.com/open?id=1GIaSDErMAz5O6N_h9Ml_Zk4dRjR-WapT
<br>[[File:ks0397 20-2.png|500px|frameless|thumb]]<br>


<br>
<br>
<span style="color: red">'''Little Knowledge:'''</span> <br>
* If the data is scrolling very fast, you can’t make out the data clearly, so you can modify the Delay time in the code to check it easily.
<br>[[File:ks0397 20-5.png|500px|frameless|thumb]]<br>


==What You Should See==
<br>
Open the Serial monitor to see the temperature and humidity data.  
==Extension Experiment==  
<br>[[File:ks0129 Result.gif|700px|frameless|thumb]]<br>
<br>
<span style=color:brown>'''Make a Hygrothermograph'''</span><br>
<br>
'''Hookup Guide'''<br>
Connect the EASY Plug DHT11 sensor and 1602 LCD module to control board using RJ11 cables.
<br>[[File:温湿度2.jpg|500px|frameless|thumb]]<br>
 
<br>
'''Test Code'''<br>
Below is an example code.
<br>[[File:ks0397 20.1.png|500px|frameless|thumb]]<br>
 
<br>
'''What You Should See'''<br>
<br>[[File:ks0397 20-3.png|500px|frameless|thumb]]<br>
<br>
Upload success, you should be able to see the temperature and humidity data are showed on the LCD screen.  
<br>[[File:ks0397 20-4.png|500px|frameless|thumb]]<br>


<br>
<br>


<br>
==Resources ==
==Resources ==
'''Datasheet:'''<br>
'''Arduino Code and Datasheet:'''<br>
https://drive.google.com/open?id=16c0ZfBYkPR77hy53iIoWxFF7lu-q7crj
https://drive.google.com/open?id=1pbeFuS1YsZ8lKFd7UIJqycp7alHwpMlJ


'''Download the libraries dht11:'''<br>
'''Mixly Code and Datasheet:'''<br>
https://drive.google.com/open?id=1GIaSDErMAz5O6N_h9Ml_Zk4dRjR-WapT
https://drive.google.com/open?id=1D7vcg_vTQzHq-ZdqdbtaOhvaBkCc7diP


'''Download the code:''' <br>
https://drive.google.com/open?id=1ugnlOI5qxP5vwVkLjCxEaCKTrk019owp


<br>
<br>
==Buy from ==
==Buy from ==
*'''Official Website:''' http://www.keyestudio.com/ks0129.html
*[https://www.keyestudio.com/new-keyestudio-easy-plug-dht11-temp-humidity-sensor-module-for-arduino-steam-p0070-p0070.html   '''Official Website''']


* [https://www.aliexpress.com/store/product/New-Keyestudio-EASY-plug-DHT11-Temperature-Humidity-Sensor-Module-for-arduino/1452162_32645959631.html?spm=2114.12010612.8148356.24.41484ba7oHPAY6  Shop on aliexpress ]
* [https://www.aliexpress.com/store/product/New-Keyestudio-EASY-plug-DHT11-Temperature-Humidity-Sensor-Module-for-arduino/1452162_32645959631.html?spm=2114.12010612.8148356.24.41484ba7oHPAY6  Shop on aliexpress ]

Revision as of 13:36, 7 May 2019

Keyestudio EASY plug DHT11 Temperature and Humidity Sensor

Introduction

The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor.
It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and provides a pre-calibrated digital signal output.
This DHT11 sensor has fast response, anti-interference ability, excellent reliability and long term stability.


Specification

  • Connector: Easy plug
  • Supply Voltage: 5V
  • Relative Humidity and temperature measurement
  • Good for 20-90% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • Interface: Digital
  • Low Cost


Technical Details

  • Dimensions: 42mm*20mm*18mm
  • Weight: 5.6g


Connect It Up

Connect the EASY Plug DHT11 sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Below is an example code. Open or drag below code to Mixly Blocks and upload.

thumb


What You Should See

Open the Serial monitor, you should be able to see the temperature and humidity data.

thumb


Little Knowledge:

  • If the data is scrolling very fast, you can’t make out the data clearly, so you can modify the Delay time in the code to check it easily.


thumb


Extension Experiment


Make a Hygrothermograph

Hookup Guide
Connect the EASY Plug DHT11 sensor and 1602 LCD module to control board using RJ11 cables.
thumb


Test Code
Below is an example code.
thumb


What You Should See

thumb

Upload success, you should be able to see the temperature and humidity data are showed on the LCD screen.
thumb



Resources

Arduino Code and Datasheet:
https://drive.google.com/open?id=1pbeFuS1YsZ8lKFd7UIJqycp7alHwpMlJ

Mixly Code and Datasheet:
https://drive.google.com/open?id=1D7vcg_vTQzHq-ZdqdbtaOhvaBkCc7diP



Buy from