WeMos SHT30 Temp & Humidity Sensor Shield (HCWEMO0011)

Wemos ESP8266 based development boards and shields
Post Reply
admin
Site Admin
Posts: 865
Joined: Sun Aug 05, 2012 4:02 pm

WeMos SHT30 Temp & Humidity Sensor Shield (HCWEMO0011)

Post by admin » Thu Jun 08, 2017 9:57 am

Image






The WeMos SHT30 shield is a digital temperature and humidity sensor based upon the Sensirion SHT30 Sensor IC. This shield adds the ability to sense temperature to an accuracy of +/- 0.3oC and relative humidity to +/-3%. It is compatible with the WeMos mini, mini Pro (see item HWEMO0002), and mini lite (see item HCWEMO012) ESP8266/8285 based development boards. Although it is intended to be used with these WeMos boards is can also be used as a standalone module for other development boards.

To make programming this shield from your D1 mini / Arduino board as easy as possible we have created our own HCSHT3x Arduino compatible library. See below for where to download this library.

ImageImage



Features

I2C Interface
Two user selectable addresses
Typical accuracy ±3%RH and ±0.3°C
Separable design
Φ2mm mounting holes



Pins

D1 mini	GPIO	Shield
D1	5	SCL
D2	4	SDA





Image

  1. /* FILE:    HCSHT3x_Library_Example
  2.    DATE:    24/05/17
  3.    VERSION: 0.1
  4.    AUTHOR:  Andrew Davies
  5.    
  6. 24/05/17 version 0.1: Original version
  7.  
  8. This example sketch uses the HCSHT3x library to read the current temperature and humidity
  9. from a SHT3x device. The sketch repeatedly read the sensor once a second and output the results
  10. to the serial UART.
  11.  
  12. Hobby Components (HobbyComponents.com) products currently supported by this library:
  13.  
  14. WeMos SHT30 I2C Digital Temperature Humidity Sensor Shield (HCWEMO0011).
  15.  
  16. More information about the library can be found in the software section of our support
  17. forum here:
  18.  
  19. http://forum.hobbycomponents.com/software
  20.  
  21.  
  22. You may copy, alter and reuse this code in any way you like, but please leave
  23. reference to HobbyComponents.com in your comments if you redistribute this code.
  24. This software may not be used directly for the purpose of selling products that
  25. directly compete with Hobby Components Ltd's own range of products.
  26. THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
  27. EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  28. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
  29. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
  30. INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
  31. REASON WHATSOEVER.
  32. */
  33.  
  34.  
  35.  
  36. #include <HCSHT3x.h>      //Include the HCSHT3x library.
  37.  
  38. #define I2CADD 0x45       //I2C address of the SHT3x (0x44 or 0x45).
  39.  
  40. HCSHT3x HCSHT3x(I2CADD);  //Create an instance of the library.
  41.  
  42.  
  43. void setup()
  44. {
  45.   Serial.begin(9600);     //Initiliase the Arduino serial library.
  46.  
  47.   HCSHT3x.init();         //Initiliase the library.
  48. }
  49.  
  50.  
  51. void loop()
  52. {
  53.   //Trigger a temperature & humidity measurement and read back the results.
  54.   HCSHT3x.Read();      
  55.  
  56.   //If there are no errors out put the results to the serial UART.
  57.   if(HCSHT3x.CheckCRC())
  58.   {
  59.     Serial.print("Temp (oC): ");
  60.     Serial.print(HCSHT3x.Temp_oC());
  61.     Serial.print("\tTemp (oF): ");
  62.     Serial.print(HCSHT3x.Temp_oF());
  63.     Serial.print("\tHumidity (%RH): ");
  64.     Serial.println(HCSHT3x.Hum());
  65.   }else
  66.   {
  67.     Serial.println("CRC ERROR!");
  68.   }
  69.  
  70.   //Wait a second before taking another measurement.
  71.   delay(1000);
  72. }



Image


Schematic:

Current (V2.1.0):

sch_sht30_v2.1.0.pdf

Old (V1.0.0):

sch_sht30_v1.0.0_HCWEMO0011.pdf


SHT30 Datasheet:

Sensirion_Humidity_Sensors_SHT3x_Datasheet.pdf


HCSHT3x Arduino library can be downloaded from the software section of our support forum here: http://forum.hobbycomponents.com/viewto ... =58&t=2192




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 not 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.

Erdccc
Posts: 1
Joined: Mon Jan 28, 2019 3:26 pm

Re: WeMos SHT30 Temp & Humidity Sensor Shield (HCWEMO0011)

Post by Erdccc » Mon Jan 28, 2019 3:34 pm

Could you please show me how the code would be like if there were two SHT30 wired together?

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: WeMos SHT30 Temp & Humidity Sensor Shield (HCWEMO0011)

Post by andrew » Tue Jan 29, 2019 10:40 am

You just need to create two instances of the library and give them different names. Note that although it should work fine, this hasn't been tested as connecting two of these shields to one microcontroller is not something you would normally want to do but here is how you would do it:

  1. #include <HCSHT3x.h>
  2.  
  3. #define I2CADD1 0x45    
  4. #define I2CADD2 0x46    
  5.  
  6. HCSHT3x HCSHT3x1(I2CADD1);  //Create an instance of the library called HCSHT3x1..
  7. HCSHT3x HCSHT3x2(I2CADD2);  //Create another instance of the library called HCSHT3x2.
  8.  
  9.  
  10. void setup()
  11. {
  12.   Serial.begin(9600);     //Initiliase the Arduino serial library.
  13.  
  14.   HCSHT3x1.init();         //Initiliase the first instance of the library.
  15.   HCSHT3x2.init();         //Initiliase the second instance of the library.
  16. }
  17.  
  18.  
  19. void loop()
  20. {
  21.   //Trigger a temperature & humidity measurement for instance 1 and read back the results.
  22.   HCSHT3x1.Read();      
  23.  
  24.   //If there are no errors out put the results to the serial UART.
  25.   if(HCSHT3x1.CheckCRC())
  26.   {
  27.     Serial.print("Temp (oC): ");
  28.     Serial.print(HCSHT3x1.Temp_oC());
  29.     Serial.print("\tTemp (oF): ");
  30.     Serial.print(HCSHT3x1.Temp_oF());
  31.     Serial.print("\tHumidity (%RH): ");
  32.     Serial.println(HCSHT3x1.Hum());
  33.   }else
  34.   {
  35.     Serial.println("CRC ERROR!");
  36.   }
  37.  
  38.  
  39.   //Trigger a temperature & humidity measurement for instance 2 and read back the results.
  40.   HCSHT3x2.Read();      
  41.  
  42.   //If there are no errors out put the results to the serial UART.
  43.   if(HCSHT3x2.CheckCRC())
  44.   {
  45.     Serial.print("Temp (oC): ");
  46.     Serial.print(HCSHT3x2.Temp_oC());
  47.     Serial.print("\tTemp (oF): ");
  48.     Serial.print(HCSHT3x2.Temp_oF());
  49.     Serial.print("\tHumidity (%RH): ");
  50.     Serial.println(HCSHT3x2.Hum());
  51.   }else
  52.   {
  53.     Serial.println("CRC ERROR!");
  54.   }
  55.  
  56.   //Wait a second before taking another measurement.
  57.   delay(1000);
  58. }
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “WeMos”