Arduino Projects

Interfacing SHT3x Temperature and Humidity sensor with Arduino

Learn how to connect highly reliable SHT3x temperature and humidity sensor with Arduino Uno board.


In this Quick tutorial, learn how to make a Realtime temperature and humidity monitor using SHT3x and Arduino by displaying their values on 16X2 LCD display module or on an OLED display.

Before getting started lets learn about SHT3x working and its pin diagram.

SHT3X Temperature and Humidity sensor, How it works and its pinout diagram:

There are many sensor boards out in the market which can measure temperature and humidity wisely, but when you need an accurate, precise and compact only few of them comes under the list. One of them is SHT3x series sensor as they are successors of SHT2x that set the industry level standards in humidity and temperature measurements, SHT3x comes with SHT30 and base version, SHT31 a standard version and All the way goes to SHT35 High end version which can be used in automotive level sensing.

SHT3x is packed with a completely new CMO Sens Chip, which will increase reliability along with improved accuracy in measuring. The SHT3x offers a range of new features when compared with SHT2x and other sensors, such as enhanced signal processing, two distinctive and user-selectable I2C addresses(0x44 or 0x45), an alert mode with programmable humidity and temperature limits, and communication speeds of up to 1 MHz.

Related Project: Digital Thermometer using LM35 and Arduino

SHT3x is more precise and accurate than other sensors like LM35, DHT11, DHT22, Thermistors, DS18B20 and has a greater range of measuring temperature than few of them which is  -40° to +125°C (-40° to +257°F) and relative humidity ranging from 0 to 100%. It also has wide input voltage range from 2.2v to 5.5v.

It has an accuracy of ±3% to ±1.5% in measuring humidity from base version to high-end version respectively, And ±0.3 to ±0.1 in temperature measurements.


Output I²C, Voltage Out
Supply voltage range 2.15 to 5.5 V
Energy consumption 4.8µW (at 2.4 V, low repeatability, 1 measurement / s)
RH operating range 0 – 100% RH
T operating range -40 to +125°C (-40 to +257°F)
RH response time 8 sec (tau63%)

SHT3x Pinout diagram:

Below is the pinout diagram of SHT3X Temperature and Humidity Sensor.

From the above pinout diagram, There you can see 4 pins two pins for Voltage input and Ground and another two pins for I2C connection SCL and SDA.

Interfacing SHT3x Temperature and Humidity sensor with Arduino

In this method we are going to connect SHT31 with Arduino and display the output over the LCD display.

EXTRAS: Using this sensor you can also build and IoT based Health monitoring system using ESP32 for measuring the room temperature and humidity

Required Components:

  • Sensirion SHT31 Humidity Temperature Sensor
  • Arduino UNO R3 Development Board
  • JHD162A 16×2 LCD Display
  • Few connecting wires

Circuit Diagram:

SHT3x Temperature and Humidity sensor with Arduino circuit diagramConnect all the required components as shown in the above schematic diagram. Here we used LCD module with I2C adapter if you wish to connect it directly with out I2C refer the below link.

Connect Arduino with LCD Display with out I2C.

Here we are connecting both devices in I2C connection, So we need to find there I2C addresses, If you already know there addresses you can mention in code, if not you can find them with I2C scanner which we used in our previous examples.

I2C scanner.

After connecting everything upload the code to Arduino, so it works accordingly.

Source Code:

Copy the below code and paste it in Arduino IDE, and select the correct board and serial port and click upload.

You need 2 libraries to run the below code you can directly install them through library manager or download them through below links manually.

  • Adafruit_SHT31.h : Link
  • LiquidCrystal_I2C.h : Link
After Uploading the code open the serial monitor to check the output and also you can see the temperature and Relative humidity on the LCD display which we connected.

SHT3x hygrometer and thermometer with Arduino outputAs you can see from the above image the LCD Display shows the temperature and Humidity values in Realtime so this Example is used to build Thermometer and Hygrometer.

Displaying output on OLED display:

This method is very easy if you read the above LCD I2C method. Everything is same in the circuit diagram except replacing the LCD display with OLED display as it has the same 4 pins.

Required components:

  • Sensirion SHT31 Humidity Temperature Sensor
  • Arduino UNO R3 Development Board
  • OLED Display
  • Few connecting wires

Circuit Diagram:

SHT3x Temperature and Humidity sensor with Arduino OLED display circuit diagramConnect all the required components as shown in the above schematic diagram. And upload the below given code to work as a Hygrometer and Thermometer.

Both the modules are connected in I2C method so if you need the I2C address use I2c Scanner, Link given above.

Source Code:


After uploading the code Open serial monitor and Check the OLED display to check the values as shown in the below image.

SHT3x hygrometer and thermometer with Arduino OLED outputIf you found this tutorial helpful please share it with your friends and if you have any doubts please feel free to contact us through Facebook page.

CircuitSchools Staff

We at CircuitSchools publish on basics of electronics and electric components and everything related to evolution of electrical technology with complete analysis of development boards and modules along with latest projects with innovative ideas.

Related Articles


  1. Hi, I am using ttgo lora esp32 that has ssd1306 oled display at sda/4 and scl/15 . I am trying to attach a SHT31 temp/humidity sensor via IIC to same sda/scl or a different sda/scl but somehow it couldnt find the sensor. When i use your code, which i assume uses the default sda/scl (GPIO 21/22) then the sensor works but the display does not as the display is connected to 4/15. Can you help?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button