Skip to content

Files

Latest commit

bba20d3 · Apr 2, 2025

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 13, 2022
Apr 2, 2025
Nov 13, 2022
May 16, 2023
Nov 13, 2022
Nov 13, 2022
Oct 11, 2021
Oct 11, 2021
Oct 11, 2021
Nov 13, 2022
Nov 13, 2022
Apr 2, 2025
Apr 2, 2025
Apr 15, 2024
May 26, 2021
Apr 2, 2025
Apr 2, 2025
May 26, 2021
Jul 8, 2022

SHT3x/SHT30/SHT31/SHT35 - Temperature & Humidity Sensor

SHT3x is the next generation of Sensirion's temperature and humidity sensors. This project supports SHT30, SHT31 and SHT35.

Documentation

Board

Sensor

Circuit diagram

Usage

Hardware Required

  • SHT3x
  • Male/Female Jumper Wires

Circuit

  • SCL - SCL
  • SDA - SDA
  • VCC - 5V
  • GND - GND
  • ADR - GND

Code

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.

I2cConnectionSettings settings = new I2cConnectionSettings(1, (byte)I2cAddress.AddrLow);
I2cDevice device = I2cDevice.Create(settings);

using (Sht3x sensor = new Sht3x(device))
{
    // read temperature (℃)
    double temperature = sensor.Temperature.Celsius;
    // read humidity (%)
    double humidity = sensor.Humidity;
    // open heater
    sensor.Heater = true;
}

Result

Sample result