Categories

Follow

SHT20 temperature and humidity sensor and ESP8266

The SHT2x series consists of a low-cost version with the SHT20 humidity sensor. the SHT2x provides calibrated, linearized sensor signals in digital, I2C format. The SHT2x humidity sensor series contains a capacitive-type humidity sensor, a band-gap temperature sensor, and specialized analog and digital integrated circuits – all on a single CMOSens® chip. This yields superior sensor performance in terms of accuracy and stability as well as minimal power consumption.

Every sensor is individually calibrated and tested. Furthermore, the resolution of the SHT2x humidity sensor can be changed on command (8/12 bit up to 12/14 bit for RH/T) and a checksum helps to improve communication reliability.

 

Parts List

 

Amount Part Type
1 Temperature and humidity detection sensor module SHT20
1 Wemos D1 mini V2

 

Schematics/Layout

 

 

Code

Again we use a library – https://github.com/DFRobot/DFRobot_SHT20

#include <Wire.h>
#include "DFRobot_SHT20.h"
 
DFRobot_SHT20    sht20;
 
void setup()
{
    Serial.begin(9600);
    Serial.println("SHT20 Example!");
    sht20.initSHT20();                                  // Init SHT20 Sensor
    delay(100);
    sht20.checkSHT20();                                 // Check SHT20 Sensor
}
 
void loop()
{
    float humd = sht20.readHumidity();                  // Read Humidity
    float temp = sht20.readTemperature();               // Read Temperature
    Serial.print("Time:");
    Serial.print(millis());
    Serial.print(" Temperature:");
    Serial.print(temp, 1);
    Serial.print("C");
    Serial.print(" Humidity:");
    Serial.print(humd, 1);
    Serial.print("%");
    Serial.println();
    delay(1000);
}

 

Output

Open the serial monitor – this is what I saw

Time:105462 Temperature:21.1C Humidity:55.6%
Time:106565 Temperature:21.1C Humidity:55.6%
Time:107669 Temperature:22.0C Humidity:55.7%
Time:108772 Temperature:24.8C Humidity:58.0%
Time:109875 Temperature:26.3C Humidity:61.1%
Time:110978 Temperature:27.3C Humidity:63.1%
Time:112081 Temperature:28.0C Humidity:64.4%

 

Links

Sensirion_Humidity_Sensors_SHT20_Datasheet.pdf

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

*