Arduino and SHT21 humidity and temperature sensor


The digital SHT2x humidity sensor series is used in high volumes in a wide variety of applications and has today become the de facto industry standard. The SHT2x series consists of a low-cost version with the SHT20 humidity sensor, a standard version with the SHT21 humidity sensor, and a high-end version with the SHT25 humidity sensor. The open cavity mold package – which encapsulates the complete chip except for the humidity sensor area – protects the capacitive humidity sensor against external impact and facilitates excellent long-term stability.


Size : 3 x 3 x 1.1 mm
Output : I²C digital, PWM, SDM
Supply voltage range :  2.1 to 3.6 V
Energy consumption : 3.2µW (at 8 bit, 1 measurement / s)
RH operating range : 0 – 100% RH
T operating range : -40 to +125°C (-40 to +257°F)

Its an I2C device so again is very simple to connect to any arduino

This is the breakout for the sensor that I bought, as you can see its a tricky part to use for the hobbyist, so a breakout makes like easier


Here is a simple schematic, again be careful as Vcc is 3.3v with this device


SHT21 schematic
SHT21 schematic

Lets look at the required libraries and a basic code example, there is not much to this to be honest most of the work is done in the library


There are a couple of libraries to help you out

I used the latter one

[codesyntax lang=”cpp”]

#include <Wire.h>
#include <SHT2x.h>

void setup()

void loop()
  Serial.print("Humidity: ");
  Serial.print("Temperature(C): ");



these come in at about $7 for a useful breakout board with this sensor

SHT21 Digital Humidity And Temperature Sensor Module

This div height required for enabling the sticky sidebar
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :