Arduino Nano - SHT30 Humidity & Temperature Sensor Tutorial

by Dcube Tech Ventures in Circuits > Electronics

112 Views, 0 Favorites, 0 Comments

Arduino Nano - SHT30 Humidity & Temperature Sensor Tutorial

Arduino Nano - SHT30 Humidity & Temperature  Sensor Tutorial

SHT30 Digital Humidity and Temperature Sensor offers superior performance and a space saving footprint. It provides calibrated, linearized signals in digital, I2C format. Fabrication of this sensor is based on CMOSens technology, which attributes to the superior performance and reliability of SHT30. The resolution of SHT30 can be changed by command, low battery can be detected and a checksum helps to improve communication reliability. Here is its demonstration of interfacing it with Arduino nano.

What You Need..!!

SHT30.jpg
nano.png

Connnection:

SHT30.jpg
nano.png
sensor.jpg
arduino_connect.JPG

Take an I2C shield for Arduino Nano and gently push it over the pins of Nano.

Then connect the one end of I2C cable to SHT30 sensor and the other end to the I2C shield.

Connections are shown in the picture above.

Code:

The Arduino code of SHT30 can be downloaded from our GitHub repository-Dcube Store.

Here is the link for the same :

https://github.com/DcubeTechVentures/SHT30...

We include library Wire.h to facilitate the I2c communication of the sensor with the Arduino board. You can also copy the code from here, it is given as follows:

// Distributed with a free-will license.

// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.

// SHT30

// This code is designed to work with the SHT30_I2CS I2C Mini Module available in Dcube Store.

#include

// SHT30 I2C address is 0x44(68)

#define Addr 0x44

void setup()

{

// Initialise I2C communication as MASTER

Wire.begin();

// Initialise serial communication, set baud rate = 9600

Serial.begin(9600);

delay(300);

}

void loop()

{

unsigned int data[6];

// Start I2C Transmission

Wire.beginTransmission(Addr);

// Send measurement command

Wire.write(0x2C);

Wire.write(0x06);

// Stop I2C transmission

Wire.endTransmission();

delay(500);

// Request 6 bytes of data

Wire.requestFrom(Addr, 6);

// Read 6 bytes of data

// cTemp msb, cTemp lsb, cTemp crc, humidity msb, humidity lsb, humidity crc

if (Wire.available() == 6)

{

data[0] = Wire.read();

data[1] = Wire.read();

data[2] = Wire.read();

data[3] = Wire.read();

data[4] = Wire.read();

data[5] = Wire.read();

}

// Convert the data

float cTemp = ((((data[0] * 256.0) + data[1]) * 175) / 65535.0) - 45;

float fTemp = (cTemp * 1.8) + 32;

float humidity = ((((data[3] * 256.0) + data[4]) * 100) / 65535.0);

// Output data to serial monitor

Serial.print("Relative Humidity : ");

Serial.print(humidity);

Serial.println(" %RH");

Serial.print("Temperature in Celsius : ");

Serial.print(cTemp);

Serial.println(" C");

Serial.print("Temperature in Fahrenheit : ");

Serial.print(fTemp);

Serial.println(" F");

delay(500);

}

Applications:

SHT30 temperature and relative humidity sensor has various industrial applications like temperature monitoring, computer peripheral thermal protection and so on..