Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Interfacing SHT3x Humidity & Temperature Sensor with Arduino
Arduino Projects

Interfacing SHT3x Humidity & Temperature Sensor with Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:August 22, 20225 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Interfacing SHT3x Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Interfacing SHT3x Humidity & Temperature Sensor with Arduino

In this project, we will design a Hygrometer and Thermometer using SHT3x Sensor and Arduino. We will be interfacing the SHT31 Humidity and Temperature sensor with Arduino and display the temperature and humidity value on the 16×2 LCD Display.

The SHT3x sensor is the most accurate and precise sensor for measuring humidity and temperature parameters compared to other temperature sensors like LM35, Thermistor, DS18B20 & DHT11/DHT22. Thus SHT3x can be used for industrial applications because of the high accuracy and good sensitivity. Its Relative Humidity operating range is 0 – 100% and Temperature operating range is -40° to +125°C (-40° to +257°F).

Check the advanced version of this project here:
1. ESP32 SHT31 Temperature & Humidity Monitor on Web Server

  1. ESP8266 SHT31 Humidity Temperature Monitoring on Thingspeak

Sensirion SHT3x Series Temperature and Humidity Sensors:

The new digital SHT3x humidity sensor series takes sensor technology to a new level. As the successor of the SHT2x series, it is determined to set the next industry standard in humidity sensing. The SHT3x humidity sensor series consists of a low-cost version with the SHT30 humidity sensor, a standard version with the SHT31 humidity sensor, and a high-end version with the SHT35 humidity sensor. The SHT3x humidity sensor series combines multiple functions and various interfaces (I2C, analog voltage output) with an applications-friendly, very wide operating voltage range (2.15 to 5.5 V). The SHT3x humidity sensor is available in both large and small volumes.

Its features include

1. High reliability and long-term stability
2. Industry-proven technology with a track record of more than 15 years
3. Designed for mass production
4. High process capability
5. Low signal noise
6. Output: I2C, Voltage Out
7. Supply voltage range: 2.4 to 5.5V
8. RH operating range: 0 – 100% RH
9. T operating range: -40° to +125°C (-40° to +257°F)
10. RH response time: 8 sec (tau63%)



Bill of Materials:

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
2SHT31 Humidity Temperature Sensor1Amazon | AliExpress
316x2 LCD Display1Amazon | AliExpress
4Potentiometer 10K1Amazon | AliExpress
5Connecting Wires10Amazon | AliExpress
6Breadboard1Amazon | AliExpress

Circuit Diagram & Connections:

Assemble the circuit as shown in the connection diagram below.

Interfacing SHT3x with Arduino Circuit Diagram

Connect LCD pins 4, 6, 11, 12, 13, 14 to Arduino 11, 12, 5, 4, 3, 2 digital pins.
Connect SDA and SCL pins of SHT31 to SDA and SCL Pins of Arduino, i.e A4, and A5 respectively.


Source Code/Program:

Here is a source code for interfacing SHT3x with Arduino for reading humidity and Temperature. Copy the code and upload it to the Arduino board. You need the SHT3x Sensor library. Download the library from here:
Download SHT31 Library

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <LiquidCrystal.h>
LiquidCrystal lcd (11,12,5,4,3,2);
#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
Adafruit_SHT31 sht31 = Adafruit_SHT31();
byte degree[8] =
{
0b00011,
0b00011,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
void setup() {
Serial.begin(9600);
lcd.begin(16,2);
lcd.createChar(1, degree);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens
Serial.println("SHT31 test");
if (! sht31.begin(0x44)) { // Set to 0x45 for alternate i2c addr
Serial.println("Couldn't find SHT31");
while (1) delay(1);
}
}
void loop() {
float t = sht31.readTemperature();
float h = sht31.readHumidity();
if (! isnan(t)) { // check if 'is not a number'
Serial.print("Temp *C = "); Serial.println(t);
lcd.print("Temp = ");
lcd.print(t);
lcd.write(1);
lcd.print("C");
} else {
Serial.println("Failed to read temperature");
lcd.print("Temperature Error");
}
if (! isnan(h)) { // check if 'is not a number'
Serial.print("Hum. % = "); Serial.println(h);
lcd.setCursor (0,1);
lcd.print("Hum. = ");
lcd.print(h);
lcd.print(" %");
} else {
Serial.println("Failed to read humidity");
lcd.setCursor (0,1);
lcd.print("Humidity Error");
}
Serial.println();
delay(1000);
lcd.clear();
}




Video Tutorial:

Watch this video tutorial below for understanding the entire project, i.e Interfacing SHT3x Humidity & Temperature Sensor with Arduino

SHT3x Humidity Temperature Sensor Tutorial | Interfacing SHT31 with Arduino
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleArduino DS3231 Real Time Clock with Alarm & Temperature
Next Article Arduino DS3231 Real Time Clock (RTC) with Temperature Monitor

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 5 Comments

5 Comments

  1. electronicsforengineer on February 16, 2019 11:59 PM

    Hi sir after reaching 125 degree centigrade, is it damaged or goes to saturation for some time?
    http://electronicsforengineer.com/

    Reply
  2. Ralph McCleery on May 21, 2020 7:38 AM

    Thank you for this tutorial, it was most helpful in my learning and a big lesson in debugging.
    You may want to update the following
    #1 The <> have been converted to ASCII HTML strings for the “include” statements
    #2 Initially the LCD didn’t work. I followed your schematic diagram and the sensor was working in the serial monitor but no display. I tried using LCD (4, 6, 11, 12, 13, 14) to Uno (2, 3, 4, 5, 6, 7) with “LiquidCrystal lcd = LiquidCrystal(2, 3, 4, 5, 6, 7);” statement and all was fine. Then I realized on your schematic diagram it looks like the RS and E have been inverted to what your LCD Object states.

    Reply
    • Mr. Alam on May 21, 2020 8:12 AM

      Thank you, I have corrected the code according to the circuit.

      Reply
  3. Vadim Aksyutin on November 1, 2021 11:46 AM

    How to set to 0x45 for alternate i2c addr for sht31? Thanks

    Reply
    • Admin on November 1, 2021 12:01 PM

      Check in the library folder and modify the library.

      Reply

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.