Reply to topic  [ 1 post ] 
WeMos D1 Mini DHT Temp/Hum Shield (HCWEMO0003) 
Author Message
Site Admin

Joined: Sun Aug 05, 2012 4:02 pm
Posts: 633
Post WeMos D1 Mini DHT Temp/Hum Shield (HCWEMO0003)
Image






The DHT Shield is a digital temperature and humidity sensor utilising the DHT11 sensor. Temperature range is 0~60C (+/-2C) and the humidity range is 20-90%RH (+/-5%RH).

WeMos note: The temperature and humidity data read from the sensor is the result of the last measurement (the sensor will make a new measurement after data is read from the sensor). To get real-time data, you need to read twice. It is not recommended to repeatedly read from the sensor, reading interval should be more than 2 seconds to ensure accurate measurements.

Connection

D4 on the D1 mini should be connected to Data Out pin on the DHT module.




Image




Features:


Temperature: 0~60°C (±2°C)
Humidity: 20-90%RH (±5%RH)



Example Arduino Sketch:


Code:
/* WeMos relay example - HobbyComponents.com
   WeMos compatible DHT library can be downloaded from our support forum here:
   http://forum.hobbycomponents.com/viewtopic.php?f=111&t=2130 */

#include <dht.h>

dht DHT;

/* Define the DIO pin that will be used to communicate with the sensor */
#define DHT11_DIO D4


void setup()
{
  /* Setup the serial port for displaying the output of the sensor */
  Serial.begin(115200);
}

/* Main program loop */
void loop()
{
  /* Perform a read of the sensor and check if data was read OK */
  if (DHT.read11(DHT11_DIO) == DHTLIB_OK)
  {
    /* If so then output the current temperature and humidity to
    the serial port */
    Serial.print("Temperature: ");
    Serial.print((float)DHT.temperature, 2);
    Serial.print("oC\t");
    Serial.print("Humidity: ");
    Serial.print((float)DHT.humidity, 2);
    Serial.println("%");
  }else
  {
    /* If there was a problem reading from then sensor then output
    an error */
    Serial.println("ERROR");
  }

  /* Wait at least 2 seconds before reading a new temperature */
  delay(2000);
}




Image


DHT Arduino library modified for WeMos / ESP8266. Original library available from http://playground.arduino.cc//Main/DHTLib

Attachment:
DHTLib_ESP8266.zip



Schematic:
Attachment:
HCWEMO0003_Schematic.pdf


Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.


You do not have the required permissions to view the files attached to this post.


Wed Nov 23, 2016 10:51 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD