Gravity: SHT30模拟温湿度传感器

概述

Gravity:SHT30模拟温湿度传感器采用业内知名的瑞士Sensirion公司推出的新一代SHT30温湿度传感器芯片。得益于Sensirion的CMOSens®技术,高集成度电容式测湿元件和能隙式测温元件,SHT30能够提供极高的可靠性和出色的长期稳定性,具有功耗低、反应快、抗干扰能力强等优点。传感器内部经过校准、线性化与放大,能够输出与温湿度呈线性关系的模拟电压,无需额外的驱动库,使用简单方便,兼容常见的Arduino、micro:bit、ESP32等各类3.3V/5V主控系统,轻松实现城市环境监控、智能楼宇、工业自动化、智能家居等物联网应用场景的温湿度传感。

特性

应用场景

技术规格

温度测量性能

湿度测量性能

接口说明

SHT30模拟温湿度传感器

标号 名称 功能描述
1 - 电源负极
2 + 电源正极(3.3~5.5V)
3 RH 湿度模拟电压输出(0.3~2.7V)
4 T 温度模拟电压输出(0.3~2.7V)
5 / 2.54mm-4P通孔焊盘引出

引脚说明

温湿度输出特性

Arduino使用教程

准备

连线图

DFR0588_connection_Arduino(CH).png

样例代码

关于校准:

由于模拟读数受到参考电压的影响,较大程度影响温湿度传感器的读数精度。为了得到准确的读数,可使用高精度万用表测量主控的模拟参考电压(通常与供电电压一致),并修改下方样例代码中的“#define VREF 5.0”的参数,完成校准。 |

/**************************************************************************/
/*
    @file       SHT30_TempRH_Read.ino
    @author     Henry (DFRobot)
    @version    V1.0
    @date       2019-08-12
    @copyright  Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
    @licence    The MIT License (MIT)
    @breif      This example read and print the temperature and relative humidity.

    This demo and related libraries are for DFRobot Gravity: Analog SHT30 Temperature & Humidity Sensor
    Check out the links below for tutorials and connection diagrams
    Product(CH): http://www.dfrobot.com.cn/
    Product(EN): https://www.dfrobot.com/

*/
/**************************************************************************/

// VREF: Analog reference
// For Arduino UNO, Leonardo and mega2560, etc. change VREF to 5
// For Arduino Zero, Due, MKR Family, ESP32, etc. 3V3 controllers, change VREF to 3.3
#define VREF 5.0
#define TEMPERATURE_PIN A1
#define HUMIDITY_PIN A0
#define ADC_RESOLUTION 1024

float Tc, Tf, RH, analogVolt;

void setup() {
  Serial.begin(115200);
  Serial.println("SHT30 Starts up.");
}

void loop() {

  analogVolt = (float)analogRead(TEMPERATURE_PIN) / ADC_RESOLUTION * VREF;
  // Convert voltage to temperature (℃, centigrade)
  Tc = -66.875 + 72.917 * analogVolt;
  // Convert voltage to temperature (°F, fahrenheit )
  Tf = -88.375 + 131.25 * analogVolt;
  Serial.print("Termperature:" );
  Serial.print(Tc, 1);
  Serial.print(" C / " );
  Serial.print(Tf, 1);
  Serial.println(" F" );

  analogVolt = (float)analogRead(HUMIDITY_PIN) / ADC_RESOLUTION * VREF;
  // Convert voltage to relative humidity (%)
  RH = -12.5 + 41.667 * analogVolt;

  Serial.print("Humidity:" );
  Serial.print(RH, 1);
  Serial.println(" %RH" );

  Serial.println();
  delay(2000);
}

结果

DFR0588_Arduino_result.png

样例代码(Mind+)

DFR0588_UNO_MindPlus_Codes.png

micro:bit使用教程

准备

连线图

DFR0588_connection_micro-bit(CH).png

样例代码(Mind+)

DFR0588_microbit_MindPlus_Codes.png

常见问题

更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖。

更多

DFshopping_car1.png DFRobot商城购买链接