Interfacing SHT3x Humidity & Temperature Sensor with Arduino

Interfacing SHT3x Arduino (Last Updated On: February 13, 2019)

Interfacing SHT3x Humidity & Temperature Sensor with Arduino

In this project we will design Hygrometer and Thermometer using SHT3x Sensor and Arduino. We will be interfacing SHT31 Humidity and Temperature sensor with Arduino and display the temperature and humidity value on 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).


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 a 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 includes

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%)



Components Required:

1. Arduino UNO Board (Buy Online from Amazon)
2. SHT3x Humidity & Temperature Sensor (Buy Online from Amazon)
3. 16*2 LCD Display (Buy Online from Amazon)
4. Breadboard
5. Connecting Wires

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 12, 11, 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 SHT3x Sensor library. Download the library from here:
Download SHT31 Library

#include <LiquidCrystal.h>
LiquidCrystal lcd (12,11,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 entire project, i.e Interfacing SHT3x Humidity & Temperature Sensor with Arduino

Recommended For You

1 Comment

Ask A Question .......

Close