SHTC1 digital humidity sensor and ESP8266 example

In this article we look at another digital humidity sensor – this time its the SHTC1 and we will connect it to a Wemos Mini

The SHTC1 is a digital humidity sensor designed especially for high-volume consumer electronics applications. This humidity sensor is strictly designed to overcome conventional limits for size, power consumption, and price-performance ratio, in order to fulfill the current and future requirements of the consumer electronics market.

Sensirion’s CMOSens® technology offers a complete sensor system on a single chip, consisting of a capacitive humidity sensor, a band-gap temperature sensor, analog and digital signal processing, A/D converter, calibration data memory, and a digital communication interface supporting I2C fast mode. The ultra-small, 2 × 2 × 0.75 mm3 DFN package enables applications to be placed in even the most limited of spaces. The sensor covers a humidity measurement range of 0 to 100 %RH and a temperature measurement range of –30°C to 100°C with a typical accuracy of ±3 %RH and ±0.3°C.

The operating voltage of 1.8 V and an energy budget below 1 µJ per measurement make the SHTC1 suitable for mobile or wireless applications running on the lowest power budgets. With the industry-proven quality and reliability of Sensirion’s humidity sensors and constant accuracy over a large measurement range, the SHTC1 humidity sensor offers an unprecedented price-performance ratio. Tape and reel packaging together with suitability for standard SMD assembly processes make the SHTC1 predestined for high-volume applications.

Features

Interface I²C
Supply voltage 1.8 V
Power consumption 2µW (at 1 reading per second in low power mode)
Measuring range (RH) 0 – 100% relative humidity
Measuring range (T) -30 to +100°C (-22 to +212°F)
Response time (RH) 8s (tau63%)

Parts List

Here are the parts I used

Name Links
Wemos Mini
SHTC1
Connecting cables

 

Schematic/Connection

Wemos Sensor
3.3v Vcc
Gnd Gnd
SDA (D2) SDA
SCL (D1) SCL

 

Code Example

This uses the library from https://github.com/Sensirion/arduino-sht

[codesyntax lang=”cpp”]

#include <Wire.h>

#include “SHTSensor.h”

SHTSensor sht;
// To use a specific sensor instead of probing the bus use this command:
// SHTSensor sht(SHTSensor::SHT3X);

void setup() {
// put your setup code here, to run once:

Wire.begin();
Serial.begin(9600);
delay(1000); // let serial console settle

if (sht.init()) {
Serial.print(“init(): success\n”);
} else {
Serial.print(“init(): failed\n”);
}
sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM); // only supported by SHT3x

}

void loop() {
// put your main code here, to run repeatedly:

if (sht.readSample()) {
Serial.print(“SHT:\n”);
Serial.print(” RH: “);
Serial.print(sht.getHumidity(), 2);
Serial.print(“\n”);
Serial.print(” T: “);
Serial.print(sht.getTemperature(), 2);
Serial.print(“\n”);
} else {
Serial.print(“Error in readSample()\n”);
}

delay(1000);
}

[/codesyntax]

 

Output

Open the serial monitor and you should see something like this

init(): success
SHT:
RH: 43.97
T: 20.05
SHT:
RH: 43.99
T: 20.01
SHT:
RH: 44.01
T: 20.00

 

Links

 

 

 

 

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here